From c5ab17430b2579dd79e3cbd497b8b9deccd34abc Mon Sep 17 00:00:00 2001 From: Oliver Smith-Denny Date: Fri, 19 Jul 2024 15:52:21 -0700 Subject: ArmPlatformPkg: PL031RealTimeClockLib: Set MMIO Memory XP PL031RealTimeClockLib will clear EFI_MEMORY_XP if a platform has set it for MMIO memory when it does not include that bit in its SetMemoryAttributes call. This region is not intended to be executed from and as such the lib should explicitly set EFI_MEMORY_XP to this region. Signed-off-by: Oliver Smith-Denny --- ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ArmPlatformPkg') diff --git a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c index 6ab3e99483..fb353cf2df 100644 --- a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c +++ b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c @@ -331,13 +331,13 @@ LibRtcInitialize ( EfiGcdMemoryTypeMemoryMappedIo, mPL031RtcBase, SIZE_4KB, - EFI_MEMORY_UC | EFI_MEMORY_RUNTIME + EFI_MEMORY_UC | EFI_MEMORY_RUNTIME | EFI_MEMORY_XP ); if (EFI_ERROR (Status)) { return Status; } - Status = gDS->SetMemorySpaceAttributes (mPL031RtcBase, SIZE_4KB, EFI_MEMORY_UC | EFI_MEMORY_RUNTIME); + Status = gDS->SetMemorySpaceAttributes (mPL031RtcBase, SIZE_4KB, EFI_MEMORY_UC | EFI_MEMORY_RUNTIME | EFI_MEMORY_XP); if (EFI_ERROR (Status)) { return Status; } -- cgit