From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.85]) by mx.groups.io with SMTP id smtpd.web11.1342.1632163596175568212 for ; Mon, 20 Sep 2021 11:46:37 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=eQpdHe5f; 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.92.85, mailfrom: brijesh.singh@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VEyPtn6ASdPceEU0qwYnE19LtA7XsJC52/P3m9x+aIJI+IttXy+yr3oyvUci/fS3x/QkElWekay3FowGUGsPQJPjYwh8yJRPiANnzFshx3rGh1HaCrO8rC48WuNrvLb+x9JHeUNFUJxLc8zdv+leGOMT96OL6kz9dlSSVKECj0aL33FnJmwnR1mkSvYhV8R6cTFXVdgz0wgwCkOa1mO4P+GbPU2leZcURg6/VKc6uh/S4+cxdPDTbuG6jkYNrtStMmiaWOOS2oa8zl6G3fXYxi5mcS+iJcUveSz9jsD+GmoMEcPc0QhGkCiG1g66UUbum5t1VpkHnrkVy1cfqVAlAA== 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; bh=uaB8yNVdEURv+odmUtP8yoqvcpQEvjjyIo1HTDmu2Xw=; b=c0ZTu4pnDxcvPDrFOx7RSoy7N0imi2i1vBLqCloLaJCg0IGQDLP/5zhWIjB38ZYd4RhhAeptW9oW/IEprciDvjGH3vqU2kwJl3KBgcFxKsw6RoIbA5kBCxUEKQkLfKucG/8dXkgiGMc+ymINJAPRzZUlB+V6vlDoCNlUeD+o/72fbjlKGT439xP3QP/MdW1uURHid+OcWafAY5tFdck8FWG7A9tjWsLpElwD1qdWSLvoDK07Erlmri1MnJ6X9alXUNwNKszODbHY16IKSU1SrpeDiCPNm922D640qKafHaA7h/ucmjpsfBCmlb8KF9wRlqlqkJLQYRQrRXSXAw/sMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=eQpdHe5fb/UBCeas8afzPoAXssYD66FXFLTulIuHH0t0X5lWh5UPUMTElaA/JL+0NfvRJQUtkUVOlTjvJ3+l8cVhc4f2lNHi9YGyMC4e6CBBnjwK2XYRlKMmQDFeACl3W+YyRaTWtodS+/7HMnfmiesS9FLFMmQeBT5pklimArs= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) by SA0PR12MB4575.namprd12.prod.outlook.com (2603:10b6:806:73::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Mon, 20 Sep 2021 18:46:35 +0000 Received: from SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::78b7:7336:d363:9be3]) by SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::78b7:7336:d363:9be3%6]) with mapi id 15.20.4523.018; Mon, 20 Sep 2021 18:46:35 +0000 From: "Brijesh Singh" To: devel@edk2.groups.io 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 v8 20/32] UefiCpuPkg: Define ConfidentialComputingGuestAttr Date: Mon, 20 Sep 2021 13:45:52 -0500 Message-ID: <20210920184604.31590-21-brijesh.singh@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210920184604.31590-1-brijesh.singh@amd.com> References: <20210920184604.31590-1-brijesh.singh@amd.com> X-ClientProxiedBy: SN4PR0201CA0034.namprd02.prod.outlook.com (2603:10b6:803:2e::20) To SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) Return-Path: brijesh.singh@amd.com MIME-Version: 1.0 Received: from sbrijesh-desktop.amd.com (165.204.77.1) by SN4PR0201CA0034.namprd02.prod.outlook.com (2603:10b6:803:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Mon, 20 Sep 2021 18:46:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6a3d532c-325e-4504-48e3-08d97c66f8cf X-MS-TrafficTypeDiagnostic: SA0PR12MB4575: X-MS-Exchange-Transport-Forked: True 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: 9MOO5iNo9EgsUTEzf5oMbxa13+RaBWDmy9snSlHsiF8Y1zmYoyx5REuyIdt0drawn0lN32K7uIyj8uuzIEImxNk4kdRwFGlPFJXmmLerLJ0Vxdio3q6bOqTYwlmJpIFsKHX/UWSzGsrnmbrYFL8iN72SvZOzzsphe0IOyj8pqfY3yTQYcdjOmAS1ti2K+iXGSQIAYcxcTDIZweiR8m7pi7Aav66xIAVnBrXMt0FwiOY7btgz71lRWBH8dhsaUY3IhKGbmiOKcqwNzaYhXCO3imrCFFaFL2Bu3auk0JhcyULT3LUqsjCmXijlMATRDSuDpjChje8lVfnAz8ZTEu4LVpPzit1ra3weHAz/B6TO5EKtTdQY2XLbU3fn+6rOYZNFV6r84Sx4wz8yFygEtPWYbC/Fn7f2Xrh62Kn08ukTmcPbWDZmy8JtljCmKjNG5d4+/NAKvEU99zpMcTHLAoE+U38symCnOXwdIUn6O49Bt6xtyFQiUDe98RfRE72HgaLt+22otzDUn3Yhi6/bL8NPV70GWpLXvqMkjCSlWKgpFpwy4aaeKN/jr3V6YVWq/WTVx4geOGYUDkOD/TmkyuC/WjZlMT4iqxykX3uLnP6SseqqpFQOE7A7VZYnHy3x4w8kW2HlhkmPQ8niaRgFfCrqwOHkhLeHkN4kf4REalorZuXpe1GoBerdorgqdQyoJaLWzvbUn1GfGgVvnd2O0CzDWWJNWE6AzYPASxy6FUYAWXvcLZYaQMW42tb6GBkToxCB8ny/xHpesFGTJ1xRUGbUWg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2718.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(38350700002)(44832011)(5660300002)(36756003)(83380400001)(38100700002)(8936002)(66946007)(508600001)(6916009)(7696005)(52116002)(1076003)(6666004)(956004)(8676002)(186003)(54906003)(2616005)(7416002)(2906002)(6486002)(26005)(316002)(66556008)(66476007)(966005)(86362001)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?1n3Cw/15XasdORSaVyaxg7P+LxxlwFRkGqJ9651Hn6XrqyJIlYiuYG6OgklH?= =?us-ascii?Q?wU8descQ6pULldXu50plkpsm9UGAi9vaYue6Gab1jyQ2ClhAviumYDHa7Y+6?= =?us-ascii?Q?z8C2InCuj2FXKG99jPnms/Oj06ZeRwwkq5CMM/+7eUaBKxR23XBpQOkMaOj7?= =?us-ascii?Q?v1k95yEz5WUIm3z19K0acD7A7Y8XJnkaeFOoY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a6dIyvzMcNboYg5zVdPOsEBMvVvbvQRFxFCIL9iDOemq?= =?us-ascii?Q?THvLy1AdChR5qXJEKTxZw3K2LKSmCq1grMrnlv+O8BzGipr5U2XnxEs0s1aq?= =?us-ascii?Q?jWgIUs3J0xxmv3d/HM7k0giqTqsQXUxWZimbe26FM2KT9UhIwdISNoj/VvdI?= =?us-ascii?Q?omVMEEwG0Z6O32pogGgSgTdu8Aq+7ny4IApimlTkNgVUid7B/55GynlgT3mj?= =?us-ascii?Q?myVhBWln9Qy6aQECFbHggdPs?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a3d532c-325e-4504-48e3-08d97c66f8cf X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2718.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2021 18:46:35.5146 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NnoQlDZDUGYLZdtxFpJ8ejXaOyiAqlVY27RmmdD9+FOwpOi+FPqS9o0Uh5H2tcf+TulIp7xvHAsuSApPa5U9Ig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4575 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