OvmfPkg/MemEncryptSevLib: add MemEncryptSevSnpEnabled()
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275 Create a function that can be used to determine if VM is running as an SEV-SNP guest. Cc: Michael Roth <michael.roth@amd.com> 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: Brijesh Singh <brijesh.singh@amd.com>
This commit is contained in:
committed by
mergify[bot]
parent
34819f2cac
commit
d9822304ce
@@ -62,6 +62,25 @@ InternalMemEncryptSevStatus (
|
||||
return ReadSevMsr ? AsmReadMsr32 (MSR_SEV_STATUS) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a boolean to indicate whether SEV-SNP is enabled.
|
||||
|
||||
@retval TRUE SEV-SNP is enabled
|
||||
@retval FALSE SEV-SNP is not enabled
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
MemEncryptSevSnpIsEnabled (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
MSR_SEV_STATUS_REGISTER Msr;
|
||||
|
||||
Msr.Uint32 = InternalMemEncryptSevStatus ();
|
||||
|
||||
return Msr.Bits.SevSnpBit ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a boolean to indicate whether SEV-ES is enabled.
|
||||
|
||||
|
Reference in New Issue
Block a user