diff options
author | Sami Mujawar <sami.mujawar@arm.com> | 2023-05-16 14:12:57 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-06-01 15:52:01 +0000 |
commit | 8da2b97392f245f3e3f6bb5b1b0d05c670b82bca (patch) | |
tree | 9929970f903e9ca45f430861ad4a946c54b76874 /ArmPkg | |
parent | cfb4a10d76e2ef47438e7fa5b71d5f87d09c3dcd (diff) | |
download | edk2-8da2b97392f245f3e3f6bb5b1b0d05c670b82bca.tar.gz edk2-8da2b97392f245f3e3f6bb5b1b0d05c670b82bca.tar.bz2 edk2-8da2b97392f245f3e3f6bb5b1b0d05c670b82bca.zip |
ArmPkg: Prevent SgiId from setting RES0 bits of GICD_SGIR
GICD_SGIR is a 32-bit register, of which INTID is bits [3:0] and Bits
[14:4] is RES0. Since SgiId parameter in the function ArmGicSendSgiTo ()
is UINT8, mask unused bits of SgiId before writing to the GICD_SGIR
register to prevent accidental setting of the RES0 bits.
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'ArmPkg')
-rw-r--r-- | ArmPkg/Drivers/ArmGic/ArmGicLib.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c b/ArmPkg/Drivers/ArmGic/ArmGicLib.c index eefe6350eb..0127cca3bf 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c @@ -148,7 +148,9 @@ ArmGicSendSgiTo ( {
MmioWrite32 (
GicDistributorBase + ARM_GIC_ICDSGIR,
- ((TargetListFilter & 0x3) << 24) | ((CPUTargetList & 0xFF) << 16) | SgiId
+ ((TargetListFilter & 0x3) << 24) |
+ ((CPUTargetList & 0xFF) << 16) |
+ (SgiId & 0xF)
);
}
|