This writes the feature bit into PcdConfidentialComputingGuestAttr and enables DebugSwap for the DXE stage too.
Cc: Ard Biesheuvel <[email protected]> Cc: Erdem Aktas <[email protected]> Cc: Gerd Hoffmann <[email protected]> Cc: Jiewen Yao <[email protected]> Cc: Michael Roth <[email protected]> Cc: Min Xu <[email protected]> Cc: Tom Lendacky <[email protected]> Signed-off-by: Alexey Kardashevskiy <[email protected]> --- OvmfPkg/PlatformPei/AmdSev.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c index e6724cf493a7..785872537728 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -434,6 +434,7 @@ AmdSevInitialize ( ) { UINT64 EncryptionMask; + UINT64 CCGuestAttr; RETURN_STATUS PcdStatus; // @@ -517,13 +518,19 @@ AmdSevInitialize ( // technology is active. // if (MemEncryptSevSnpIsEnabled ()) { - PcdStatus = PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrAmdSevSnp); + CCGuestAttr = CCAttrAmdSevSnp; } else if (MemEncryptSevEsIsEnabled ()) { - PcdStatus = PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrAmdSevEs); + CCGuestAttr = CCAttrAmdSevEs; } else { - PcdStatus = PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrAmdSev); + CCGuestAttr = CCAttrAmdSev; } + if (MemEncryptSevEsDebugSwapIsEnabled ()) { + CCGuestAttr |= CCAttrFeatureAmdSevDebugSwap; + } + + PcdStatus = PcdSet64S (PcdConfidentialComputingGuestAttr, CCGuestAttr); + ASSERT_RETURN_ERROR (PcdStatus); } -- 2.44.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118518): https://edk2.groups.io/g/devel/message/118518 Mute This Topic: https://groups.io/mt/105863832/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
