From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.77]) by mx.groups.io with SMTP id smtpd.web09.430.1636738836441970540 for ; Fri, 12 Nov 2021 09:40:36 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=l3xAshu5; 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.93.77, mailfrom: brijesh.singh@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OkpFPl9NrRL9Wlxixa+I28E6DE6kEoDDCXrevW2W1BOhF7jSAkYoL9YSq7JNcYGmWQHP4UAjEVelBKVD2me4Zael47Wn9heVTbYT9QVEB0YaYC3gq1dftHEtAp4/3XEG5ugdg6nKn8yDKWO0S0QyrFPvmwVDuLdkoQ/fG+u3XQjTG2JW1Um+XUMWiNoyfOUd/8egSRFQm9sFCDx2wMPe/EHhML1RD+NHvogdIOJkmk+UUCWbmxmuK5CuDpPVOYX+yj5y5coA6TF0bHvhR/Ma49lrYAijcWs0ex9VlNjCbGF1OSbqhSTdF2p0kRC6RhieAvtCoiSB9miPuJj+Vts0ow== 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=8mdrVCEDwmXtEN/kKbQUtwbBKJxvRJ6bEnOFZLUCAtE=; b=RqOlEPe2niFwnn1zj3jKR3W3sw6t6vYqX5gawTMaVAlM6fN4o1mSZ4uhSGaywHT5/MBnr/B9TyomiyVd7YskP5bw5ySQUzXn1vcobr7DQRU5EhbIyRvJ1aUZXtf+K0BQ1m+fQXTSPq8lhJpmVSxFQIkpsG8FnPrf4TW1k+BI81hunj+NmmTMs0Gaz9+dqtbLnWSgUhJTlvi8jXTp9V6tCj3m4yy3rYUtg6xQCPjfP+ySqe2134wUzur3XPjYtzOe1FZ9fmibQVIoc6mLHfhLuAnVw9Q4wh1QZOTy1FNJphrAT5unh4ZkXz8RqIQ7RN9AKrz1Oso/9Da7vLJIgTGFvw== 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=8mdrVCEDwmXtEN/kKbQUtwbBKJxvRJ6bEnOFZLUCAtE=; b=l3xAshu59Qk7Dkfg/06gSxQrwm2qj/rKskgKtMzDcTuvULoZDR7MRv79Uq+MWkP5mgdVZNODYjOI1qywrj24m2NE22xG8yvVMfSTD5yI1PkNmzif+vzxKveOB+iehClNQgIUBb0EUwWD3uu6TNe0skrfrodQZWbYKUSo41AQr4Y= Received: from BN0PR03CA0020.namprd03.prod.outlook.com (2603:10b6:408:e6::25) by BY5PR12MB4259.namprd12.prod.outlook.com (2603:10b6:a03:202::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15; Fri, 12 Nov 2021 17:40:34 +0000 Received: from BN8NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e6:cafe::2) by BN0PR03CA0020.outlook.office365.com (2603:10b6:408:e6::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Fri, 12 Nov 2021 17:40:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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 BN8NAM11FT042.mail.protection.outlook.com (10.13.177.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4690.15 via Frontend Transport; Fri, 12 Nov 2021 17:40:33 +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.2375.17; Fri, 12 Nov 2021 11:40:32 -0600 From: "Brijesh Singh" To: CC: James Bottomley , Min Xu , "Jiewen Yao" , Tom Lendacky , "Jordan Justen" , Ard Biesheuvel , Erdem Aktas , "Michael Roth" , Gerd Hoffmann , "Michael D Kinney" , Liming Gao , Zhiguang Liu , Ray Ni , Rahul Kumar , Eric Dong , Brijesh Singh , Michael Roth Subject: [PATCH v13 20/32] MdePkg: Define ConfidentialComputingGuestAttr Date: Fri, 12 Nov 2021 11:39:47 -0600 Message-ID: <20211112173959.2505972-21-brijesh.singh@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211112173959.2505972-1-brijesh.singh@amd.com> References: <20211112173959.2505972-1-brijesh.singh@amd.com> MIME-Version: 1.0 Return-Path: brijesh.singh@amd.com X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0b20fb08-e9de-4c73-a578-08d9a6038750 X-MS-TrafficTypeDiagnostic: BY5PR12MB4259: 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: SeXVWOm+YwW2ckaz7JJM3S1C2R8/WPEdygroCv2q+1wOfXkHPUxxfdqLV7uWaAE+7okxPSCS2F0HWRMNYq2oX0j2avUmyiitw6i2u4+LoraFGH9p0QjbyniyeujhMxy+00MiF1QC9COD+vcqo8dSc98A9fQJqV8Ynf9pERTtlSgL/BFoPZKpIN0KE0JAdcGF1VhZa1nr4VAYk0uCiCSBnYoVLGOVOu49eL2Bh9tFLMvI+QBvStNfrbqbXss+uofm5IwMoDHdNT8JCCGzeLp6SRHNNaH3ZQuDttVLAQvuDek7BY0ryaiqvji098fkxMt5ZIY/d0/mOIuzABdQyFD6fpmYbJCXVueXPmuKbM6NKIwp8Sls/qTt8mei6kMvBEglr8pc6eCdHLo2JVuxzfpHP2L2O+t8Jrztcl5drzyM8zmABoGcEEOCpHUzRvSc13c/q9fHsQOL9zHTFDVlE4gLHWXXJi+GB/ykgct269w7f58EhhXh/8MP9AB7rE9A5996qnm7c5ziL8HX9NYq67w2dHWde7DmTdvOY9q3aPznSCH+b1lR2ubDfJyJKNxGjCRwQeXED2wNWw46pirkJkHKEPDYCxrGUGB5Tciade2wq+LG57z6ak+5x4PqMyD+ejMT0n8NBCxkYZxFXeGBfz4xS9lYbqOr+jQzDAYBvUIw+ndetNS0Sp5N1pKUF0HqMQeb6kNO/SF3DpeNUPr9voSyXMragPOUmn7VqlO7SGYFTUxTLfnCa+y9l8HuRXDwXBOEE8dhroArwt3oUW3jT5XG9bs28WsThnDJgMX9bNZ18gcnLzoFmxBrOE2FQ0sJicuc 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)(16526019)(2906002)(26005)(44832011)(5660300002)(7696005)(8676002)(186003)(36860700001)(70206006)(36756003)(70586007)(316002)(47076005)(6916009)(1076003)(336012)(2616005)(6666004)(86362001)(426003)(356005)(81166007)(4326008)(82310400003)(54906003)(7416002)(508600001)(966005)(8936002)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2021 17:40:33.4518 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b20fb08-e9de-4c73-a578-08d9a6038750 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: BN8NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4259 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 D Kinney Cc: Liming Gao Cc: Zhiguang Liu 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: Ray Ni Suggested-by: Jiewen Yao Acked-by: Gerd Hoffmann Signed-off-by: Brijesh Singh --- MdePkg/MdePkg.dec | 4 +++ .../Include/ConfidentialComputingGuestAttr.h | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 MdePkg/Include/ConfidentialComputingGuestAttr.h diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 8b18415b107a..cd903c35d2ff 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -2396,5 +2396,9 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic= , PcdsDynamicEx] # @Prompt FSB Clock. gEfiMdePkgTokenSpaceGuid.PcdFSBClock|200000000|UINT32|0x0000000c =20 + ## This dynamic PCD indicates the memory encryption attribute of the gue= st. + # @Prompt Memory encryption attribute + gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0|UINT64|0x00= 00002e + [UserExtensions.TianoCore."ExtraFiles"] MdePkgExtra.uni diff --git a/MdePkg/Include/ConfidentialComputingGuestAttr.h b/MdePkg/Inclu= de/ConfidentialComputingGuestAttr.h new file mode 100644 index 000000000000..495b0df0ac33 --- /dev/null +++ b/MdePkg/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