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.web09.17699.1646032885667369347 for ; Sun, 27 Feb 2022 23:21:59 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=HY6vhqJJ; 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=1646032919; x=1677568919; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=R44W8NKsmj0PZB0iu/c83kEAlQlY2Bvt3z/xz+umBlQ=; b=HY6vhqJJtoF/rVxvzXu0CvUJPHWrmokg6f/x8Crigdcm7vT9siX3us42 uQ+6qhxPcykD7cs+zjFithHVnpaQklAyG1Tiq/SXTx9G+Uq/myi5jWsLD pSSV6S2W5YXoTaAVnGkAanJRY1Z2LhC//x5+mjNvMoz5nkK8HHB+6TF97 aA7MudY2Nmy1voUC3Oi61HHwVuEIlsW9EdY6xgrcCdsApCVge8olBy2Yy xyGVoLMKdAGXp6cOGclw9DvvRSmtskj+WhTg4YpGxI4ndch23OpPf6Kna 5VjTC41Eqes/401lQIwvJr7sAh7AcXUIu4h/Yyw5S2009arYaBovxHN1k g==; X-IronPort-AV: E=McAfee;i="6200,9189,10271"; a="252552809" X-IronPort-AV: E=Sophos;i="5.90,142,1643702400"; d="scan'208";a="252552809" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2022 23:21:59 -0800 X-IronPort-AV: E=Sophos;i="5.90,142,1643702400"; d="scan'208";a="534340889" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.238.2.184]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2022 23:21:56 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Michael Roth , Ray Ni , Rahul Kumar , Eric Dong , James Bottomley , Jiewen Yao , Tom Lendacky , Jordan Justen , Ard Biesheuvel , Erdem Aktas , Gerd Hoffmann Subject: [PATCH V7 12/37] MdePkg: Add macro to check SEV / TDX guest Date: Mon, 28 Feb 2022 15:20:44 +0800 Message-Id: <7f4c7ea618a1bd74487625c7ecb420ea781c092d.1646031164.git.min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 Add macros CC_GUEST_IS_SEV / CC_GUEST_IS_TDX to check SEV / TDX guest. Cc: Michael Roth Cc: Ray Ni Cc: Rahul Kumar Cc: Eric Dong Cc: James Bottomley Cc: Min Xu Cc: Jiewen Yao Cc: Tom Lendacky Cc: Jordan Justen Cc: Ard Biesheuvel Cc: Erdem Aktas Cc: Gerd Hoffmann Acked-by: Gerd Hoffmann Signed-off-by: Min Xu --- MdePkg/Include/ConfidentialComputingGuestAttr.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MdePkg/Include/ConfidentialComputingGuestAttr.h b/MdePkg/Include/ConfidentialComputingGuestAttr.h index 6a1301801519..dd2541c6dcdf 100644 --- a/MdePkg/Include/ConfidentialComputingGuestAttr.h +++ b/MdePkg/Include/ConfidentialComputingGuestAttr.h @@ -22,4 +22,7 @@ typedef enum { CCAttrIntelTdx = 0x200, } CONFIDENTIAL_COMPUTING_GUEST_ATTR; +#define CC_GUEST_IS_TDX(x) ((x) == CCAttrIntelTdx) +#define CC_GUEST_IS_SEV(x) ((x) == CCAttrAmdSev || (x) == CCAttrAmdSevEs || (x) == CCAttrAmdSevSnp) + #endif -- 2.29.2.windows.2