From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web08.919.1647050070631942533 for ; Fri, 11 Mar 2022 17:55:06 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=d+pZkHiO; spf=pass (domain: intel.com, ip: 192.55.52.115, 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=1647050106; x=1678586106; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=V1Bl4SS7xwmqhD/DE1ajjqFAd2xXh3QFlcX36/xi0h0=; b=d+pZkHiOvsrjP+cMA/1vCtTnHBhrfQquNMsRGMLA4UtDX+KetolkvNxL 3wlSyCMe34JDC+sqznTGgj6FYf2ES5kUBxZxIWszQsh+YeQ1/3NWw/KND nAxKeoJZ/Wt1prjfb0Ngdgv5pdflobiIg3TohLP/x6+M8D1IxkeZ5f6QG dHTQl1AmXQohIpTZmuVPW0hjmJp3nVOVgt6Ix9TjWTRNbIPbeu4wDXx8d 3HFxFnoyapjD+Dvvdu4MHT1zgDZ69HdTLY3PwTLIgC+h4/oeWA1gR+Vq2 yok5tX3PPm41UWeoXVurkLzq9NOZT1qI1SrDCZrOGXrZvxr0WD+mdMSyS g==; X-IronPort-AV: E=McAfee;i="6200,9189,10283"; a="255894335" X-IronPort-AV: E=Sophos;i="5.90,175,1643702400"; d="scan'208";a="255894335" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2022 17:55:05 -0800 X-IronPort-AV: E=Sophos;i="5.90,175,1643702400"; d="scan'208";a="555564529" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.254]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2022 17:55:02 -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 , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [PATCH V8 12/47] MdePkg: Add macro to check SEV / TDX guest Date: Sat, 12 Mar 2022 09:53:37 +0800 Message-Id: <5aea5e3a2f2425e7d952856434f47035f03cff79.1647047482.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 Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu 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