From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.51]) by mx.groups.io with SMTP id smtpd.web09.2444.1636582532252514977 for ; Wed, 10 Nov 2021 14:15:32 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=3eZSJvFE; 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.94.51, mailfrom: brijesh.singh@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NbGa1+mk7oxtGqY+ClNmR3kOhquZfUM2rZSdDYtT8WV9o7IChPb895rjkWMcv31cOWKgbHUPpYRlXUcdiDsTHKet3tKHSg8tkG+H+2ngLIeIm2NDRtomBCoTWL92qb1YV1ELwkQhgwYCfXwWLojRsaeMVG6IYBsNedLdyXjjzpPD9gUTnemKbPocZR+VN9vfd5RZaIvpvSnmiXhBs3sFz5Q/PMZHN9X6+GvQgg3kPY4rr4v40eLuzwjLKoVOTWY8FupOELf/7Go4m/QQrCm8MDzzcU+pJCaVs2dgaALHuT8zhSVilQ91NjpZZbowx/XZR6/i4zZ3dI68kXWSFi7Z2g== 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=SNseimTyZ6tP3rd9HGHC6g3HkaEQw/HmAZaqcdUjNc8=; b=oCWVJoOOcrHq3FeJHMr4ITLGfAHD8iHivlA99FwpRljZK/VyazRzR5Efp3HE3Rs0lnEHKykcSrxlgguTBM520jA45nFzzLrvuBXx1wG4TY82W5irhtEdCPFwVP/38rNR1ZByJ28rzvKenkV0+xBfAhmbGtye8aR+JsqW4t7vj8l0MxzPf/b7W3oouTliJqLiLmIDMeCYxuI9K2ZKh1On6lZ76xx9p9al0CKPFB43KoLh6P8MJ5tHwa7AhZc/y+1cX/tyd716vcWf6fDDAeXSxGQE3s835gSyecshlri7TW2Mph1vXlBii6MJI64qg5vc7JimYP/rWjlZf+1ewOWWjg== 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=SNseimTyZ6tP3rd9HGHC6g3HkaEQw/HmAZaqcdUjNc8=; b=3eZSJvFEroZBKhXKzRuzC2DHJvp0AX3x7jL2IfNttoWjMRisl0ahrN5FIW5xB6Mi8WIHkIxoDWT5+gMeER9ppj8uEGz36XgOwP9BNg1pfJdGLXzNZMQPNOBcFy6eVjegIgZeq18nR+FucvwjIlCB7tbxNItm1sny45diziz856U= Received: from BN6PR2001CA0018.namprd20.prod.outlook.com (2603:10b6:404:b4::28) by MN2PR12MB2975.namprd12.prod.outlook.com (2603:10b6:208:ce::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.17; Wed, 10 Nov 2021 22:15:28 +0000 Received: from BN8NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:404:b4:cafe::9) by BN6PR2001CA0018.outlook.office365.com (2603:10b6:404:b4::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13 via Frontend Transport; Wed, 10 Nov 2021 22:15:28 +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 BN8NAM11FT066.mail.protection.outlook.com (10.13.177.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 22:15:27 +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; Wed, 10 Nov 2021 16:15:24 -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 v12 20/32] MdePkg: Define ConfidentialComputingGuestAttr Date: Wed, 10 Nov 2021 16:14:45 -0600 Message-ID: <20211110221457.2397234-21-brijesh.singh@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211110221457.2397234-1-brijesh.singh@amd.com> References: <20211110221457.2397234-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: 9bb5132a-a3ca-4312-6720-08d9a49799ea X-MS-TrafficTypeDiagnostic: MN2PR12MB2975: 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: /iWxIgTOIg+FBA9TwNFKgiYu5mJA94v5tNHmyMeaIZWQdiTBxslceVzgz2pxuyeJ+IxoKCRns0MN3eiXoWo9jd0HqWyBM6+j/3SPBoFwMHToinr2O0i9FBrmsNMQV0gnA7V6OX+T8HfeHvLtZ4JltJ5P4XJtvCO6POHE2in1oIGT4cVt+t975rPo4nHF9LWbV13Vv9TgVYEXDmFkO6GJCz0lnIlML7wLQXCywELpS6REhroiG2ViwYMMY5NZA5HA195dNI3vFWJtjZrGeLSj9ORtFkvU9h8q2Hoij7JqHPCF+IkiBcS8t9HynZsuotodGSMu3PhBzVZL3m/xbp2gkXJFITIRUdFu6thopIjzMD3qMaiZK7l/HoC4tFCJh0ohRRoQZqc19cdt7ls8iPQnR5wlzEi9Yz80reLiHsQ3wJsHKjjKiZwo1hLPOMHQBhJRb7bLG2BbaLDfQ+yn6soTl8ZvnNBuWI6l1G1hbGSw0vFZEVtP4c5R/0PxkUvigo6KdM+7oa7KvjPH3ty4Oxm2sYxYjIwij7TlN1h3ML3d5j/tiK9j0n1q0A3alHMaKyP61yzx++v8JzJk9W2+LhYD6nULaz/39IJ5btoBpLU0bWHiAszXUM/5N9YdmU88gBv6AxLFV01GxzLyFM/rrI1dwKpsKEdgOsIkEnIsJSf73E1VTEyd5y2egXGaGpVTBfKQoE/WNW4yqp1H0+RRpLmBhxeyHywICICQX/ixmTomrXmSAUsNLP+2GOWco3qme2PBL5VihLLpHrc7p7faSzUBBMiz3kiw1AxWUwREVUaGTfGzrEpmqJwACg8g+ayxCuzW 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)(70586007)(2906002)(86362001)(6916009)(426003)(36756003)(6666004)(70206006)(2616005)(81166007)(8676002)(316002)(5660300002)(7696005)(1076003)(966005)(7416002)(82310400003)(356005)(508600001)(16526019)(336012)(26005)(36860700001)(186003)(4326008)(8936002)(54906003)(47076005)(44832011)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 22:15:27.8488 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bb5132a-a3ca-4312-6720-08d9a49799ea 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: BN8NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB2975 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 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