From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web09.11452.1620731983567927237 for ; Tue, 11 May 2021 04:19:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fzUI6EQV; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620731982; 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=toW2Fof4sQmyrY8veObWQi8QupXG+FH34c5IkEeqX04=; b=fzUI6EQVwaagVBFZXf30J3RLAirT0sQFv/+u9m2alQjwQc+1j9QCxPywDN1qmMrXXb/IJx ebgfjSl6hBx1c5sXMa2ONFKbQ4CrvPZQaMt5X44ukk+aUUdJbK0J/PFjf7cFFIcInC3t4O I74h0+D+f9SHbXMkj5HFjtNbGwEf9tU= 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-20-n4L_K60TMJezXHpcB2LJDg-1; Tue, 11 May 2021 07:19:40 -0400 X-MC-Unique: n4L_K60TMJezXHpcB2LJDg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D665D1006C86; Tue, 11 May 2021 11:19:38 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-233.ams2.redhat.com [10.36.112.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 12D0E5D9D7; Tue, 11 May 2021 11:19:36 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 11/13] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: use Mmio helper to clear enc mask To: devel@edk2.groups.io, brijesh.singh@amd.com Cc: James Bottomley , Min Xu , Jiewen Yao , Tom Lendacky , Jordan Justen , Ard Biesheuvel , Erdem Aktas References: <20210507203838.23706-1-brijesh.singh@amd.com> <20210507203838.23706-12-brijesh.singh@amd.com> From: "Laszlo Ersek" Message-ID: Date: Tue, 11 May 2021 13:19:36 +0200 MIME-Version: 1.0 In-Reply-To: <20210507203838.23706-12-brijesh.singh@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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 05/07/21 22:38, Brijesh Singh wrote: > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275 > > Use the MemEncryptSevClearMmioPageEncMask() to clear memory encryption mask > for the Mmio address range. > > Cc: James Bottomley > Cc: Min Xu > Cc: Jiewen Yao > Cc: Tom Lendacky > Cc: Jordan Justen > Cc: Ard Biesheuvel > Cc: Laszlo Ersek > Cc: Erdem Aktas > Signed-off-by: Brijesh Singh > --- > OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c | 5 ++--- > OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashSmm.c | 5 ++--- > 2 files changed, 4 insertions(+), 6 deletions(-) > > diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c > index 1f285e008372..ab40087a8408 100644 > --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c > +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c > @@ -205,11 +205,10 @@ MarkIoMemoryRangeForRuntimeAccess ( > // memory range. > // > if (MemEncryptSevIsEnabled ()) { > - Status = MemEncryptSevClearPageEncMask ( > + Status = MemEncryptSevClearMmioPageEncMask ( > 0, > BaseAddress, > - EFI_SIZE_TO_PAGES (Length), > - FALSE > + EFI_SIZE_TO_PAGES (Length) > ); > ASSERT_EFI_ERROR (Status); > } > diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashSmm.c b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashSmm.c > index 7eb80bfeffae..ea75b489c7fd 100644 > --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashSmm.c > +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashSmm.c > @@ -38,11 +38,10 @@ QemuFlashBeforeProbe ( > // C-bit on flash ranges from SMM page table. > // > > - Status = MemEncryptSevClearPageEncMask ( > + Status = MemEncryptSevClearMmioPageEncMask ( > 0, > BaseAddress, > - EFI_SIZE_TO_PAGES (FdBlockSize * FdBlockCount), > - FALSE > + EFI_SIZE_TO_PAGES (FdBlockSize * FdBlockCount) > ); > ASSERT_EFI_ERROR (Status); > } > Reviewed-by: Laszlo Ersek