UefiCpuPkg/PiSmmCpu: Enable 5 level paging when CPU supports
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1946 The patch changes SMM environment to use 5 level paging when CPU supports it. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
@@ -69,6 +69,7 @@ extern ASM_PFX(mXdSupported)
|
||||
global ASM_PFX(gPatchXdSupported)
|
||||
global ASM_PFX(gPatchSmiStack)
|
||||
global ASM_PFX(gPatchSmiCr3)
|
||||
global ASM_PFX(gPatch5LevelPagingSupport)
|
||||
global ASM_PFX(gcSmiHandlerTemplate)
|
||||
global ASM_PFX(gcSmiHandlerSize)
|
||||
|
||||
@@ -124,6 +125,17 @@ ProtFlatMode:
|
||||
ASM_PFX(gPatchSmiCr3):
|
||||
mov cr3, rax
|
||||
mov eax, 0x668 ; as cr4.PGE is not set here, refresh cr3
|
||||
|
||||
mov cl, strict byte 0 ; source operand will be patched
|
||||
ASM_PFX(gPatch5LevelPagingSupport):
|
||||
cmp cl, 0
|
||||
je SkipEnable5LevelPaging
|
||||
;
|
||||
; Enable 5-Level Paging bit
|
||||
;
|
||||
bts eax, 12 ; Set LA57 bit (bit #12)
|
||||
SkipEnable5LevelPaging:
|
||||
|
||||
mov cr4, rax ; in PreModifyMtrrs() to flush TLB.
|
||||
; Load TSS
|
||||
sub esp, 8 ; reserve room in stack
|
||||
|
Reference in New Issue
Block a user