From: Malgorzata Kukiello Date: Thu, 24 Sep 2020 10:21:31 +0000 (+0800) Subject: MdeModulePkg/Core/Dxe: expose SP and CRYPTO capabilities in UEFI memmap X-Git-Tag: edk2-stable202011~162 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=f1567720b13a578ffa54716119f826df622babcd;p=mirror_edk2.git MdeModulePkg/Core/Dxe: expose SP and CRYPTO capabilities in UEFI memmap OSs are now capable of treating SP and CRYPTO memory as true capabilities and therefore these should be exposed. This requires usage of a separate ACCESS_MASK to hide all page-access permission capabilities. Change in masking and hiding of SP and CRYPTO was introduced in 3bd5c994c879f78e8e3d5346dc3b627f199291aa Signed-off-by: Malgorzata Kukiello Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao Cc: Oleksiy Yakovlev Cc: Ard Biesheuvel (ARM address) Reviewed-by: Laszlo Ersek Reviewed-by: Liming Gao --- diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c index 2c2c9cd6c3..731bf08bc9 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -1924,16 +1924,16 @@ CoreGetMemoryMap ( // set attributes and change memory paging attribute accordingly. // But current EFI_MEMORY_DESCRIPTOR.Attribute is assigned by // value from Capabilities in GCD memory map. This might cause - // boot problems. Clearing all paging related capabilities can - // workaround it. Following code is supposed to be removed once - // the usage of EFI_MEMORY_DESCRIPTOR.Attribute is clarified in - // UEFI spec and adopted by both EDK-II Core and all supported - // OSs. + // boot problems. Clearing all page-access permission related + // capabilities can workaround it. Following code is supposed to + // be removed once the usage of EFI_MEMORY_DESCRIPTOR.Attribute + // is clarified in UEFI spec and adopted by both EDK-II Core and + // all supported OSs. // MemoryMapEnd = MemoryMap; MemoryMap = MemoryMapStart; while (MemoryMap < MemoryMapEnd) { - MemoryMap->Attribute &= ~(UINT64)EFI_MEMORY_ATTRIBUTE_MASK; + MemoryMap->Attribute &= ~(UINT64)EFI_MEMORY_ACCESS_MASK; MemoryMap = NEXT_MEMORY_DESCRIPTOR (MemoryMap, Size); } MergeMemoryMap (MemoryMapStart, &BufferSize, Size);