From nobody Wed Feb 11 06:00:00 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81905+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=pass(p=none dis=none) header.from=groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1634144280359504.0970197684969; Wed, 13 Oct 2021 09:58:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id lq59YY1788612xqKPQsJ0N22; Wed, 13 Oct 2021 09:58:00 -0700 X-Received: from NAM04-BN8-obe.outbound.protection.outlook.com (NAM04-BN8-obe.outbound.protection.outlook.com [40.107.100.55]) by mx.groups.io with SMTP id smtpd.web12.119.1634144279408499919 for ; Wed, 13 Oct 2021 09:57:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fKNOVnMhakDR8odvwOt3IAfQqK5UfWTl4POYjLzkmRt0/MTduQBSh/nf3R4ikmfkwv/bRYjZWbWVVDK+C5HEj0/qoa68J/s+D07u0skJpuGBE2uXHcS1nfHwwpdC+LiMqVh4jxDFeVAoO3oygVmzR1X5fp6v41iQe/dSvvRlkJrzs4jMC3AVxZSpD3ZySiNu/pXhd/wIa2pmziwBc+N7jSayBsufOvxwUfBUfJSaCoShNjPEx3iYerlDdmaip1O0iGmKw0h9bd0n05HFNjqePMS1m9BtwEHZY1Hy/RjfOTgBHcLkC4ZznTu/PtR55l2/Zw4GmuZqtAp8vVihxTFfWg== 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=wOJEl/2BnNTzs6M6n1+jEHciKBiEz+XWQjIAGNFslTk=; b=gUogGw95Cnzx9Ry29LwAc10CoNPL08kJksIgh8QJ+GF0eb5WhgKEw2uY0O3Nvj0q1FJ4KLCmQehXzT8nbPUtwVGw9Ul5beqTrIPDBIe+5OCpoPqbIfR2lv52rJZpP73tQQJCxocJ8jvmB9VZYKeOTrntYZQi/7ZAbOqzLjpq4AUhm2KcnF5WkcfjVNL1pEUqbQr962FgO/RmuNYbKZfSwkHh9mIgWGKukoZaEur+m4ahxhNcUWx3fQ+NImVFDT5KDedqkFz3mAgftyUO/PHj8hM7/VuH7LlhwDzNnbgQKlDDj2c3T+MXsyFimfh8pi4YKXVdTG8PhTsijvw2zBF7TA== 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 X-Received: from MWHPR11CA0012.namprd11.prod.outlook.com (2603:10b6:301:1::22) by BN9PR12MB5177.namprd12.prod.outlook.com (2603:10b6:408:11a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Wed, 13 Oct 2021 16:57:57 +0000 X-Received: from CO1NAM11FT060.eop-nam11.prod.protection.outlook.com (2603:10b6:301:1:cafe::86) by MWHPR11CA0012.outlook.office365.com (2603:10b6:301:1::22) 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:57 +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 (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81905+1787277+3901457@groups.io; helo=mail02.groups.io; 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; X-Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT060.mail.protection.outlook.com (10.13.175.132) 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 X-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:52 -0500 From: "Brijesh Singh via groups.io" 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: [edk2-devel] [PATCH v9 21/32] OvmfPkg/PlatformPei: set PcdConfidentialComputingAttr when SEV is active Date: Wed, 13 Oct 2021 11:57:02 -0500 Message-ID: <20211013165713.727815-22-brijesh.singh@amd.com> In-Reply-To: <20211013165713.727815-1-brijesh.singh@amd.com> References: <20211013165713.727815-1-brijesh.singh@amd.com> MIME-Version: 1.0 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: c55ebf0a-2bbb-4612-9cd5-08d98e6a9b32 X-MS-TrafficTypeDiagnostic: BN9PR12MB5177: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 1d9Ecnird5BrhYIlmQSoHW0H82P/vUaW/khIjLR6JyC2Zf+2TQfLNZlGndHHPSZ075f3MEIUdhHfLoNyS2LqNeqooq6NDHKb2N0F0g264yBJSIw8g04E+tyqR8ZR3dEKa0q7wVigb73krn+jTSmHuD/i32OUT/nbhjY4gQeJVzmBhGDQliHzK8LEYoA/oNWef7hKUqyFyhOw14MFpL60SMBixm2KM0t0RJRUTmHxOf7UAx9mv8mm/sCSPDnpbDgFmSNP1/d8CWM6Ax8Bs71wEc/imqnMPfzLa0ali04uCVTbjOp5zI+JMzSdGoOhw6RQcN+TRXeMykLr/g5V0jNCu7mKjkbOJEUksT0y5m3+EXRU11elQkff3lwAbrisBJq3Vq+40TwP7dLmk8GnTeP4QvagpNughxnxu15Lg4zUWmfK5loABQyATjddRRNTIHnZyFcd8NXpx6gR9jZfxX+l8ruS1Lg23tqb37LyCEnXg4+E3gwpAKGXGQS3tFnwlhO87UTNfW8E0j+A5QWdu0OwL9OLqe8kzRbLqVBQ+6XkrvZlLS2v0Jdv85A4SLLYAesxoPQmAGdEpvkRoSvS81G7AoOjFcA028THOyo8SfOMpCHXLBnNLowFX9nKBl/A/X0c753QkK/r7wUs9NfAeWZWRjXzrPf5Mz4bRDmzsnTW0/eirX8UHl3SZ2SfammrUai65OlZE7d0QPLUIyb8vAch+tzhYb+Jgn28lWxuArc7MrihL97kg1PQgmq96S3X1ZL+Xs7GEsJcuo/rPSouHT6aWSg/Ky38/lmPrCtQcuIewcunhtog3571SQGRyQPUCnew X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 16:57:56.9631 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c55ebf0a-2bbb-4612-9cd5-08d98e6a9b32 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: CO1NAM11FT060.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5177 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,brijesh.singh@amd.com X-Gm-Message-State: TBu6m2QgaSelyJeyuR0r0VXix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1634144280; bh=KcXJmO88zrAS2t3T0J2hIPUrmyYd6vi1WCMC7qq0nUA=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=RuOjMi1jZuwi0r8HEC2CcxD7hxP65F/Sl+mkvMUQng7eR0/aUtCGVnFlkQWsbbz+oFD pGJ+4JvnHxFdUUcnG36Gy0or+84kX0mHJFo7KgmvnjmvhzztVhUiVpmUsjj26GxpPYrzP N0N2xD0SY+cD5O3W/X3nqgykNDE6Xo9ZlA4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1634144281029100006 Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3275 The MpInitLib uses the ConfidentialComputingAttr PCD to determine whether AMD SEV is active so that it can use the VMGEXITs defined in the GHCB specification to create APs. 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 Acked-by: Gerd Hoffmann --- OvmfPkg/PlatformPei/PlatformPei.inf | 1 + OvmfPkg/PlatformPei/AmdSev.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/Plat= formPei.inf index 67eb7aa7166b..233b9494f64b 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -106,6 +106,7 @@ [Pcd] gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize gUefiCpuPkgTokenSpaceGuid.PcdSevEsIsEnabled + gUefiCpuPkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr =20 [FixedPcd] gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c index 391e7bbb7dbd..5e2c891309d4 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -20,6 +20,7 @@ #include #include #include +#include =20 #include "Platform.h" =20 @@ -342,4 +343,18 @@ AmdSevInitialize ( // Check and perform SEV-ES initialization if required. // AmdSevEsInitialize (); + + // + // Set the Confidential computing attr PCD to communicate which SEV + // technology is active. + // + if (MemEncryptSevSnpIsEnabled ()) { + PcdStatus =3D PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrAmdS= evSnp); + } else if (MemEncryptSevEsIsEnabled ()) { + PcdStatus =3D PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrAmdS= evEs); + } else { + PcdStatus =3D PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrAmdS= ev); + } + ASSERT_RETURN_ERROR (PcdStatus); + } --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81905): https://edk2.groups.io/g/devel/message/81905 Mute This Topic: https://groups.io/mt/86292903/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-