21STATIC UINT64 mCurrentAttr = 0;
23STATIC UINT64 mSevEncryptionMask = 0;
39 IN UINT64 CurrentAttr,
40 IN CONFIDENTIAL_COMPUTING_GUEST_ATTR Attr
45 CurrentLevel = CurrentAttr & CCAttrTypeMask;
52 return CurrentLevel >= CCAttrAmdSev;
57 return CurrentLevel >= CCAttrAmdSevEs;
59 return CurrentLevel == CCAttrAmdSevSnp;
60 case CCAttrFeatureAmdSevEsDebugVirtualization:
61 return !!(CurrentAttr & CCAttrFeatureAmdSevEsDebugVirtualization);
80 IN CONFIDENTIAL_COMPUTING_GUEST_ATTR Attr
90 if (!mCurrentAttrRead) {
91 mCurrentAttr =
PcdGet64 (PcdConfidentialComputingGuestAttr);
92 mCurrentAttrRead =
TRUE;
98 if (((
RShiftU64 (mCurrentAttr, 8)) & 0xff) == 1) {
102 return (mCurrentAttr == Attr);
161 if (!mSevEncryptionMaskSaved) {
162 mSevEncryptionMask =
PcdGet64 (PcdPteMemoryEncryptionAddressOrMask);
163 mSevEncryptionMaskSaved =
TRUE;
166 return mSevEncryptionMask;
UINT64 EFIAPI RShiftU64(IN UINT64 Operand, IN UINTN Count)
BOOLEAN EFIAPI MemEncryptSevEsDebugVirtualizationIsEnabled(VOID)
STATIC BOOLEAN EFIAPI ConfidentialComputingGuestHas(IN CONFIDENTIAL_COMPUTING_GUEST_ATTR Attr)
UINT64 EFIAPI MemEncryptSevGetEncryptionMask(VOID)
BOOLEAN EFIAPI MemEncryptSevSnpIsEnabled(VOID)
BOOLEAN EFIAPI MemEncryptSevIsEnabled(VOID)
STATIC BOOLEAN AmdMemEncryptionAttrCheck(IN UINT64 CurrentAttr, IN CONFIDENTIAL_COMPUTING_GUEST_ATTR Attr)
BOOLEAN EFIAPI MemEncryptSevEsIsEnabled(VOID)
#define PcdGet64(TokenName)