From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (NAM04-DM6-obe.outbound.protection.outlook.com [40.107.102.66]) by mx.groups.io with SMTP id smtpd.web12.120.1634144279536449003 for ; Wed, 13 Oct 2021 09:57:59 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=wFYmdA8z; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.102.66, mailfrom: brijesh.singh@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CSW/xihWwiZIhA+CWGH+5UnaTuDeUYHw3x+vdJkl/d0PSYLdJT5hBAWl3wbzetqMCDY89Nkbnev8L8fmaOehmMGRN2I0hB9Q/GM81KRUtXP0e9CWCIdkmM7yh/BPy7IwuvQOCUXf4xbPRa18Thhth+w9r/zCgs1s97GUebd+INxVTOU3RqVhRVzZoLZJNWjsdl7S+CM47l2S7dFOuaTPwaCEHaeckJEGtX3Fu/TqwSlP9fdTBDv8l6qqKN/54HwQB77+EkRVH/ZaGkTTj0+SRvk+U3L4ultjrHtY9ETpo3c2p6byLC0N0CZTFdbiyrmwk/tld3uI8XQi2ZwB4qP59w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uaB8yNVdEURv+odmUtP8yoqvcpQEvjjyIo1HTDmu2Xw=; b=QaF53vCZS0WC8THGI08Z3q2bCVJilz/5q4OvGo9fihKQBnLlPyte9V8gUBWDy/R3ga83sUGmxAioiUZql1JkKw5lrs5bCw+05I1Gxlw4acwaYnIIEvRKWR0OR4GB4yvGZlHkchYVU3dw+Edzq3jboLDMg0PSGnwPlMtsBHxz35xS7XeLX+GqJbxbeinKngd/0LPqzlf/66vlYt7VYgFY6TCQQZCwNU69P14TlXosf45higFJT6Tow8BweNP7RPEjm5nzGc5AG/SVtzNYw2OQ0LAxCcAzAwFGJMkD3PfcjTQy4LDn+w3uIBd4aGqXEQ/iXTFhVVG15cV+lv0Ga/vSvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uaB8yNVdEURv+odmUtP8yoqvcpQEvjjyIo1HTDmu2Xw=; b=wFYmdA8zsYi4hajJk8J5MC7023kch9Vf21RRI80TYnBPqPzzdwtZHfD3L0aoPhVufCbfjtATthl1EzGz+tselrGoHnIavi/nWe4vtCeJblpeIRcMnNQy/rLx7s4RNx5eWAgghdGRPsWaEP8L9k+VUUgcMJSK2vyBP7wl9iup9pM= Received: from MW4PR04CA0046.namprd04.prod.outlook.com (2603:10b6:303:6a::21) by DM6PR12MB3195.namprd12.prod.outlook.com (2603:10b6:5:183::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Wed, 13 Oct 2021 16:57:57 +0000 Received: from CO1NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:303:6a:cafe::1f) by MW4PR04CA0046.outlook.office365.com (2603:10b6:303:6a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Wed, 13 Oct 2021 16:57:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT039.mail.protection.outlook.com (10.13.174.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4608.15 via Frontend Transport; Wed, 13 Oct 2021 16:57:56 +0000 Received: from sbrijesh-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 13 Oct 2021 11:57:51 -0500 From: "Brijesh Singh" To: CC: James Bottomley , Min Xu , "Jiewen Yao" , Tom Lendacky , "Jordan Justen" , Ard Biesheuvel , Erdem Aktas , "Michael Roth" , Gerd Hoffmann , Brijesh Singh , Michael Roth , Ray Ni , Rahul Kumar , Eric Dong Subject: [PATCH v9 20/32] UefiCpuPkg: Define ConfidentialComputingGuestAttr Date: Wed, 13 Oct 2021 11:57:01 -0500 Message-ID: <20211013165713.727815-21-brijesh.singh@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211013165713.727815-1-brijesh.singh@amd.com> References: <20211013165713.727815-1-brijesh.singh@amd.com> MIME-Version: 1.0 Return-Path: brijesh.singh@amd.com X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d16544a0-ec47-4e17-019f-08d98e6a9b14 X-MS-TrafficTypeDiagnostic: DM6PR12MB3195: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: STKtxGhTArg1Z/x9HQLBc2apGpab3ah/h8ndRGdxWAhxgfCZr3gzna7PgDKZ39rd3hbf+ky22XK2HyMTK9pfvV5DUnkTaf0S4VwenbClfWGX3hv3gNE1LBwtlQ2VvHLPfq8kB6NE7Cx4mNYehh7pz4ko0FhAE+GEy6rKTHnmHtDqxl7DODGWCxd2ypUF7ar6ioooElNEoPNNTSCI2kpdmSktPtUp5Bx2H8bo+wH/9tGJYU/s8QqIGVh1ZBtVr1rj5v63ylF0Q9R97ShePFf5oAxMTWEzqXPTIB7MySicJNkeh5piG6Zgb+nusdI+bFCIaU75hzV5PsudqqjCoBReoSbPgqunsBjF6Vx78pzIMTHl6w4kSWdQ4kQfNM1LtSm6JbUIhCZ4up5IHw7TOOT0eqQn/y/EpP9lKNEpRoegW8n6ABOiF1YqFKFq6MAv3JhOKkYcHyMNqZVLunstzfjY9qrTEARtkfkmfXgzyalcyo3WhLUvziZyG0zgy09wKG/kereVyQEc14zDe5UqAwZC+g5Fl+eqTXaiPMKGqw9+dK63dbwJRumNV9/mBy3FluasvF43SPnIDzfNdMTLfsmeh7AeVOMRjroiwk9B0CuhrmRlMM/+tazFIyw5ok/LfAp0AwPUF7RbeIO2ihDbSESD61S4wTYuGr2JokiibePMhXJLTzzBtArqwTSG0nkHIbNuN5x8SLGppmd+xBXLT6+tnQpDtWZMp/ZE4vYZpxj18phOrjX9JS6NBxAWOATR3bmy/4V7EKt1EbXnZhgkUqScHXwWJu6agV0+LxclqyCtEo/xMPt9TkoFVo/9G98kpbIV X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(316002)(36860700001)(81166007)(2616005)(26005)(70586007)(2906002)(54906003)(186003)(16526019)(8936002)(356005)(6916009)(7416002)(8676002)(426003)(966005)(336012)(86362001)(4326008)(5660300002)(70206006)(6666004)(1076003)(508600001)(7696005)(44832011)(36756003)(83380400001)(47076005)(82310400003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 16:57:56.7583 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d16544a0-ec47-4e17-019f-08d98e6a9b14 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3195 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3275 While initializing APs, the MpInitLib may need to know whether the guest is running with active AMD SEV or Intel TDX memory encryption. Add a new ConfidentialComputingGuestAttr PCD that can be used to query the memory encryption attribute. 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 Suggested-by: Jiewen Yao Signed-off-by: Brijesh Singh --- UefiCpuPkg/UefiCpuPkg.dec | 4 +++ .../Include/ConfidentialComputingGuestAttr.h | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 UefiCpuPkg/Include/ConfidentialComputingGuestAttr.h diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec index 62acb291f309..9dbaa407c399 100644 --- a/UefiCpuPkg/UefiCpuPkg.dec +++ b/UefiCpuPkg/UefiCpuPkg.dec @@ -396,5 +396,9 @@ [PcdsDynamic, PcdsDynamicEx] # @Prompt SEV-ES Status gUefiCpuPkgTokenSpaceGuid.PcdSevEsIsEnabled|FALSE|BOOLEAN|0x60000016 =20 + ## This dynamic PCD indicates the memory encryption attribute of the gue= st. + # @Prompt Memory encryption attribute + gUefiCpuPkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0|UINT64|0x6= 0000017 + [UserExtensions.TianoCore."ExtraFiles"] UefiCpuPkgExtra.uni diff --git a/UefiCpuPkg/Include/ConfidentialComputingGuestAttr.h b/UefiCpuP= kg/Include/ConfidentialComputingGuestAttr.h new file mode 100644 index 000000000000..495b0df0ac33 --- /dev/null +++ b/UefiCpuPkg/Include/ConfidentialComputingGuestAttr.h @@ -0,0 +1,25 @@ +/** @file +Definitions for Confidential Computing Attribute + +Copyright (c) 2021 AMD Inc. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef CONFIDENTIAL_COMPUTING_GUEST_ATTR_H_ +#define CONFIDENTIAL_COMPUTING_GUEST_ATTR_H_ + +typedef enum { + /* The guest is running with memory encryption disabled. */ + CCAttrNotEncrypted =3D 0, + + /* The guest is running with AMD SEV memory encryption enabled. */ + CCAttrAmdSev =3D 0x100, + CCAttrAmdSevEs =3D 0x101, + CCAttrAmdSevSnp =3D 0x102, + + /* The guest is running with Intel TDX memory encryption enabled. */ + CCAttrIntelTdx =3D 0x200, +} CONFIDENTIAL_COMPUTING_GUEST_ATTR; + +#endif --=20 2.25.1