audk/OvmfPkg/AmdSev
Jiaxin Wu 3dfd64305b OvmfPkg/SmmRelocationLib: Add library instance for OVMF
There are below 2 differences between AMD & OVMF according
existing implementation:
1.The mode of the CPU check is different between the AMD & OVMF.
OVMF:
CpuSaveState->x86.SMMRevId & 0Xffff

AMD:
 LMAValue = (UINT32)AsmReadMsr64 (EFER_ADDRESS) & LMA

2.Existing SmBase configuration is different between the
AMD & OVMF.
OVMF:
 if ((CpuSaveState->x86.SMMRevId & 0xFFFF) == 0) {
   CpuSaveState->x86.SMBASE = mSmBaseForAllCpus[CpuIndex];
 } else {
   CpuSaveState->x64.SMBASE = mSmBaseForAllCpus[CpuIndex];
 }

AMD:
 AmdCpuState->x64.SMBASE = mSmBaseForAllCpus[CpuIndex];

This patch provides the SmmRelocationLib library instance
for OVMF to handle the logic difference, and it won't change
the existing implementation code logic.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zeng Star <star.zeng@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
2024-05-08 01:53:58 +00:00
..
BlobVerifierLibSevHashes OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
Grub OvmfPkg/AmdSev: add Grub Firmware Volume Package 2020-12-14 19:56:18 +00:00
SecretDxe OvmfPkg/AmdSev/SecretDxe: Allocate secret location as EfiACPIReclaimMemory 2022-12-15 13:49:49 +00:00
SecretPei OvmfPkg/AmdSev/SecretPei: Mark SEV launch secret area as reserved 2022-01-04 08:06:53 +00:00
AmdSevX64.dsc OvmfPkg/SmmRelocationLib: Add library instance for OVMF 2024-05-08 01:53:58 +00:00
AmdSevX64.fdf OvmfPkg: Don't make APIC MMIO accesses with encryption bit set 2024-05-02 12:43:50 +00:00