audk/OvmfPkg/Library/VmgExitLib
Michael Roth d2b998fbdc OvmfPkg/VmgExitLib: use SEV-SNP-validated CPUID values
SEV-SNP firmware allows a special guest page to be populated with
guest CPUID values so that they can be validated against supported
host features before being loaded into encrypted guest memory to be
used instead of hypervisor-provided values [1].

Add handling for this in the CPUID #VC handler and use it whenever
SEV-SNP is enabled. To do so, existing CPUID handling via VmgExit is
moved to a helper, GetCpuidHyp(), and a new helper that uses the CPUID
page to do the lookup, GetCpuidFw(), is used instead when SNP is
enabled. For cases where SNP CPUID lookups still rely on fetching
specific CPUID fields from hypervisor, GetCpuidHyp() is used there as
well.

[1]: SEV SNP Firmware ABI Specification, Rev. 0.8, 8.13.2.6

Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
2021-12-09 06:28:10 +00:00
..
PeiDxeVmgExitVcHandler.c OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SecVmgExitLib.inf OvmfPkg/VmgExitLib: use SEV-SNP-validated CPUID values 2021-12-09 06:28:10 +00:00
SecVmgExitVcHandler.c OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
VmgExitLib.c OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
VmgExitLib.inf OvmfPkg/VmgExitLib: use SEV-SNP-validated CPUID values 2021-12-09 06:28:10 +00:00
VmgExitVcHandler.c OvmfPkg/VmgExitLib: use SEV-SNP-validated CPUID values 2021-12-09 06:28:10 +00:00
VmgExitVcHandler.h OvmfPkg/VmgExitLib: Support nested #VCs 2021-01-07 19:34:39 +00:00