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.web09.11439.1620731913648356157 for ; Tue, 11 May 2021 04:18:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ESaZoETd; 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=1620731912; 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=aT7+EOMOYw76wHXGr9ifjTGvOP/L9SBqexUTidOAjsQ=; b=ESaZoETdvQrD/DpsW86oazWcadxvv8S0OWO+QHqvk2zXtpFRXtcvg26898ayCz1iBAiqs4 m/TaCrXAPJCS/q1H7k2KqofNcSsD00o+WM1bM9Tpf0IohKihooV1zJ2RPQA0F2ZQaNCX+G P/fkJVsPpdyhYJ3dnqMCvov2i4V7tcQ= 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-589-dEDcNCJROhqhMy-hMZGP5g-1; Tue, 11 May 2021 07:18:31 -0400 X-MC-Unique: dEDcNCJROhqhMy-hMZGP5g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 75066801B13; Tue, 11 May 2021 11:18:29 +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 7FB5967879; Tue, 11 May 2021 11:18:27 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 10/13] OvmfPkg/AmdSevDxe: use MemEncryptSevClearMmioPageEncMask() to clear EncMask 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-11-brijesh.singh@amd.com> From: "Laszlo Ersek" Message-ID: Date: Tue, 11 May 2021 13:18:26 +0200 MIME-Version: 1.0 In-Reply-To: <20210507203838.23706-11-brijesh.singh@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 and NonExistent 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/AmdSevDxe/AmdSevDxe.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c b/OvmfPkg/AmdSevDxe/AmdSevDxe.c > index 689bfb376d03..80831b81facf 100644 > --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c > +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c > @@ -53,11 +53,10 @@ AmdSevDxeEntryPoint ( > Desc = &AllDescMap[Index]; > if (Desc->GcdMemoryType == EfiGcdMemoryTypeMemoryMappedIo || > Desc->GcdMemoryType == EfiGcdMemoryTypeNonExistent) { > - Status = MemEncryptSevClearPageEncMask ( > + Status = MemEncryptSevClearMmioPageEncMask ( > 0, > Desc->BaseAddress, > - EFI_SIZE_TO_PAGES (Desc->Length), > - FALSE > + EFI_SIZE_TO_PAGES (Desc->Length) > ); > ASSERT_EFI_ERROR (Status); > } > @@ -73,11 +72,10 @@ AmdSevDxeEntryPoint ( > // the range. > // > if (PcdGet16 (PcdOvmfHostBridgePciDevId) == INTEL_Q35_MCH_DEVICE_ID) { > - Status = MemEncryptSevClearPageEncMask ( > + Status = MemEncryptSevClearMmioPageEncMask ( > 0, > FixedPcdGet64 (PcdPciExpressBaseAddress), > - EFI_SIZE_TO_PAGES (SIZE_256MB), > - FALSE > + EFI_SIZE_TO_PAGES (SIZE_256MB) > ); > > ASSERT_EFI_ERROR (Status); > Reviewed-by: Laszlo Ersek