git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10825
6f19259b-4bc3-4df7-8a09-
765794883524
while ((Hob.Raw = GetNextHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, Hob.Raw)) != NULL) {\r
if (CompareGuid (&gEfiHobMemoryAllocStackGuid, &(Hob.MemoryAllocationStack->AllocDescriptor.Name))) {\r
//\r
while ((Hob.Raw = GetNextHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, Hob.Raw)) != NULL) {\r
if (CompareGuid (&gEfiHobMemoryAllocStackGuid, &(Hob.MemoryAllocationStack->AllocDescriptor.Name))) {\r
//\r
- // Build a new memory allocation HOB with old stack info with EfiConventionalMemory type\r
- // to be reclaimed by DXE core.\r
+ // Build a new memory allocation HOB with old stack info with EfiBootServicesData type. Need to \r
+ // avoid this region be reclaimed by DXE core as the IDT built in SEC might be on stack, and some \r
+ // PEIMs may also keep key information on stack\r
//\r
BuildMemoryAllocationHob (\r
Hob.MemoryAllocationStack->AllocDescriptor.MemoryBaseAddress,\r
Hob.MemoryAllocationStack->AllocDescriptor.MemoryLength,\r
//\r
BuildMemoryAllocationHob (\r
Hob.MemoryAllocationStack->AllocDescriptor.MemoryBaseAddress,\r
Hob.MemoryAllocationStack->AllocDescriptor.MemoryLength,\r
- EfiConventionalMemory\r
);\r
//\r
// Update the BSP Stack Hob to reflect the new stack info.\r
);\r
//\r
// Update the BSP Stack Hob to reflect the new stack info.\r