audk/ArmPkg/Drivers/ArmGic
Ard Biesheuvel 61a7b0ec63 ArmPkg/Gic: force GIC driver to run before CPU arch protocol driver
Currently, the GIC driver has a static dependency on the CPU arch protocol
driver, so it can register its IRQ handler at init time. This means there
is a window between dispatch of the CPU driver and dispatch of the GIC
driver where any unexpected GIC state may trigger an interrupt which we
are not set up to handle yet. Note that this is even the case if we enter
UEFI with interrupts disabled at the CPU, given that any TPL manipulation
involving TPL_HIGH_LEVEL will unconditionally enable IRQs at the CPU side
regardless of whether they were enabled to begin with (but only as soon as
the CPU arch protocol is actually installed)

So let's reorder the GIC driver with the CPU driver, and let it run its
initialization that puts the GIC into a known state before enabling
interrupts. Move its installation of its IRQ handler to a protocol notify
callback on the CPU arch protocol so that it runs as soon as it becomes
available.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Marc Zyngier <marc.zyngier@arm.com>
2018-02-06 18:59:34 +00:00
..
GicV2 ArmPkg: remove unused ArmGicSecLib library implementation 2017-11-26 10:58:30 +00:00
GicV3 ArmPkg/ArmGicDxe: Expose HardwareInterrupt2 protocol 2017-10-05 21:23:39 +01:00
ArmGicCommonDxe.c ArmPkg/Gic: force GIC driver to run before CPU arch protocol driver 2018-02-06 18:59:34 +00:00
ArmGicDxe.c ArmPkg/ArmGic: Added GicV3 support to ArmGicDxe 2014-10-27 10:30:53 +00:00
ArmGicDxe.h ArmPkg/Gic: force GIC driver to run before CPU arch protocol driver 2018-02-06 18:59:34 +00:00
ArmGicDxe.inf ArmPkg/Gic: force GIC driver to run before CPU arch protocol driver 2018-02-06 18:59:34 +00:00
ArmGicLib.c ArmPkg: Tidy GIC code before changes. 2017-10-05 17:45:16 +01:00
ArmGicLib.inf ArmPkg: split off ArmGicArchLib from ArmGicLib 2015-07-28 20:44:44 +00:00
ArmGicNonSecLib.c ArmPkg/ArmGic: fix bug in GICv3 distributor configuration 2015-12-15 13:08:48 +00:00
ArmGicSecLib.c ArmPkg: merge ArmGicV[23]Lib.h into ArmGicLib.h 2015-07-28 20:44:27 +00:00