summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/Library
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2023-02-10 17:54:55 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-05-29 16:51:01 +0000
commit03663c4319003ccd911c93d11be37397a5881780 (patch)
tree4dfb1398c07d7f2058df510b83639870979db8a1 /ArmVirtPkg/Library
parent8e934ab9562a33191af21ce3babf1ad37a3cdc34 (diff)
downloadedk2-03663c4319003ccd911c93d11be37397a5881780.tar.gz
edk2-03663c4319003ccd911c93d11be37397a5881780.tar.bz2
edk2-03663c4319003ccd911c93d11be37397a5881780.zip
ArmVirtPkg/ArmVirtQemu: Use read-only memory region type for code flash
Map the code flash with read-only attributes so we can execute from it even under a memory protection regime that enables WXN, making all writable memory regions non-executable by default. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Diffstat (limited to 'ArmVirtPkg/Library')
-rw-r--r--ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c
index 23bd0fe68e..62fa62e5f0 100644
--- a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c
+++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c
@@ -115,7 +115,7 @@ ArmVirtGetMemoryMap (
VirtualMemoryTable[2].PhysicalBase = PcdGet64 (PcdFvBaseAddress);
VirtualMemoryTable[2].VirtualBase = VirtualMemoryTable[2].PhysicalBase;
VirtualMemoryTable[2].Length = FixedPcdGet32 (PcdFvSize);
- VirtualMemoryTable[2].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
+ VirtualMemoryTable[2].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO;
// End of Table
ZeroMem (&VirtualMemoryTable[3], sizeof (ARM_MEMORY_REGION_DESCRIPTOR));