]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/Drivers: ArmGicIsInterruptEnabled returns incorrect value
authorRobbie King <robbiek@xsightlabs.com>
Fri, 1 Jul 2022 15:06:17 +0000 (11:06 -0400)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 1 Jul 2022 15:28:08 +0000 (15:28 +0000)
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 <robbiek@xsightlabs.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
ArmPkg/Drivers/ArmGic/ArmGicLib.c

index 58ab45f812b337dc1e607ed50c93f17c49b66305..dd3670c7ccbb18586bb28f4ac02514055471529f 100644 (file)
@@ -366,10 +366,9 @@ ArmGicIsInterruptEnabled (
       FeaturePcdGet (PcdArmGicV3WithV2Legacy) ||\r
       SourceIsSpi (Source))\r
   {\r
-    Interrupts = ((MmioRead32 (\r
-                     GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset)\r
-                     )\r
-                   & (1 << RegShift)) != 0);\r
+    Interrupts = MmioRead32 (\r
+                   GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset)\r
+                   );\r
   } else {\r
     GicCpuRedistributorBase = GicGetCpuRedistributorBase (\r
                                 GicRedistributorBase,\r