diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2024-03-01 08:43:56 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-03-01 18:47:27 +0000 |
commit | b7a97bfac52819d37310106e467623b0ed4a8f87 (patch) | |
tree | 9c411c2ae84091e4eb2e648f5c9bece99bbd5773 /OvmfPkg/ResetVector/Ia32 | |
parent | 4329b5b0cd58891e1385c90a5e509c91ba0eb891 (diff) | |
download | edk2-b7a97bfac52819d37310106e467623b0ed4a8f87.tar.gz edk2-b7a97bfac52819d37310106e467623b0ed4a8f87.tar.bz2 edk2-b7a97bfac52819d37310106e467623b0ed4a8f87.zip |
OvmfPkg/ResetVector: split TDX BSP workflow
Create a separate control flow for TDX BSP.
TdxPostBuildPageTables will now only be called when running in TDX
mode, so the TDX check in that function is not needed any more.
No functional change.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20240301074402.98625-5-kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Oliver Steffen <osteffen@redhat.com>
Cc: Michael Roth <michael.roth@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
[lersek@redhat.com: turn the "Cc:" message headers from Gerd's on-list
posting into "Cc:" tags in the commit message, in order to pacify
"PatchCheck.py"]
Diffstat (limited to 'OvmfPkg/ResetVector/Ia32')
-rw-r--r-- | OvmfPkg/ResetVector/Ia32/IntelTdx.asm | 4 | ||||
-rw-r--r-- | OvmfPkg/ResetVector/Ia32/PageTables64.asm | 15 |
2 files changed, 10 insertions, 9 deletions
diff --git a/OvmfPkg/ResetVector/Ia32/IntelTdx.asm b/OvmfPkg/ResetVector/Ia32/IntelTdx.asm index 06794baef8..c6b86019df 100644 --- a/OvmfPkg/ResetVector/Ia32/IntelTdx.asm +++ b/OvmfPkg/ResetVector/Ia32/IntelTdx.asm @@ -197,11 +197,7 @@ NotTdx: ; Set byte[TDX_WORK_AREA_PGTBL_READY] to 1
;
TdxPostBuildPageTables:
- cmp byte[WORK_AREA_GUEST_TYPE], VM_GUEST_TDX
- jne ExitTdxPostBuildPageTables
mov byte[TDX_WORK_AREA_PGTBL_READY], 1
-
-ExitTdxPostBuildPageTables:
OneTimeCallRet TdxPostBuildPageTables
;
diff --git a/OvmfPkg/ResetVector/Ia32/PageTables64.asm b/OvmfPkg/ResetVector/Ia32/PageTables64.asm index 14cc2c33aa..166e80293c 100644 --- a/OvmfPkg/ResetVector/Ia32/PageTables64.asm +++ b/OvmfPkg/ResetVector/Ia32/PageTables64.asm @@ -112,7 +112,7 @@ SetCr3ForPageTables64: ; is set.
OneTimeCall CheckTdxFeaturesBeforeBuildPagetables
cmp eax, TDX_BSP
- je ClearOvmfPageTables
+ je TdxBspInit
cmp eax, TDX_AP
je SetCr3
@@ -124,16 +124,21 @@ SetCr3ForPageTables64: ; the page table build below.
OneTimeCall GetSevCBitMaskAbove31
-ClearOvmfPageTables:
ClearOvmfPageTables
CreatePageTables4Level edx
; Clear the C-bit from the GHCB page if the SEV-ES is enabled.
OneTimeCall SevClearPageEncMaskForGhcbPage
+ jmp SetCr3
- ; TDX will do some PostBuildPages task, such as setting
- ; byte[TDX_WORK_AREA_PGTBL_READY].
- OneTimeCall TdxPostBuildPageTables
+TdxBspInit:
+ ;
+ ; TDX BSP workflow
+ ;
+ ClearOvmfPageTables
+ CreatePageTables4Level 0
+ OneTimeCall TdxPostBuildPageTables
+ jmp SetCr3
SetCr3:
;
|