UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation logic

This patch is to remove legacy SmBase relocation in
PiSmmCpuDxeSmm Driver. The responsibility for SmBase
relocation has been transferred to the SmmRelocationInit
interface, which now handles the following tasks:
1. Relocates the SmBase for each processor.
2. Generates the gSmmBaseHobGuid HOB.

As a result of this change, the PiSmmCpuDxeSmm driver's
role in SMM environment setup is simplified to:
1. Utilize the gSmmBaseHobGuid to determine the SmBase.
2. Perform the ExecuteFirstSmiInit() to do early SMM
initialization.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zeng Star <star.zeng@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Jiaxin Wu
2024-01-12 15:33:20 +08:00
committed by mergify[bot]
parent 23ed7f209c
commit 2727231b0a
11 changed files with 40 additions and 856 deletions

View File

@@ -1513,9 +1513,7 @@ SmiRendezvous (
ASSERT (CpuIndex < mMaxNumberOfCpus);
if (mSmmRelocated) {
ASSERT (mSmmInitialized != NULL);
}
ASSERT (mSmmInitialized != NULL);
//
// Save Cr2 because Page Fault exception in SMM may override its value,
@@ -1524,11 +1522,11 @@ SmiRendezvous (
Cr2 = 0;
SaveCr2 (&Cr2);
if (mSmmRelocated && !mSmmInitialized[CpuIndex]) {
if (!mSmmInitialized[CpuIndex]) {
//
// Perform SmmInitHandler for CpuIndex
// Perform InitializeSmm for CpuIndex
//
SmmInitHandler ();
InitializeSmm ();
//
// Restore Cr2