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 0537321A18AA9 for ; Mon, 29 May 2017 02:28:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A2DFC057FA7; Mon, 29 May 2017 09:28:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5A2DFC057FA7 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5A2DFC057FA7 Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-94.phx2.redhat.com [10.3.116.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id C899118138; Mon, 29 May 2017 09:28:55 +0000 (UTC) To: Brijesh Singh , edk2-devel@lists.01.org Cc: Thomas.Lendacky@amd.com, Jordan Justen , Jiewen Yao , leo.duran@amd.com References: <1495809845-32472-1-git-send-email-brijesh.singh@amd.com> <1495809845-32472-10-git-send-email-brijesh.singh@amd.com> From: Laszlo Ersek Message-ID: Date: Mon, 29 May 2017 11:28:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <1495809845-32472-10-git-send-email-brijesh.singh@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 29 May 2017 09:28:57 +0000 (UTC) Subject: Re: [PATCH v6 09/17] OvmfPkg: Add IoMmuDxe driver 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: Mon, 29 May 2017 09:28:00 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 05/26/17 16:43, Brijesh Singh wrote: > The IOMMU protocol driver provides capabilities to set a DMA access > attribute and methods to allocate, free, map and unmap the DMA memory > for the PCI Bus devices. > > Due to security reasons all DMA operations inside the SEV guest must > be performed on shared (i.e unencrypted) pages. The IOMMU protocol > driver for the SEV guest uses a bounce buffer to map guest DMA buffer > to shared pages inorder to provide the support for DMA operations inside > SEV guest. > > IoMmuDxe driver looks for SEV capabilities, if present then it installs > the real IOMMU protocol otherwise it installs placeholder protocol. > Currently, PciHostBridgeDxe and QemuFWCfgLib need to know the existance > of IOMMU protocol. The modules needing to know the existance of IOMMU > support should add > > gEdkiiIoMmuProtocolGuid OR gIoMmuAbsentProtocolGuid > > in their depex to ensure that platform IOMMU detection has been performed. > > > Cc: Jordan Justen > Cc: Laszlo Ersek > Cc: Leo Duran > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.0 > Suggested-by: Jiewen Yao > Signed-off-by: Brijesh Singh > Reviewed-by: Jiewen Yao > --- > OvmfPkg/OvmfPkgIa32.dsc | 1 + > OvmfPkg/OvmfPkgIa32X64.dsc | 1 + > OvmfPkg/OvmfPkgX64.dsc | 1 + > OvmfPkg/OvmfPkgIa32.fdf | 1 + > OvmfPkg/OvmfPkgIa32X64.fdf | 1 + > OvmfPkg/OvmfPkgX64.fdf | 1 + > OvmfPkg/IoMmuDxe/IoMmuDxe.inf | 49 +++ > OvmfPkg/IoMmuDxe/AmdSevIoMmu.h | 43 ++ > OvmfPkg/IoMmuDxe/AmdSevIoMmu.c | 459 ++++++++++++++++++++ > OvmfPkg/IoMmuDxe/IoMmuDxe.c | 53 +++ > 10 files changed, 610 insertions(+) Looks good to me. Acked-by: Laszlo Ersek