From: Robbie King Date: Fri, 1 Jul 2022 15:06:17 +0000 (-0400) Subject: ArmPkg/Drivers: ArmGicIsInterruptEnabled returns incorrect value X-Git-Tag: edk2-stable202208~137 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=7861b24dc9c520449160e6322627587f0922b237 ArmPkg/Drivers: ArmGicIsInterruptEnabled returns incorrect value The issue appears to have been introduced by: 41fb5d46 : ArmPkg/ArmGic: Use the GIC Redistributor instead of GIC Distributor for GICv3 The changes to ArmGicIsInterruptEnabled() introduced the error where the Boolean result is assigned to Interrupts, but then the bit position check is performed again (against the computed Boolean result instead of the interrupt mask) during the return statement. Fix removes erroneous test and relies on boolean test made at return. Signed-off-by: Robbie King Reviewed-by: Ard Biesheuvel --- diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c b/ArmPkg/Drivers/ArmGic/ArmGicLib.c index 58ab45f812..dd3670c7cc 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c @@ -366,10 +366,9 @@ ArmGicIsInterruptEnabled ( FeaturePcdGet (PcdArmGicV3WithV2Legacy) || SourceIsSpi (Source)) { - Interrupts = ((MmioRead32 ( - GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset) - ) - & (1 << RegShift)) != 0); + Interrupts = MmioRead32 ( + GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset) + ); } else { GicCpuRedistributorBase = GicGetCpuRedistributorBase ( GicRedistributorBase,