]> git.proxmox.com Git - mirror_edk2.git/commit - UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
UefiCpuPkg: Has APs in 64 bit long-mode before booting to OS.
authorXie, Yuanhao <yuanhao.xie@intel.com>
Mon, 19 Dec 2022 21:40:15 +0000 (05:40 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 20 Dec 2022 08:38:28 +0000 (08:38 +0000)
commit73ccde8f6d04a246377cabaed2875e69d4b6b719
treea81994659df453fd0c08bcef1cda819f6097e93d
parent7bda8c648192d76f7b3f7cee54bd7b1c86a6a84f
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>
UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
UefiCpuPkg/Library/MpInitLib/Ia32/CreatePageTable.c [new file with mode: 0644]
UefiCpuPkg/Library/MpInitLib/MpLib.h
UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c [new file with mode: 0644]
UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm
UefiCpuPkg/UefiCpuPkg.dsc