From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.46]) by mx.groups.io with SMTP id smtpd.web10.625.1604685278365444744 for ; Fri, 06 Nov 2020 09:54:38 -0800 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=aiWrLwR0; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.223.46, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q7dfQDRlFWSEKHFIjVx0HrH8HM5EHVQSkzFfpWpqshmKi2CTde8zUlMGB5SsPWFfDHU2MKKdrMHEQF91Rt74bsdPWWdgFol16zrmpHdWOM0dae2VA+rZoHQQjSXQYtvy24YompG51fbP+VZV1TuxM9ik8JTqEH9z2lN1dvcBAPmNNoO1BoZpLyd3BjLjZRBIog5RdyoaJIxvi5RX1QjiHC0+SArkRLR8mYPYFp1Y2YlmlHaPLHlNUXRA0KJH4FClvvrrG/rK+UHgRpp0yXi4vONqJ6wNlM5m1VmQ2frSJmhYhmd9tJslm0mDUX4adG5UkZuF80qzNaZ9MNwhh8oiqg== 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=K4GLd5XRlGf1xNsf5yRlAjjVbfT+SrQCmGpnKVIrUzIM4rK28/nhEgHLI0sDqd2HCTXIiAThq4Z2H+MzFsNcDuPYOIMbwSbTlK8CSuwXsLiEFXPN9Bwe5fgzzdkMGXnykjlLLhw/Mb43aGkQ5NFRqkOIvAFDFHmUfQqZAyHFZZWjSFn1U4Z75NDxh35xUgA+NMXwQU7GQWX2Gn5EDpXL1zeL1XD/8Xl+9Hh9XLgnl690hvJaZzkDuW+mQBPYmU3hbwwQvk2EjKFVfOBIJvohilYpBEzdE0QMtfa114iJbT7WWaqNFU6RSCpE4BUyCv+bX3Lx647ydSl+0w0jmyP6Fw== 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=aiWrLwR05lQt/rk1G7FPt/eHxcnYz9uNU6f8tYnPMJJ3S6aEBGLEadBNeh0enQRLrSyFur3KFQi2v21ubI/KDMILCrHdwJT6xQvlHd1dKzwQDVX+WZiVVrjOatLLl5ir4pVMzINa2MH4CC+2FMEN2B/fnBtQ+s13xYmOCH3H72I= 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 DM6PR12MB4385.namprd12.prod.outlook.com (2603:10b6:5:2a6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.21; Fri, 6 Nov 2020 17:54:37 +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.032; Fri, 6 Nov 2020 17:54:37 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io CC: Brijesh Singh , Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH v4 09/11] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Fix erase blocks for SEV-ES Date: Fri, 6 Nov 2020 11:53:11 -0600 Message-ID: <309c5317a3107bd0e650be20731842a2e1d4b59a.1604685192.git.thomas.lendacky@amd.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN1PR12CA0082.namprd12.prod.outlook.com (2603:10b6:802:21::17) 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 SN1PR12CA0082.namprd12.prod.outlook.com (2603:10b6:802:21::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.21 via Frontend Transport; Fri, 6 Nov 2020 17:54:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b604f074-c262-488f-eedf-08d8827d06e4 X-MS-TrafficTypeDiagnostic: DM6PR12MB4385: 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: 1JVxO/ZTZe5LR5HbGKcK/yH7x/3B+fUceWFXdTIY33jBUf266KbTn6SAEH51R4WttDLIbFUUuIG+aelE8cl++WdK2ngk+Ynj0Y/PbLjXpbSHSrZ6jqZXYcpDOJgdGXotW0pz1ZoILbNmTozWOr4C449nXLSk89qgin8ltsj655v8VBvsS6qPG5DI4sh5LRR277UAFMth3zqVdhkl9hS7lWM9P8xR1wv+QuGlO0eIYsS3rTBAWK4jC/I6qnRkRRF+Mwh/htKkY0Yrw7MhvxqmcayNB8VO1CVcAPwZ63YtoWwHowNNOQlSyQHwLEU8AY6hJHGXwyKygGR5kiSFfeoBWjxeO3jLRM5PVLFdikSneW970LtY0Jgvb3UyLkcWxAJCIBQ8yHXLaaI9Veul79WDiK7Co1WwhH7bbDxmi0DGU/hPkry79xv1mhfTAL8s9X3aQRevwiV+n8rTxRAa+jgiBQ== 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)(366004)(376002)(136003)(346002)(396003)(39860400002)(316002)(966005)(86362001)(83380400001)(52116002)(7696005)(66946007)(5660300002)(6916009)(6666004)(8936002)(36756003)(8676002)(478600001)(66476007)(16526019)(26005)(2906002)(186003)(66556008)(6486002)(4326008)(54906003)(956004)(2616005)(213903007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: aDDFeMv7zf2apAqrH+3iWS2dIWq+v7w5dpMMZ62tJhvoiKS16KcE43Yux47DPVlCkY2GqBUFsmdUBWc9u8uhVSIwDyVGtmGjMXLjljEmnXkubfHmfmEnCZyOAyQSopGvt3hlj7xKc/jA5+FqXHa2OGOukn0pouScU9aRRhlFRzZX60Z5GfQx6DuNFhKqoi9BE4d3++G2AlqbuZ3grr+LDjP4bvHMKS2sl2MW/fYAVCXEPdHgDh5Qmjl4UwZ+X01KyFo9kwCsXWvDwiGJtEYZ/LIrABqZ7ROHxQTNTMUQOCMmdfoAUpVL10bGyE5pEkfptS1hEPth/XZrGHQBoACpzDqfX1GooIhTNrjvL0H30v7F7PnBpNaAbeIT3IvvFYZyIhU7IzFb1Qyha/yzOc/dfsNFYZIbnNOAZL6AdzcoYAU1WnoFQjfFTh+QSV2GK6f16/m+IBE3DxYkzCsUVkm3MnfidvZ7t0wieAd0WIF1zyMbUNJM77q6t+9xEsrSaXKAi1It3YRo/9dztPT+ThGsmxV16IxyQk0mwsbgZcI8EFz4qLf2lbhw53+bEOlHLCOikKNpyui/0+JM+3i7KXolz8XI57hp0JH+lLcHad15jfg/A6tT4QTcQwKpyKBNt6iF+tI2AAcnmuI8bjH9i0RWhQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b604f074-c262-488f-eedf-08d8827d06e4 X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2020 17:54:37.2943 (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: l4Uhr8QSXV3UrtBKxLdU5PSgvWW7FChtfi92uRBSP+rCCdWAtUGm43JU96FllJRrAqL4lqS5gspK7iy0qwzjDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4385 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