From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.72]) by mx.groups.io with SMTP id smtpd.web10.9517.1603981172701399516 for ; Thu, 29 Oct 2020 07:19:32 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=jx1KSHWo; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.236.72, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PC5Vy1HE9T9DMja9NGVHzx6jGBJoLM/0zCds5f/Fk3pfaehchEexXHYV4ofuwlNWstA4xkqYsuNVmkNvUHwhOmASnEmP++8yBf+W4cMyOIoUkjOOOwzV5+l3aYNKAy3lEOiqpZw3JnctAj/YxzY6l671mLFsi5hy+nGW4CKywswyJ64ihQ1imD80ed+HgLkBaQiao8etd960la+ZRTHxOnS8Y0XbagrJ0//sr9OQXP/ZCgsdnxdcRWzRiTXN1rRFKc6v1bwP8Fb3GeKUxff0fFduny7UQhZcqay7DmRpbLSVA3UOpL3q6GJuXc9NLIMtXKHTqbbpjNM9cHrcZtnWGA== 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-SenderADCheck; bh=5GsnKvm+rfQaEf8t7738xvVSDnqJ92knwcjJva2/1ro=; b=YL7yl5wCCcPlb66WK2P2g/dBfIMEChJ/oN4tu7yDOSPdnjl/iEWB02rJFA8CqM48/h6jZZG38V4+52PJsnGmj/+AlSNi4ek1szFDqzzWT4hpmu1qhunsW3m9Ho0LU/6f5aJd9eHpsE7sowrhLPnRLxhlkx4xJtTBu0bAVi4HcHs4vWNe7SHs+wARt0Yuk1AmVtixmX48RqP9fjGZRC3hELr/eDM21utw6bF0hiiLeel9ZzN8MrgdZCLlOw2EGrWiDF67g3xl6n9vadzGBywRjVZBoAAkyoHoZZ0SWN6izSAhbSnXry+NBgdET65F+AIkZ8jB8K00l3lfY5tjxsNGPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5GsnKvm+rfQaEf8t7738xvVSDnqJ92knwcjJva2/1ro=; b=jx1KSHWowouARtJrTVsLJxdqDf+02FxaJtrUi2nVPJUVVjw4gNMix0fz+aGZ3ngOZvV94KaBDGbnzyVLjPdeQqvldoAaqxNtyY42BcCX2YnPE0QESnDAU0WCPGmwv0665KWcBXGuuHgkIz9L1+5rlLl69T2Dunh8VvTMZKFZO+U= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=amd.com; Received: from DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM6PR12MB3276.namprd12.prod.outlook.com (2603:10b6:5:15e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.24; Thu, 29 Oct 2020 14:19:28 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::e442:c052:8a2c:5fba]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::e442:c052:8a2c:5fba%6]) with mapi id 15.20.3499.027; Thu, 29 Oct 2020 14:19:28 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io CC: Brijesh Singh , Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH v3 09/11] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Fix erase blocks for SEV-ES Date: Thu, 29 Oct 2020 09:18:00 -0500 Message-ID: X-Mailer: git-send-email 2.28.0 In-Reply-To: References: X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN6PR04CA0108.namprd04.prod.outlook.com (2603:10b6:805:f2::49) To DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from tlendack-t1.amd.com (165.204.77.1) by SN6PR04CA0108.namprd04.prod.outlook.com (2603:10b6:805:f2::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Thu, 29 Oct 2020 14:19:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d581a0b5-084b-4506-e642-08d87c15a547 X-MS-TrafficTypeDiagnostic: DM6PR12MB3276: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HNOlHvPAbhZ6RsTpaReiVTrE1q2YYcMYqCydljA2Z95gjW5tcPqwST/3pi6ri1BChse1GLOlg06VX4ozYRZKpC04Q3rMDdL/QLlAIsYuRbbuao0Dn1Qnn101zWwAvAGimSqXWFL9SQIhJvUFqaOjlr5IrljMdkylXOEGLXH+C/Woq2ONjyl3EcCf678jByYzKOo1t25n7GBih9FQ0PVC4/lxapUlaNZb6IzwoGi8TZXvu5nyAm8On2o/jtCYw7oa7+igfhYJ5SC5TOWGV5cozXsiRlxjbXe6KRYvxbH38zNcSlf4vvQpqSbkrY3ccPkLJPTA1K44XMPoO8KPz0SNrYYWfYgDxE5f+e3mYCZPZaz7gOyGh3Winc2uHMi81ng/NuTRVSUtDNVcSU+KxNOiGstPpUvMLu47bjhQzNrURTkibvRKaA+zaQ2QfXjrUI8Vym+bLRZ7h7NkFKjurz+LqQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR12MB1355.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(396003)(376002)(136003)(346002)(366004)(26005)(8676002)(186003)(16526019)(4326008)(86362001)(6486002)(83380400001)(7696005)(52116002)(54906003)(66556008)(5660300002)(2906002)(6666004)(966005)(36756003)(2616005)(478600001)(316002)(6916009)(956004)(8936002)(66476007)(66946007)(213903007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: LmxQ+cB950tda3ZK+sWjlhw3aDhcuYyxb4vgvHL/LPnZBNKIikIOU4gf36oRc51Bip6tfa8EgJP0r0LooiGaye+s20VcXnEtl1/+WeLAsMNmED2y/BYySTuHwcMbm062ZzU3QPDOZc0YDDPsQeL3kQv0aB62ihlkHJWficVROT8pkl6+gpZbTlP6sJnbiNJNYUadMYDQbI/OjzeTpnc+xMKBWdtwUJekRdfZBKF15D4WBeiligM2c7xaBtHINyUVr+G3QFAfq9eOdDUbFVFvJ53gmpGtl+mLnPXrgbV6OI7R0wKZuKfhh17BGxGYB/adc5LIeWNc4DQAiEnpFvI5SYK3hz/Ht/zjMHAVxMQ+B9O3dEeNF53pY7R9W6gFNSHwFunvT9OO0dtzIbaEEKjU+kMwEfel8xHOvu5ZBbxzNoH+sGZrDVTFAItIml2TMMJ6C2Jjq+1IXH5D8cMlrGccMCAZixDQUw5Va//a5ictZyQioeWQ4VRHg18v9rhf/8nWs/fadW9+cUdI19MBg3CAKmA3ySf8jqMOl3FOX9cdm8pjTzI8akD2StsIRy9IgzZSL+wcGu4yVKkDx8lHeQuFhAKb7bk+ErbS9c6faYYwBqDlnSMon77s9LyJ2+ahJhFdOfQ2mHsMqhjF4GJu8PQALQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d581a0b5-084b-4506-e642-08d87c15a547 X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2020 14:19:28.5303 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8ZqFFq1B3mzwawdqacS1Z6pQv/rN04Y+0QA4Y+6BWH/Bj8KwVQ9LCSzMSREWN4UOG34BYHa1VnCREC46e6pT8Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3276 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable From: Tom Lendacky BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3008 The original SEV-ES support missed updating the QemuFlashEraseBlock() function to successfully erase blocks. Update QemuFlashEraseBlock() to call the QemuFlashPtrWrite() to be able to successfully perform the commands under SEV-ES. Fixes: 437eb3f7a8db7681afe0e6064d3a8edb12abb766 Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel Reviewed-by: Laszlo Ersek Signed-off-by: Tom Lendacky --- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c b/OvmfPkg/Q= emuFlashFvbServicesRuntimeDxe/QemuFlash.c index 0d29bf701aca..d19997032ec9 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c @@ -232,8 +232,8 @@ QemuFlashEraseBlock ( } =20 Ptr =3D QemuFlashPtr (Lba, 0); - *Ptr =3D BLOCK_ERASE_CMD; - *Ptr =3D BLOCK_ERASE_CONFIRM_CMD; + QemuFlashPtrWrite (Ptr, BLOCK_ERASE_CMD); + QemuFlashPtrWrite (Ptr, BLOCK_ERASE_CONFIRM_CMD); return EFI_SUCCESS; } =20 --=20 2.28.0