audk/OvmfPkg/Library/BaseMemEncryptSevLib
Dun Tan a78938f274 OvmfPkg:Remove code that apply AddressEncMask to non-leaf entry
Remove code that sets AddressEncMask for non-leaf entries when
modifing smm page table by MemEncryptSevLib. In FvbServicesSmm
driver, it calls MemEncryptSevClearMmioPageEncMask to clear
AddressEncMask bit in page table for a specific range. In AMD
SEV feature, this AddressEncMask bit in page table is used to
indicate if the memory is guest private memory or shared memory.
But all memory accessed by the hardware page table walker is
treated as encrypted, regardless of whether the encryption bit
is present. So remove the code to set the EncMask bit for smm
non-leaf entries doesn't impact AMD SEV feature.

The reason encryption mask should not be set for non-leaf
entries is because CpuPageTableLib doesn't consume encryption
mask PCD. In PiSmmCpuDxeSmm module, it will use CpuPageTableLib
to modify smm page table in next patch. The encryption mask is
overlapped with the PageTableBaseAddress field of non-leaf page
table entries. If the encryption mask is set for smm non-leaf
page table entries, issue happens when CpuPageTableLib code
use the non-leaf entry PageTableBaseAddress field with the
encryption mask set to find the next level page table.

Signed-off-by: Dun Tan <dun.tan@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2023-06-30 11:07:40 +05:30
..
Ia32 OvmfPkg/MemEncryptSevLib: add support to validate system RAM 2021-12-09 06:28:10 +00:00
X64 OvmfPkg:Remove code that apply AddressEncMask to non-leaf entry 2023-06-30 11:07:40 +05:30
DxeMemEncryptSevLib.inf OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib 2022-11-14 04:55:34 +00:00
DxeMemEncryptSevLibInternal.c OvmfPkg/BaseMemEncryptLib: use the SEV_STATUS MSR value from workarea 2022-02-28 02:46:08 +00:00
PeiDxeMemEncryptSevLibInternal.c OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PeiMemEncryptSevLib.inf OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib 2022-11-14 04:55:34 +00:00
PeiMemEncryptSevLibInternal.c OvmfPkg: Replace GUEST_TYPE with CC_GUEST_TYPE 2022-04-19 01:26:08 +00:00
SecMemEncryptSevLib.inf OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib 2022-11-14 04:55:34 +00:00
SecMemEncryptSevLibInternal.c OvmfPkg: Replace GUEST_TYPE with CC_GUEST_TYPE 2022-04-19 01:26:08 +00:00