From d020ac55b6968d3bcaf631307152b51738286583 Mon Sep 17 00:00:00 2001 From: Min Xu Date: Tue, 19 Apr 2022 08:26:23 +0800 Subject: [PATCH] OvmfPkg: Replace GUEST_TYPE with CC_GUEST_TYPE BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3902 Replace GUEST_TYPE with CC_GUEST_TYPE which is defined in MdePkg/Include/ConfidentialComputingGuestAttr.h. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Brijesh Singh Cc: Erdem Aktas Cc: Tom Lendacky Reviewed-by: Jiewen Yao Reviewed-by: Tom Lendacky Signed-off-by: Min Xu --- OvmfPkg/Include/WorkArea.h | 9 +-------- .../BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c | 2 +- .../BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c | 2 +- OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c | 2 +- OvmfPkg/Sec/AmdSev.c | 2 +- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/OvmfPkg/Include/WorkArea.h b/OvmfPkg/Include/WorkArea.h index b67edd14e7..bf56fc4a6f 100644 --- a/OvmfPkg/Include/WorkArea.h +++ b/OvmfPkg/Include/WorkArea.h @@ -10,14 +10,7 @@ #ifndef __OVMF_WORK_AREA_H__ #define __OVMF_WORK_AREA_H__ -// -// Guest type for the work area -// -typedef enum { - GUEST_TYPE_NON_ENCRYPTED, - GUEST_TYPE_AMD_SEV, - GUEST_TYPE_INTEL_TDX, -} GUEST_TYPE; +#include // // Confidential computing work area header definition. Any change diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c index 3f8f91a5da..41d1246a5b 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c @@ -36,7 +36,7 @@ GetSevEsWorkArea ( // // If its not SEV guest then SevEsWorkArea is not valid. // - if ((WorkArea == NULL) || (WorkArea->Header.GuestType != GUEST_TYPE_AMD_SEV)) { + if ((WorkArea == NULL) || (WorkArea->Header.GuestType != CcGuestTypeAmdSev)) { return NULL; } diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c index 80aceba01b..27148c7e33 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c @@ -36,7 +36,7 @@ GetSevEsWorkArea ( // // If its not SEV guest then SevEsWorkArea is not valid. // - if ((WorkArea == NULL) || (WorkArea->Header.GuestType != GUEST_TYPE_AMD_SEV)) { + if ((WorkArea == NULL) || (WorkArea->Header.GuestType != CcGuestTypeAmdSev)) { return NULL; } diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c index b8230613dc..7ab7027af1 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPei.c @@ -35,7 +35,7 @@ QemuFwCfgIsTdxGuest ( CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER *CcWorkAreaHeader; CcWorkAreaHeader = (CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER *)FixedPcdGet32 (PcdOvmfWorkAreaBase); - return (CcWorkAreaHeader != NULL && CcWorkAreaHeader->GuestType == GUEST_TYPE_INTEL_TDX); + return (CcWorkAreaHeader != NULL && CcWorkAreaHeader->GuestType == CcGuestTypeIntelTdx); } /** diff --git a/OvmfPkg/Sec/AmdSev.c b/OvmfPkg/Sec/AmdSev.c index d8fd35650d..6af38aaf46 100644 --- a/OvmfPkg/Sec/AmdSev.c +++ b/OvmfPkg/Sec/AmdSev.c @@ -251,7 +251,7 @@ IsSevGuest ( WorkArea = (OVMF_WORK_AREA *)FixedPcdGet32 (PcdOvmfWorkAreaBase); - return ((WorkArea != NULL) && (WorkArea->Header.GuestType == GUEST_TYPE_AMD_SEV)); + return ((WorkArea != NULL) && (WorkArea->Header.GuestType == CcGuestTypeAmdSev)); } /**