From 1b8ca81133f1860a08d6e5477ab8d2fdf4b23b1e Mon Sep 17 00:00:00 2001 From: Oliver Smith-Denny Date: Fri, 19 Jul 2024 15:50:48 -0700 Subject: [PATCH] ArmVirtPkg: KvmtoolRtcFdtClientLib: Set MMIO Memory NX When setting memory attributes on its MMIO region, KvmtoolRtcFdtClientLib will clear EFI_MEMORY_XP from the region if a platform has it set. This MMIO region is not intended to be executed from, so fix this by explicitly setting EFI_MEMORY_XP on this region in the lib. Signed-off-by: Oliver Smith-Denny --- .../Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c index e8d3576a71..2afb56ccf8 100644 --- a/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c +++ b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c @@ -44,7 +44,7 @@ KvmtoolRtcMapMemory ( EfiGcdMemoryTypeMemoryMappedIo, RtcPageBase, EFI_PAGE_SIZE, - EFI_MEMORY_UC | EFI_MEMORY_RUNTIME + EFI_MEMORY_UC | EFI_MEMORY_RUNTIME | EFI_MEMORY_XP ); if (EFI_ERROR (Status)) { DEBUG (( @@ -80,7 +80,7 @@ KvmtoolRtcMapMemory ( Status = gDS->SetMemorySpaceAttributes ( RtcPageBase, EFI_PAGE_SIZE, - EFI_MEMORY_UC | EFI_MEMORY_RUNTIME + EFI_MEMORY_UC | EFI_MEMORY_RUNTIME | EFI_MEMORY_XP ); if (EFI_ERROR (Status)) { DEBUG ((