diff options
author | Oliver Smith-Denny <osde@linux.microsoft.com> | 2024-08-26 10:18:04 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-08-29 08:47:26 +0000 |
commit | 254641f342ac3c1991e0e4d32c0ea9c8cfc723f3 (patch) | |
tree | dd05cbf78764aadac324a3f017b2d2a704478a80 /MdeModulePkg | |
parent | 31f022500549f1d862af531da704a9b3c6568ff5 (diff) | |
download | edk2-254641f342ac3c1991e0e4d32c0ea9c8cfc723f3.tar.gz edk2-254641f342ac3c1991e0e4d32c0ea9c8cfc723f3.tar.bz2 edk2-254641f342ac3c1991e0e4d32c0ea9c8cfc723f3.zip |
MdeModulePkg: MAT: Do Not Set EfiMemoryMappedIo[PortSpace] Attrs
Per UEFI spec 2.10 section 4.6.3 EFI_MEMORY_ATTRIBUTES_TABLE,
"The Memory Attributes Table is currently used to describe memory
protections that may be applied to the EFI Runtime code and data
by an operating system or hypervisor. Consumers of this table must
currently ignore entries containing any values for Type except for
EfiRuntimeServicesData and EfiRuntimeServicesCode to ensure
compatibility with future uses of this table."
However, the current MAT code also enforces attributes for
EfiMemoryMappedIo and EfiMemoryMappedIoPortSpace, which it should
not be. Per
https://edk2.groups.io/g/devel/topic/patch_v1_mdemodulepkg/105570114?p=,,,20,0,0,0::recentpostdate/sticky,,,20,2,0,105570114,
it was suggested to remove these types from the MAT logic.
This patch removes EfiMemoryMappedIo and EfiMemoryMappedIoPortSpace
from the MAT logic in accordance with the UEFI spec.
Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c b/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c index e9343a2c4e..5fe285c48b 100644 --- a/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c +++ b/MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c @@ -426,7 +426,7 @@ MergeMemoryMap ( /**
Enforce memory map attributes.
- This function will set EfiRuntimeServicesData/EfiMemoryMappedIO/EfiMemoryMappedIOPortSpace to be EFI_MEMORY_XP.
+ This function will set EfiRuntimeServicesData to be EFI_MEMORY_XP.
@param MemoryMap A pointer to the buffer in which firmware places
the current memory map.
@@ -452,8 +452,6 @@ EnforceMemoryMapAttribute ( // do nothing
break;
case EfiRuntimeServicesData:
- case EfiMemoryMappedIO:
- case EfiMemoryMappedIOPortSpace:
MemoryMapEntry->Attribute |= EFI_MEMORY_XP;
break;
case EfiReservedMemoryType:
|