From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web08.9091.1645271832752102625 for ; Sat, 19 Feb 2022 03:57:47 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=dnSj5V3x; spf=pass (domain: intel.com, ip: 192.55.52.151, 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=1645271867; x=1676807867; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=R44W8NKsmj0PZB0iu/c83kEAlQlY2Bvt3z/xz+umBlQ=; b=dnSj5V3xvLobELcX1WHBf2ARvshroGVg5SzcEl+2dgFfqf6/UIKJsGk1 bxHIRjvNEQGpJAyuQf/mhUhNPBZ8EfHYXsO7MK3uoAFqlXlKWOXLZdkXN b7sv4qPvSkmpL3X98bgjGmPjdJ38mo5nCtcHIffjtf9JVr0fxbQSPplFx M4rJrk9dATQN3tbo+j3O5xfb6Oj2QeT3nADNcP5WzFbbdXe8wUV/io0Re UE5wl6swfA3iFX/Z5+QYUqPj/yG2O4r4ROvMT3XEJmMyYc+4RtRF8eY+A Eqj93aToPMHoP8bd/W62zDo/v3TZcZ78NDsj8eNAJ++TrSt0M6fgGpv6y w==; X-IronPort-AV: E=McAfee;i="6200,9189,10262"; a="231915304" X-IronPort-AV: E=Sophos;i="5.88,381,1635231600"; d="scan'208";a="231915304" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2022 03:57:47 -0800 X-IronPort-AV: E=Sophos;i="5.88,381,1635231600"; d="scan'208";a="546691070" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.175.253]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2022 03:57:44 -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 V6 12/42] MdePkg: Add macro to check SEV / TDX guest Date: Sat, 19 Feb 2022 19:56:25 +0800 Message-Id: <04d9697da0fb36a71302e953c1ab0713a795a4ca.1645261990.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