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 E3AAF941944 for ; Thu, 2 May 2024 14:36:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=+lXVSvAf5iW8XG6LvOnwt8Jqde2+0lPhiQ7y4eYdygo=; 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=1714660594; v=1; b=EL6vj+9BKuLR8FZkXKkO5vAfV4webwL/CxE6/Bp0u3EufzalqR8YAM4zbiP20MIdS52Q0W5+ m4qsJvi/rFeZgBDkPivUciARhvkoFlMw0lwpPyg+bzgH5vhHcVG+ENLOlUZHFB6JyFNjsw3Rdmo pba7UulSeoFBSjD+S5W0ABOmuuP+p4iX7b9cC60SyUCmiXdkfjMNP0Lmwm6qM1nRFpV03nviS4q fEQxX7FulaU3vvPhRZ5IIBR2hwje6sEp+1xTQAA+TCn+PVgzjfaqvvrKb7nucmJGH1ualFa9AQf 7YSTtOnzoT5BLcM+AB/ok0eUoaMaUdW76y3gzYgisOQ7Q== X-Received: by 127.0.0.2 with SMTP id aISlYY7687511xpg46977S1o; Thu, 02 May 2024 07:36:34 -0700 X-Received: from NAM02-BN1-obe.outbound.protection.outlook.com (NAM02-BN1-obe.outbound.protection.outlook.com [40.107.212.71]) by mx.groups.io with SMTP id smtpd.web10.7100.1714660593683010571 for ; Thu, 02 May 2024 07:36:33 -0700 X-Received: from MN2PR17CA0028.namprd17.prod.outlook.com (2603:10b6:208:15e::41) by DS0PR12MB8564.namprd12.prod.outlook.com (2603:10b6:8:167::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.30; Thu, 2 May 2024 14:36:31 +0000 X-Received: from MN1PEPF0000F0DF.namprd04.prod.outlook.com (2603:10b6:208:15e:cafe::3a) by MN2PR17CA0028.outlook.office365.com (2603:10b6:208:15e::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.36 via Frontend Transport; Thu, 2 May 2024 14:36:31 +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 MN1PEPF0000F0DF.mail.protection.outlook.com (10.167.242.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Thu, 2 May 2024 14:36:31 +0000 X-Received: from aiemdee.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.2507.35; Thu, 2 May 2024 09:36:27 -0500 From: "Alexey Kardashevskiy via groups.io" To: CC: Tom Lendacky , Liming Gao , Michael D Kinney , Zhiguang Liu , Ard Biesheuvel , Erdem Aktas , "Gerd Hoffmann" , Jiewen Yao , Michael Roth , Min Xu , Alexey Kardashevskiy Subject: [edk2-devel] [PATCH ovmf v3 5/5] OvmfPkf: Enable AMD SEV-ES DebugSwap for DXE Date: Fri, 3 May 2024 00:34:45 +1000 Message-ID: <20240502143445.526098-6-aik@amd.com> In-Reply-To: <20240502143445.526098-1-aik@amd.com> References: <20240502143445.526098-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: MN1PEPF0000F0DF:EE_|DS0PR12MB8564:EE_ X-MS-Office365-Filtering-Correlation-Id: 10701e3b-40b9-44bd-de1b-08dc6ab54247 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?7vKKU5oXccqyOsDwUvlRuDP3isA6dc0zsF5vkbr2HQKX9QpHKY/6aQF4aZuG?= =?us-ascii?Q?xUiljAPGSsCOVvEA3bfkb9+W+t53O9977huffVEoCUB2T+RxE1hsFFyYBobm?= =?us-ascii?Q?fmhm2QZjTZJyatN1UsGxde2PZaCOTxJmS8TxebFH+8WkX2tDeQuas3ALnh8w?= =?us-ascii?Q?FEs0sQiMRDFdbyJ8h+KDqqsqaH75nmv32qglXtFzg9zz0oJEWrTP2yFTP3zx?= =?us-ascii?Q?VO9FVWPE/+DQ1gGZlbzNSw9aees7S4aTM1ymHijzHih7QaKNykeB6kvP1D2p?= =?us-ascii?Q?3N+SbwZqSrLZCAOimTSmwVqMt9JlBDRYMg7yilJB7I0/KGOEKpMLl1bTzkjg?= =?us-ascii?Q?C8C4D1QUlaTYG61wKMv30QZd/S2vkHSpU82JrAp7bTKee7C0Btdv2HhpAP3u?= =?us-ascii?Q?ksOxogrllQvtz+lySIRcBiHdny2ALUe324cHrXSqTOLLWUqWIfJ/ee9YByBG?= =?us-ascii?Q?4Zi4MA/S2LkEAITiL8o7c1d0noNEiB//TkbleDIaI1Et6MCsli2sxKuZXQvr?= =?us-ascii?Q?xA/jt6j5Zac84C2EaO/AZ2TQv81E7J++2cIvQHkPjzj3wtPWdhfp3P873Jzh?= =?us-ascii?Q?cZaSwDOxzjvmxFPegwspkQhOCq9mtZXu5kY1dxQT6whf0ywLJgO5dnaV0rvC?= =?us-ascii?Q?XreirkdWxoF0ieq403nFE3iIeZNMRcGbop8LlAFhcbilAk2D6j4m8wIoBGh6?= =?us-ascii?Q?2nZN9tFq8mLGxtzijNqeI2abGwQc7PNWu6hkK6Fk/8kiAwAWKwGRhN3tZyTZ?= =?us-ascii?Q?0lvQthzhEmz/L+kAyo+e+P+KMdKEczWjXIdjzKwRF9KJrWY5SCJNYyntmG2o?= =?us-ascii?Q?K+2IOvOnf4naPQPDX7lXupZKw2hJpEFXhviehXq+bDatRmqt4gv2bwI3aaGf?= =?us-ascii?Q?Fw4QSPFHy0FDaP+nKGjZj4edvjTBoPljWiTJa/KF5NOnu4KitCbqnUWAf8HV?= =?us-ascii?Q?4EX5yH0ufJUSt2BwrBAvQKJ9FK9LbOWE1d5LelonCG6nDA0FwQ45CSwLS3A+?= =?us-ascii?Q?TMFNNLdOJHfr3fPCugY1FK+b00T8UGp62I+bvyG9WzB9tJSxMi1UzYgAGNRs?= =?us-ascii?Q?ZrqLzlVz9dmJiyS6iXZed0d5dLXg3Xwf91oj+wRbIx9soHsRxqxigIiEQAaJ?= =?us-ascii?Q?fZ4Udh5M9eNafe2KYwdY5INMYieRI+oSaIJT/QEeTVzZSEOvW6klgaO8NSlf?= =?us-ascii?Q?KDGAfNOsNaQNXbvpMVbdg+kAPTgp2sZa8wTPE05JmGkBAAKWVLUeJ3vC+eK+?= =?us-ascii?Q?PcRMSf+eg5ncQgMotbBFNirvGJta8wcGe4eSJVcyk5Z9YREHRoUeG5rQwqd1?= =?us-ascii?Q?Jl5BFZ6x8GoHseI3TaAsKeycNm0cVJ5tfHRuFKJ1XqMit/O1epOIExt9Ojy/?= =?us-ascii?Q?3fUC1gV5XVxKJXXD0/LpYb1b6tGM?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2024 14:36:31.1680 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10701e3b-40b9-44bd-de1b-08dc6ab54247 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: MN1PEPF0000F0DF.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8564 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: Thu, 02 May 2024 07:36:33 -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: jfbSYOvc2ntpfZvLzhsPUvkix7686176AA= 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=EL6vj+9B; 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. Cc: Ard Biesheuvel Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Michael Roth Cc: Min Xu Cc: Tom Lendacky 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.44.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 (#118518): https://edk2.groups.io/g/devel/message/118518 Mute This Topic: https://groups.io/mt/105863832/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-