} ACPI_CPU_DATA_EX;\r
\r
/**\r
- Allocate EfiACPIMemoryNVS below 4G memory address.\r
-\r
- This function allocates EfiACPIMemoryNVS below 4G memory address.\r
+ Allocate EfiACPIMemoryNVS memory.\r
\r
@param[in] Size Size of memory to allocate.\r
\r
\r
**/\r
VOID *\r
-AllocateAcpiNvsMemoryBelow4G (\r
+AllocateAcpiNvsMemory (\r
IN UINTN Size\r
)\r
{\r
EFI_STATUS Status;\r
VOID *Buffer;\r
\r
- Address = BASE_4GB - 1;\r
Status = gBS->AllocatePages (\r
- AllocateMaxAddress,\r
+ AllocateAnyPages,\r
EfiACPIMemoryNVS,\r
EFI_SIZE_TO_PAGES (Size),\r
&Address\r
AcpiCpuData->MtrrTable = (EFI_PHYSICAL_ADDRESS)(UINTN)&AcpiCpuDataEx->MtrrTable;\r
\r
//\r
- // Allocate stack space for all CPUs\r
+ // Allocate stack space for all CPUs.\r
+ // Use ACPI NVS memory type because this data will be directly used by APs\r
+ // in S3 resume phase in long mode. Also during S3 resume, the stack buffer\r
+ // will only be used as scratch space. i.e. we won't read anything from it\r
+ // before we write to it, in PiSmmCpuDxeSmm.\r
//\r
- Stack = AllocateAcpiNvsMemoryBelow4G (NumberOfCpus * AcpiCpuData->StackSize);\r
+ Stack = AllocateAcpiNvsMemory (NumberOfCpus * AcpiCpuData->StackSize);\r
ASSERT (Stack != NULL);\r
AcpiCpuData->StackAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)Stack;\r
\r