From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web08.1927.1649981244283090489 for ; Thu, 14 Apr 2022 17:07:29 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=EX/FnBtt; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649981249; x=1681517249; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rgTCWM8KOO6YKOQxQJEvMOOiO5i18cDRsbFzNkGa1yk=; b=EX/FnBtt86nRd0WslNO1kk3GnatY5/rpH2rX0QemP56FToRSll1/pvKT ESNO5mwVqpkGFBTdbcuCNwer7LKiekBVHi3wzSFkvsF2yBId9jEwS9F0W LHQZN98+ulflpA1xG5vqFmkayG4mNLSVFMP5xxFPdjcIjJEUYO4SLu2V9 CC54LBLPnGWKK2kkKvNcIFtnlOdnoRkPQHG6mWqEnhceAVNhzjZTQ7uHp rJkpFQkELahHJQVopcmMYY3e9jHjXaHypXUaril0d8USevoKDoTAI0Vnp dSLzMuLLX6IuFTwVdkpiTFSupg5kVrZFPbtKLSwhY5ZfXjIXMmJwzKgFj w==; X-IronPort-AV: E=McAfee;i="6400,9594,10317"; a="262504553" X-IronPort-AV: E=Sophos;i="5.90,261,1643702400"; d="scan'208";a="262504553" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 17:07:29 -0700 X-IronPort-AV: E=Sophos;i="5.90,261,1643702400"; d="scan'208";a="552923277" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.168.38]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 17:07:26 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Michael D Kinney , Liming Gao , Zhiguang Liu , James Bottomley , Jiewen Yao , Gerd Hoffmann , Brijesh Singh , Erdem Aktas , Tom Lendacky Subject: [PATCH V2 2/6] OvmfPkg: Replace GUEST_TYPE with CC_GUEST_TYPE Date: Fri, 15 Apr 2022 08:07:05 +0800 Message-Id: X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 b67edd14e79f..bf56fc4a6f65 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 3f8f91a5da12..fb9d3cbd3645 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 80aceba01bcf..238e29e2a175 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 b8230613dcea..1b8133bf5ad6 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 d8fd35650d7d..0da6b36020fc 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)); } /** -- 2.29.2.windows.2