audk/ArmPkg/Drivers/ArmGic
Alexei Fedorov 7989300df7 ArmPkg/ArmGicDxe: Fix double GIC EIOR write per interrupt
This commit fixes a bug in the GIC v2 and v3 drivers where the GICC_EOIR
(End Of Interrupt Register) is written twice for a single interrupt.
GicV(2|3)IrqInterruptHandler() calls the Interrupt Handler and then
GicV(2|3)EndOfInterrupt() on exit:

 InterruptHandler = gRegisteredInterruptHandlers[GicInterrupt];
 if (InterruptHandler != NULL) {
   // Call the registered interrupt handler.
   InterruptHandler (GicInterrupt, SystemContext);
 } else {
   DEBUG ((EFI_D_ERROR, "Spurious GIC interrupt: 0x%x\n", GicInterrupt));
 }

 GicV2EndOfInterrupt (&gHardwareInterruptV2Protocol, GicInterrupt);

although gInterrupt->EndOfInterrupt() can be expected to have already
been called by InterruptHandler() [which is the case for the primary
in-tree handler in TimerDxe]

The fix moves the EndOfInterrupt() call inside the else case for
unregistered/spurious interrupts. This removes a potential race
condition that might have lost interrupts.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Alexei Fedorov <alexei.fedorov@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2016-08-08 15:46:00 +02:00
..
GicV2 ArmPkg/ArmGicDxe: Fix double GIC EIOR write per interrupt 2016-08-08 15:46:00 +02:00
GicV3 ArmPkg/ArmGicDxe: Fix double GIC EIOR write per interrupt 2016-08-08 15:46:00 +02:00
ArmGicCommonDxe.c ArmPkg/Gic: Fix boundary checking bug 2016-04-25 13:28:40 +02:00
ArmGicDxe.c ArmPkg/ArmGic: Added GicV3 support to ArmGicDxe 2014-10-27 10:30:53 +00:00
ArmGicDxe.h ArmPkg/ArmGic: Added GicV3 support to ArmGicDxe 2014-10-27 10:30:53 +00:00
ArmGicDxe.inf ArmPkg/ArmGic: enable ARE bit before driving GICv3 in native mode 2015-02-16 10:27:02 +00:00
ArmGicLib.c ArmPkg/ArmGicLib: manage GICv3 SPI state at the distributor 2016-07-13 16:37:21 +02: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
ArmGicSecLib.inf ArmPkg: split off ArmGicArchLib from ArmGicLib 2015-07-28 20:44:44 +00:00