From 9f1ab373f470b06f25311275eaf9631d616d16da Mon Sep 17 00:00:00 2001 From: Taylor Beebe Date: Thu, 4 Jan 2024 10:00:24 -0800 Subject: [PATCH] initial upload --- MdeModulePkg/Core/Dxe/Misc/MemoryProtectionSupport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtectionSupport.c b/MdeModulePkg/Core/Dxe/Misc/MemoryProtectionSupport.c index dec47efd72..2f3a027baa 100644 --- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtectionSupport.c +++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtectionSupport.c @@ -2171,9 +2171,9 @@ SeparateSpecialRegionsInMemoryMap ( { MapEntryStart = (UINTN)MemoryMapEntry->PhysicalStart; MapEntryEnd = (UINTN)MemoryMapEntry->PhysicalStart + (UINTN)EFI_PAGES_TO_SIZE (MemoryMapEntry->NumberOfPages); - if ((MapEntryStart <= SpecialRegionStart) && (MapEntryEnd > SpecialRegionStart)) { - // Check if some portion of the map entry isn't covered by the special region - if (MapEntryStart != SpecialRegionStart) { + if (CHECK_OVERLAP (SpecialRegionStart, SpecialRegionEnd, MapEntryStart, MapEntryEnd)) { + // Check if some portion before the map entry isn't covered by the special region + if (MapEntryStart < SpecialRegionStart) { // Populate a new descriptor for the region before the special region. This entry can go to the end // of the memory map because the special region list is sorted POPULATE_MEMORY_DESCRIPTOR_ENTRY (