From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A14D221D2DCF1 for ; Tue, 1 Aug 2017 13:40:31 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id DC1A7163854; Tue, 1 Aug 2017 20:42:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DC1A7163854 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-153.phx2.redhat.com [10.3.116.153]) by smtp.corp.redhat.com (Postfix) with ESMTP id A40276682E; Tue, 1 Aug 2017 20:42:39 +0000 (UTC) To: Brijesh Singh , edk2-devel@lists.01.org Cc: Tom Lendacky , Jordan Justen , Ard Biesheuvel References: <1501529474-20550-1-git-send-email-brijesh.singh@amd.com> <1501529474-20550-2-git-send-email-brijesh.singh@amd.com> From: Laszlo Ersek Message-ID: Date: Tue, 1 Aug 2017 22:42:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1501529474-20550-2-git-send-email-brijesh.singh@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 01 Aug 2017 20:42:41 +0000 (UTC) Subject: Re: [PATCH v1 1/4] OvmfPkg: IommuDxe: Do not clear C-bit in Allocate() and Free() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2017 20:40:31 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 07/31/17 21:31, Brijesh Singh wrote: > As per the discussion [1], the buffer allocated using IOMMU->AllocateBuffer() > need not result in a buffer that is immediately usable for the > DMA device operation. Client is required to call Map() unconditionally > with BusMasterCommonBuffer before performing the desired DMA bus > master operation. > > [1]https://lists.01.org/pipermail/edk2-devel/2017-July/012652.html > > Suggested-by: Laszlo Ersek > Contributed-under: TianoCore Contribution Agreement 1.0 > Cc: Jordan Justen > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Signed-off-by: Brijesh Singh > --- > OvmfPkg/IoMmuDxe/AmdSevIoMmu.c | 14 -------------- > 1 file changed, 14 deletions(-) > > diff --git a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c > index 9e78058b7242..cc3c979d4484 100644 > --- a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c > +++ b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c > @@ -333,12 +333,6 @@ IoMmuAllocateBuffer ( > ); > if (!EFI_ERROR (Status)) { > *HostAddress = (VOID *) (UINTN) PhysicalAddress; > - > - // > - // Clear memory encryption mask > - // > - Status = MemEncryptSevClearPageEncMask (0, PhysicalAddress, Pages, TRUE); > - ASSERT_EFI_ERROR(Status); > } > > DEBUG ((DEBUG_VERBOSE, "%a Address 0x%Lx Pages 0x%Lx\n", __FUNCTION__, PhysicalAddress, Pages)); > @@ -365,14 +359,6 @@ IoMmuFreeBuffer ( > IN VOID *HostAddress > ) > { > - EFI_STATUS Status; > - > - // > - // Set memory encryption mask > - // > - Status = MemEncryptSevSetPageEncMask (0, (EFI_PHYSICAL_ADDRESS)(UINTN)HostAddress, Pages, TRUE); > - ASSERT_EFI_ERROR(Status); > - > DEBUG ((DEBUG_VERBOSE, "%a Address 0x%Lx Pages 0x%Lx\n", __FUNCTION__, (UINTN)HostAddress, Pages)); > return gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress, Pages); > } > This looks good to me, but "IommuDxe" in the subject should be spelled "IoMmuDxe". With that change, Reviewed-by: Laszlo Ersek Thanks Laszlo