From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id AD3F6AC12D6 for ; Mon, 22 Apr 2024 12:18:49 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=BQuzkbmQv/yUGTTRB+mH2CLcNUjvCfvWcatd5UeW4B4=; c=relaxed/simple; d=groups.io; h=Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20240206; t=1713788328; v=1; b=ouO88984ANOD+iH+MZaa0bvR+u5Pq9+yqB264gchTEKhzEYV97YZzswhDCvibN6YWFhTdRwa rW5xXhyDLmgvlVWwFw4Iv8lkfi4PeBRyq+JYot+pp9WH2rnXb2D+OaESJY0vg9tcVW/jB8Xd930 mAHjq9GDDFC3q3ZU2v7/DgVQUH4vb1yOSI926lM2ssP0Ha82xUlZpDo1mEdEUEuGSqyIRMgKMgn jmVJE3KUxJJdOBS0mvvKedLdDeA30/w1e7kYdePKfxsWDPNwO/CbCCPRpnuOGCXpDkJzZYx7g9b Dh07q2r+BCadBQJLPukQr9R+es8t7QqMJm+L5UcS1cC1Q== X-Received: by 127.0.0.2 with SMTP id TyA4YY7687511xE4oH1dGPxF; Mon, 22 Apr 2024 05:18:48 -0700 X-Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.96.45]) by mx.groups.io with SMTP id smtpd.web10.16971.1713788327294568995 for ; Mon, 22 Apr 2024 05:18:47 -0700 X-Received: from PH7P220CA0114.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:32d::8) by IA0PR12MB8837.namprd12.prod.outlook.com (2603:10b6:208:491::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Mon, 22 Apr 2024 12:18:42 +0000 X-Received: from SN1PEPF0002BA4D.namprd03.prod.outlook.com (2603:10b6:510:32d:cafe::47) by PH7P220CA0114.outlook.office365.com (2603:10b6:510:32d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.34 via Frontend Transport; Mon, 22 Apr 2024 12:18:41 +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; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF0002BA4D.mail.protection.outlook.com (10.167.242.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.19 via Frontend Transport; Mon, 22 Apr 2024 12:18:41 +0000 X-Received: from aiemdee.2.ozlabs.ru (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.2507.35; Mon, 22 Apr 2024 07:18:39 -0500 From: "Alexey Kardashevskiy via groups.io" To: CC: Gerd Hoffmann , Tom Lendacky , Alexey Kardashevskiy Subject: [edk2-devel] [PATCH ovmf v2 5/5] OvmfPkf: Enable AMD SEV-ES DebugSwap for DXE Date: Mon, 22 Apr 2024 22:17:04 +1000 Message-ID: <20240422121704.200856-6-aik@amd.com> In-Reply-To: <20240422121704.200856-1-aik@amd.com> References: <20240422121704.200856-1-aik@amd.com> MIME-Version: 1.0 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-TrafficTypeDiagnostic: SN1PEPF0002BA4D:EE_|IA0PR12MB8837:EE_ X-MS-Office365-Filtering-Correlation-Id: 67e9f4c6-094b-46f1-b102-08dc62c658ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?V+ZWvZjH3inYaIRLklEEhoTxEVLqjNqVJa7bR+tY+9HYsD/KKO/FR2vjOIGk?= =?us-ascii?Q?lg+ucprjwSFPLbn2pTpCXJDPtFQ/e5jA3y2LXuuVrVnMtUPDGa7XU1TlXnBE?= =?us-ascii?Q?PuWgikJRBNf1szrNez2yxdkNWQuOuwCJ6z2680yojyXe/k3bPwviROdQ7Tgw?= =?us-ascii?Q?YMaD5fNv0Vv88sDFYw/sf4kZ6PCUv3CeNvO7670a0kKPhD4nqfL1Nl2nXm0Q?= =?us-ascii?Q?Ad2GfD7lD/Po1Ns3ydCLSY+9lO4T84k0DIkyJrUDWWUs17Rdi4sR9YXsJbKK?= =?us-ascii?Q?ftyI8miRYs7G+SbEhkUaUFI8bG4zyT8Tt+AUsfBtHxRVxNC4x36kE4VoO90H?= =?us-ascii?Q?DHZ937BTqaPfMaT3KEsTFOjMK1Yhx/u3vTb9J8Kl/zMoLccx5dFglApV3sLs?= =?us-ascii?Q?tO3n8h3dzOmXy8hYSGjAyA1ZYMTQNdYNlsj+kB6lfYslRCWxixzt+wBMDDy7?= =?us-ascii?Q?x6I0b+48roXE8Ku0fz5MNy5pvqgKFmQt3OYXXaq90XLF1Qjd2iXSEnWTiwzj?= =?us-ascii?Q?iSRn0bXux4HyiQhlgbK7BhpEoOwOyX7XlccUtMZFRJjRM2/gyIwia0e97ZY/?= =?us-ascii?Q?6a6yUMRxgH/yftMpCFr9QQpwrm2zkVmU1G/CKB0a2WUbXJEUkNmgmmInJ0eP?= =?us-ascii?Q?JAcEN9zNlXOQV6AzMT93OK2f8BUcorney0aCwlkzh7fXMtv7lYgpix0SRixu?= =?us-ascii?Q?eqWXl3JUXcxacnpz9c0FQSTobUNYOjP0kcH6ShZFgc7WPBf7Jes+JZK45j/k?= =?us-ascii?Q?EuE7UN6RozKbEW+jcqo2k/hd4BZ7wNAtrY+iMcwII45+qcETRrl1BMeKEhqE?= =?us-ascii?Q?wgoIrTwDovmXQh1U4IF1Sa57WAgki5kNZmBfyBicbZRNl+eO8Pcpic4i2Orm?= =?us-ascii?Q?CvaR15F327DdGGQ8wPoMoT0u9cstFcc2OiS1u6HxMO1forG81AqkFazKv6SK?= =?us-ascii?Q?Z4xBMfjQjY3klPTO32RS3wiMk3f31RliBrQPsHdsd94SN49iVt1Np7gdyqmn?= =?us-ascii?Q?QeDjM8KYimYcHP9gD5bYjYFdMcHtfNBloF9JfadRKJzbnaL/cvfqvALSXdvb?= =?us-ascii?Q?tzy4xstz+2BbxMwqqwZrmgOMdAhehRCQNqmucb2YvY4WqUb2IX7Dr5KLZ2au?= =?us-ascii?Q?MrhWV/SFpdDSZM8n5u2lLI+rN3TVI3i9W9GalreZ7CjYcsN1sC2CMMESvh4w?= =?us-ascii?Q?TD+CV9L7n8Z94+BasSxLin8diDOJK1Rq6TkzhY3Pp95KghSpZMg8DlnSlwCE?= =?us-ascii?Q?+bXh6DkihSnKneMdhxyggMa8JPOmdc4ZPmRxhRDcVmhvoVbt1JcRvSKTdNz8?= =?us-ascii?Q?gNC4rP8ef+h9KycCStFi+u0jknyltfizr3vDMnjrm6yZurmzTBwaHpNppWD9?= =?us-ascii?Q?nj2tSu2CC+1QNuwP7Zpiid+JXKe1?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2024 12:18:41.5341 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 67e9f4c6-094b-46f1-b102-08dc62c658ff 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: SN1PEPF0002BA4D.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8837 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Mon, 22 Apr 2024 05:18:47 -0700 Resent-From: aik@amd.com Reply-To: devel@edk2.groups.io,aik@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: SxKVhSNib2VlZ2OVbP1tMp4Lx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=ouO88984; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io This writes the feature bit into PcdConfidentialComputingGuestAttr and enables DebugSwap for the DXE stage too. Signed-off-by: Alexey Kardashevskiy --- OvmfPkg/PlatformPei/AmdSev.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c index e6724cf493a7..785872537728 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -434,6 +434,7 @@ AmdSevInitialize ( ) { UINT64 EncryptionMask; + UINT64 CCGuestAttr; RETURN_STATUS PcdStatus; =20 // @@ -517,13 +518,19 @@ AmdSevInitialize ( // technology is active. // if (MemEncryptSevSnpIsEnabled ()) { - PcdStatus =3D PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrAmdS= evSnp); + CCGuestAttr =3D CCAttrAmdSevSnp; } else if (MemEncryptSevEsIsEnabled ()) { - PcdStatus =3D PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrAmdS= evEs); + CCGuestAttr =3D CCAttrAmdSevEs; } else { - PcdStatus =3D PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrAmdS= ev); + CCGuestAttr =3D CCAttrAmdSev; } =20 + if (MemEncryptSevEsDebugSwapIsEnabled ()) { + CCGuestAttr |=3D CCAttrFeatureAmdSevDebugSwap; + } + + PcdStatus =3D PcdSet64S (PcdConfidentialComputingGuestAttr, CCGuestAttr)= ; + ASSERT_RETURN_ERROR (PcdStatus); } =20 --=20 2.41.0 -=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 (#118093): https://edk2.groups.io/g/devel/message/118093 Mute This Topic: https://groups.io/mt/105668073/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-