From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.71]) by mx.groups.io with SMTP id smtpd.web11.32967.1669862282448307841 for ; Wed, 30 Nov 2022 18:38:02 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=WJednO+7; 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.92.71, mailfrom: alexey.kardashevskiy@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ait6VHfmLUAFXb9p+2H2RMyezw4rQfmtgZVxWaTZsmbG8layg9J1TF9fJBwib+DHHlTPsIX3ZuWRC/MNwpCde/wo5JSfqqiEQZBOXVoPIAhY/jc4PxmznqNeId7SFmZVFiLTdcbfPuOArf8P5jGsF6vGI5J1SbyTTkAXx11+7+sdU8MSWGNhpFCsesiwO1poC3rrAHb1+RpJ4D4HCt4gzy0Ttfid9tbOcIQtjdT+F9C+DpsFlHXbdOFU9/wznlHaZWH7WXsWsF0wwKGQycylmPomXf5UUe65xsaurHyRK/+TRur0O4W8BqNaa8QkmXDPpUNJTbNSp8FdPTOC2VwxFg== 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=bCfpE9Eg4or/QcjJlDfhC1C2IW2pJDrYZgTqNCPmoMM=; b=ivAqnj4Yrqq5DnaSH/CEKb6qsZT6gY2FXd/7gufjPggl6d46/iMzPCYAx/WTMQKQA5eQSwRLwpOE96Ht+BhQmqyMaJWKmThK9Opueh6mZiZTIiHDTs6oSiH7UUe7Rhl+5bwnQMZpXxCMOVtSqI8+wa8plUW4yKthglLlpWtI1cZJFAP84vN8AtrcpZ0f4Zwxn1vo5EZeHRfUz6J0NIjxDDSsPcLNiZi4ZhGmZUcG3uzs4IoowBYSQm+YxaR9DCYdp94Rng4yeKi+b4de0kNEb/0Myw61YtejW/2l7OoZzqMTGhPn5IhRMR09eyDAfBotLBNEBXrFuaz1YUULRLqZMQ== 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=bCfpE9Eg4or/QcjJlDfhC1C2IW2pJDrYZgTqNCPmoMM=; b=WJednO+7CxnbJifrL05iMxHJ0tSRyCwy8bx9HbsY2JE3RoBt1NfpbS11Hvs32SAtTz1w8xwe0KJS7SOxPFDImvQ6fTEqbkvl3y6nLw9u9iEv5kc0mKjfFz/TiaUSAmSSXdUb5gMxclhesv4zd+ooCvDAVCwlBlDp1p6WLP3Sim0= Received: from DM6PR07CA0104.namprd07.prod.outlook.com (2603:10b6:5:330::30) by SJ0PR12MB6926.namprd12.prod.outlook.com (2603:10b6:a03:485::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.23; Thu, 1 Dec 2022 02:37:59 +0000 Received: from DS1PEPF0000B075.namprd05.prod.outlook.com (2603:10b6:5:330:cafe::8b) by DM6PR07CA0104.outlook.office365.com (2603:10b6:5:330::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.8 via Frontend Transport; Thu, 1 Dec 2022 02:37:59 +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 Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0000B075.mail.protection.outlook.com (10.167.17.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5857.17 via Frontend Transport; Thu, 1 Dec 2022 02:37:59 +0000 Received: from aiemdeew.1.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.2375.34; Wed, 30 Nov 2022 20:37:53 -0600 From: "Alexey Kardashevskiy" To: CC: Ard Biesheuvel , Jiewen Yao , Jordan Justen , "Gerd Hoffmann" , Brijesh Singh , "Erdem Aktas" , James Bottomley , Min Xu , Tom Lendacky , "Alexey Kardashevskiy" Subject: [PATCH ovmf 5/5] OvmfPkf: Enable AMD SEV-ES DebugSwap for DXE Date: Thu, 1 Dec 2022 13:35:21 +1100 Message-ID: <20221201023521.10028-6-aik@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221201023521.10028-1-aik@amd.com> References: <20221201023521.10028-1-aik@amd.com> MIME-Version: 1.0 Return-Path: Alexey.Kardashevskiy@amd.com 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-TrafficTypeDiagnostic: DS1PEPF0000B075:EE_|SJ0PR12MB6926:EE_ X-MS-Office365-Filtering-Correlation-Id: c358fdeb-a5ba-450f-220d-08dad3450f8c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JaBxnEdZWS53VkPpVmoHCdce+e5VEXz92ec4SMcC4g2bWKO7nWpehbyimVSUNo40X5LFKGbgpzI3AthLG/dg8HgCPsuqO/yHVnP6Hepgo2b7u3X3J7AwQmYsQ8RIQ9jxnjrOFLoKlQL1aBQvC/UKTbZ1MH6DBfniSfqLDAtbdoVcPu3R/wz2Pn4eUvglQKLhi8KnxYZrJRhjda5j9rXP4C05iY2H2urls4X7AVMTaF2YBBi+AUHPobv45ScmdbvfzFH3FUAGa+Ry4Xt0BMFvmskeyzaPEHDBK8WARlC4DTTCSZst5a65g/r/Mpe9hQWTmev3auaM7eqdDAF7NM8FeEOvKZavR/Upd5EhXfN+4jIjTB+uJ6bjHUjQ8XiEhznUKqSi22HEwEJt1Y/SeltqzDn014+FwatB0f0r5tktu3dVLd7Q+zaUMsBQHR1xvrcsu0hwZ92F8UJRT7HKIUZYYngDZgMZ3g47TOV6/iE0bDRl6GzOlusvS1UzaDgHuKse1f0+ve9hxQAoXK++o7wDtU+6sLEO2N7T17GvlcCAXt5cEjV/lUHpk6b0D3/3s6PQaD+sAemIwniZc2kJZmrPXdwOZVJWJQqvn4D+GAXjhs+WjcIlkTXHfiXJrnGLwoi85sQrWV3jwsUBJLykvtniJFg1O3a3RwqK4y4UIuYtJMp2RSnSX+rDZFZROi4u8qnXIqkgktMe05DrMMBvZoUx0VVQ5TgdADkNaV5ynDiR3Pk= 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:(13230022)(4636009)(396003)(376002)(346002)(136003)(39860400002)(451199015)(46966006)(40470700004)(36840700001)(1076003)(316002)(26005)(36756003)(478600001)(186003)(2616005)(54906003)(6916009)(356005)(16526019)(36860700001)(40480700001)(40460700003)(81166007)(82740400003)(426003)(47076005)(336012)(82310400005)(83380400001)(6666004)(70586007)(8676002)(70206006)(4326008)(8936002)(5660300002)(41300700001)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2022 02:37:59.2611 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c358fdeb-a5ba-450f-220d-08dad3450f8c 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: DS1PEPF0000B075.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6926 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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 e1b9fd9b7f68..479f898adff4 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -324,6 +324,7 @@ AmdSevInitialize ( ) { UINT64 EncryptionMask; + UINT64 CCGuestAttr; RETURN_STATUS PcdStatus; =20 // @@ -407,13 +408,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 CCAttrAmdSevFeatureDebugSwap; + } + + PcdStatus =3D PcdSet64S (PcdConfidentialComputingGuestAttr, CCGuestAttr)= ; + ASSERT_RETURN_ERROR (PcdStatus); } =20 --=20 2.38.1