From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.8362.1602754078195755278 for ; Thu, 15 Oct 2020 02:27:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dUjk9jYX; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602754077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X/OwhVdhAXU1gnJTa5TBr/TuWVG3ky/8ZgAfmKozJ4Y=; b=dUjk9jYXXqkPd3ManaXRLVtAsCYiVXWPLeissS1dILQYLkSAGfftjDCSrRXWZhyhSYAkLh 1kzItqF0NAFH6Ec/uz4YM1PneK2VNXtGS2Zu+fMCCwNknA9N7cLKEWsPmvyOnUZWfQbevL 4MRqdjithB9SOaxH8CwOgOnCdGPQdis= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-579-PuHHIQ90NAy24J0otrrzFA-1; Thu, 15 Oct 2020 05:27:53 -0400 X-MC-Unique: PuHHIQ90NAy24J0otrrzFA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2C7E864092; Thu, 15 Oct 2020 09:27:52 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-119.ams2.redhat.com [10.36.113.119]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9D2419C4F; Thu, 15 Oct 2020 09:27:50 +0000 (UTC) Subject: Re: [PATCH 7/9] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Fix erase blocks for SEV-ES To: Tom Lendacky , devel@edk2.groups.io Cc: Brijesh Singh , Jordan Justen , Ard Biesheuvel References: <9d802710d0a2de6032bf3d645d72a8f90f12a235.1602346027.git.thomas.lendacky@amd.com> From: "Laszlo Ersek" Message-ID: <01a59db5-d6cc-a162-b375-93df9cacadb0@redhat.com> Date: Thu, 15 Oct 2020 11:27:49 +0200 MIME-Version: 1.0 In-Reply-To: <9d802710d0a2de6032bf3d645d72a8f90f12a235.1602346027.git.thomas.lendacky@amd.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 10/10/20 18:07, Tom Lendacky wrote: > From: Tom Lendacky > > 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: 437eb3f7a8db ("OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Bypass flash detection with SEV-ES") > Cc: Jordan Justen > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > 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/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c > index 0d29bf701aca..d19997032ec9 100644 > --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c > +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c > @@ -232,8 +232,8 @@ QemuFlashEraseBlock ( > } > > Ptr = QemuFlashPtr (Lba, 0); > - *Ptr = BLOCK_ERASE_CMD; > - *Ptr = BLOCK_ERASE_CONFIRM_CMD; > + QemuFlashPtrWrite (Ptr, BLOCK_ERASE_CMD); > + QemuFlashPtrWrite (Ptr, BLOCK_ERASE_CONFIRM_CMD); > return EFI_SUCCESS; > } > > Reviewed-by: Laszlo Ersek Sorry for not noticing this during review. Thanks Laszlo