mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-21 04:34:27 +02:00
UefiCpuPkg/CpuS3DataDxe: Remove below 4G limitation.
Because PrepareApStartupVector() stores StackAddress to "mExchangeInfo->StackStart" (which has type (VOID*)), and because "UefiCpuPkg/PiSmmCpuDxeSmm/X64/MpFuncs.nasm" reads the latter with: add edi, StackStartAddressLocation add rax, qword [edi] mov rsp, rax mov qword [edi], rax in long-mode code. So code can remove below 4G limitation. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
b581721063
commit
6eab8b4368
@ -47,9 +47,7 @@ typedef struct {
|
|||||||
} ACPI_CPU_DATA_EX;
|
} ACPI_CPU_DATA_EX;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocate EfiACPIMemoryNVS below 4G memory address.
|
Allocate EfiACPIMemoryNVS memory.
|
||||||
|
|
||||||
This function allocates EfiACPIMemoryNVS below 4G memory address.
|
|
||||||
|
|
||||||
@param[in] Size Size of memory to allocate.
|
@param[in] Size Size of memory to allocate.
|
||||||
|
|
||||||
@ -57,7 +55,7 @@ typedef struct {
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
VOID *
|
VOID *
|
||||||
AllocateAcpiNvsMemoryBelow4G (
|
AllocateAcpiNvsMemory (
|
||||||
IN UINTN Size
|
IN UINTN Size
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -65,9 +63,8 @@ AllocateAcpiNvsMemoryBelow4G (
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
VOID *Buffer;
|
VOID *Buffer;
|
||||||
|
|
||||||
Address = BASE_4GB - 1;
|
|
||||||
Status = gBS->AllocatePages (
|
Status = gBS->AllocatePages (
|
||||||
AllocateMaxAddress,
|
AllocateAnyPages,
|
||||||
EfiACPIMemoryNVS,
|
EfiACPIMemoryNVS,
|
||||||
EFI_SIZE_TO_PAGES (Size),
|
EFI_SIZE_TO_PAGES (Size),
|
||||||
&Address
|
&Address
|
||||||
@ -230,9 +227,13 @@ CpuS3DataInitialize (
|
|||||||
AcpiCpuData->MtrrTable = (EFI_PHYSICAL_ADDRESS)(UINTN)&AcpiCpuDataEx->MtrrTable;
|
AcpiCpuData->MtrrTable = (EFI_PHYSICAL_ADDRESS)(UINTN)&AcpiCpuDataEx->MtrrTable;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Allocate stack space for all CPUs
|
// Allocate stack space for all CPUs.
|
||||||
|
// Use ACPI NVS memory type because this data will be directly used by APs
|
||||||
|
// in S3 resume phase in long mode. Also during S3 resume, the stack buffer
|
||||||
|
// will only be used as scratch space. i.e. we won't read anything from it
|
||||||
|
// before we write to it, in PiSmmCpuDxeSmm.
|
||||||
//
|
//
|
||||||
Stack = AllocateAcpiNvsMemoryBelow4G (NumberOfCpus * AcpiCpuData->StackSize);
|
Stack = AllocateAcpiNvsMemory (NumberOfCpus * AcpiCpuData->StackSize);
|
||||||
ASSERT (Stack != NULL);
|
ASSERT (Stack != NULL);
|
||||||
AcpiCpuData->StackAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)Stack;
|
AcpiCpuData->StackAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)Stack;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user