OSDN Git Service

irqchip/gic-v3: Probe for SCR_EL3 being clear before resetting AP0Rn
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 20 Mar 2018 09:46:42 +0000 (09:46 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Thu, 22 Mar 2018 13:46:18 +0000 (13:46 +0000)
commit33625282adaaba93d37aa437ae9688bf0cc024a9
tree3cfda95aa133f0ff49d11bf5682647eb4faec367
parent66569052fe5328729ff696c1ec17913907d00b5f
irqchip/gic-v3: Probe for SCR_EL3 being clear before resetting AP0Rn

We would like to reset the Group-0 Active Priority Registers
at boot time if they are available to us. They would be available
if SCR_EL3.FIQ was not set, but we cannot directly probe this bit,
and short of checking, we may end-up trapping to EL3, and the
firmware may not be please to get such an exception. Yes, this
is dumb.

Instead, let's use PMR to find out if its value gets affected by
SCR_EL3.FIQ being set. We use the fact that when SCR_EL3.FIQ is
set, the LSB of the priority is lost due to the shifting back and
forth of the actual priority. If we read back a 0, we know that
Group0 is unavailable. In case we read a non-zero value, we can
safely reset the AP0Rn register.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm/include/asm/arch_gicv3.h
arch/arm64/include/asm/arch_gicv3.h
drivers/irqchip/irq-gic-v3.c