audk/OvmfPkg/Library
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
..
AcpiPlatformLib OvmfPkg: move QemuFwCfgAcpi into AcpiPlatformLib 2023-06-23 17:26:37 +00:00
AcpiTimerLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
BaseCachingPciExpressLib OvmfPkg/BaseCachingPciExpressLib: Migrate BaseCachingPciExpressLib 2022-01-29 17:36:59 +00:00
BaseMemEncryptSevLib OvmfPkg:Remove code that apply AddressEncMask to non-leaf entry 2023-06-30 11:07:40 +05:30
BaseMemEncryptTdxLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
BasePciCapLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
BasePciCapPciSegmentLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BhyveFwCtlLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BlobVerifierLibNull OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CcExitLib OvmfPkg/CcExitLib: Use documented XSave area base size for SEV-SNP 2023-04-26 13:39:01 +00:00
CcProbeLib OvmfPkg: Update CcProbeLib to DxeCcProbeLib 2022-09-06 06:03:45 +00:00
DxePciLibI440FxQ35 OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
EmuVariableFvbLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
GenericQemuLoadImageLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
HardwareInfoLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
LoadLinuxLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
LockBoxLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
MpInitLibDepLib OvmfPkg: Add MpInitLibDepLib 2022-05-11 08:40:53 +00:00
NestedInterruptTplLib OvmfPkg: Relax assertion that interrupts do not occur at TPL_HIGH_LEVEL 2023-05-09 22:09:50 +00:00
NvVarsFileLib OvmfPkg/NvVarsFileLib: disable in case PcdBootRestrictToFirmware is set 2023-05-10 13:39:41 +00:00
PciHostBridgeLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciHostBridgeLibScan OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciHostBridgeUtilityLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
PeilessStartupLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
PlatformBmPrintScLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
PlatformBootManagerLib OvmfPkg/PlatformBootManagerLib: add PcdBootRestrictToFirmware 2023-05-10 13:39:41 +00:00
PlatformBootManagerLibBhyve OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
PlatformDebugLibIoPort OvmfPkg/DebugLibIoPort: use Rom version for PEI 2022-12-14 17:45:41 +00:00
PlatformFvbLibNull OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PlatformHasIoMmuLib OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
PlatformInitLib OvmfPkg/PlatformInitLib: limit phys-bits to 46. 2023-06-01 09:00:00 +00:00
PlatformSecureLib OvmfPkg: strip trailing whitespace 2019-10-04 11:18:32 +01:00
PxeBcPcdProducerLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
QemuBootOrderLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
QemuFwCfgLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
QemuFwCfgS3Lib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
QemuFwCfgSimpleParserLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ResetSystemLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
SerializeVariablesLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
SmbiosVersionLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
SmmCpuFeaturesLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
SmmCpuPlatformHookLibQemu OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Tcg2PhysicalPresenceLibNull OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Tcg2PhysicalPresenceLibQemu OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
TdxMailboxLib OvmfPkg: Remove UefiCpuLib from module INFs. 2023-03-10 08:23:56 +00:00
TlsAuthConfigLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
UefiDriverEntryPointFwCfgOverrideLib OvmfPkg: Introduce alternate UefiDriverEntrypoint to inhibit driver load 2022-09-10 08:23:27 +00:00
UefiPciCapPciIoLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
VirtioLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
VirtioMmioDeviceLib OvmfPkg/VirtioMmioDeviceLib: virtio 1.0: Fix SetQueueAlignment. 2023-04-12 12:41:17 +00:00
X86QemuLoadImageLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
XenConsoleSerialPortLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
XenHypercallLib OvmfPkg/XenHypercallLib: Fix naming of AArch64 2022-07-28 01:22:13 +00:00
XenIoMmioLib OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
XenPlatformLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
XenRealTimeClockLib OvmfPkg: Remove duplicated words 2022-09-05 13:52:51 +00:00