UefiCpuPkg: Has APs in 64 bit long-mode before booting to OS.
During the finalization of Mp initialization before booting into the OS, depending on whether Mwait is supported or not, AsmRelocateApLoop places Aps in MWAIT-loop or HLT-loop. Since paging is necessary for long mode, the original implementation of moving APs to 32-bit was to disable paging to ensure that the booting does not crash. The current modification creates a page table in reserved memory, avoiding switching modes and reclaiming memory by OS. This modification is only for 64 bit mode. More specifically, we keep the AMD logic as the original code flow, extract and update the Intel-related code, where the APs would stay in 64-bit, and run in a Mwait or Hlt loop until the OS wake them up. Signed-off-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
7bda8c6481
commit
73ccde8f6d
@@ -392,12 +392,9 @@ typedef
|
||||
(EFIAPI *ASM_RELOCATE_AP_LOOP)(
|
||||
IN BOOLEAN MwaitSupport,
|
||||
IN UINTN ApTargetCState,
|
||||
IN UINTN PmCodeSegment,
|
||||
IN UINTN TopOfApStack,
|
||||
IN UINTN NumberToFinish,
|
||||
IN UINTN Pm16CodeSegment,
|
||||
IN UINTN SevEsAPJumpTable,
|
||||
IN UINTN WakeupBuffer
|
||||
IN UINTN Cr3
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -512,6 +509,20 @@ WakeUpAP (
|
||||
IN BOOLEAN WakeUpDisabledAps
|
||||
);
|
||||
|
||||
/**
|
||||
Create 1:1 mapping page table in reserved memory to map the specified address range.
|
||||
|
||||
@param[in] LinearAddress The start of the linear address range.
|
||||
@param[in] Length The length of the linear address range.
|
||||
|
||||
@return The page table to be created.
|
||||
**/
|
||||
UINTN
|
||||
CreatePageTable (
|
||||
IN UINTN Address,
|
||||
IN UINTN Length
|
||||
);
|
||||
|
||||
/**
|
||||
Initialize global data for MP support.
|
||||
|
||||
|
Reference in New Issue
Block a user