From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeEYM-0004gy-P5 for qemu-devel@nongnu.org; Thu, 10 Mar 2016 23:19:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aeEYI-0004KZ-P6 for qemu-devel@nongnu.org; Thu, 10 Mar 2016 23:19:54 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:11417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeEYI-0004KG-JQ for qemu-devel@nongnu.org; Thu, 10 Mar 2016 23:19:50 -0500 Date: Thu, 10 Mar 2016 20:19:47 -0800 From: Neo Jia Message-ID: <20160311041947.GA12035@nvidia.com> References: <1456244666-25369-1-git-send-email-kwankhede@nvidia.com> <1456244666-25369-3-git-send-email-kwankhede@nvidia.com> <56D6A68A.50004@intel.com> <20160304070025.GA32070@nvidia.com> <20160308003139.GA22106@nvidia.com> <56E0E592.20008@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <56E0E592.20008@intel.com> Subject: Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jike Song Cc: shuai.ruan@intel.com, kevin.tian@intel.com, Alex Williamson , kvm@vger.kernel.org, qemu-devel@nongnu.org, Kirti Wankhede , kraxel@redhat.com, pbonzini@redhat.com, zhiyuan.lv@intel.com On Thu, Mar 10, 2016 at 11:10:10AM +0800, Jike Song wrote: > > >> Is it supposed to be the caller who should set > >> up IOMMU by DMA api such as dma_map_page(), after calling > >> vgpu_dma_do_translate()? > >> > > > > Don't think you need to call dma_map_page here. Once you have the pfn available > > to your GPU kernel driver, you can just go ahead to setup the mapping as you > > normally do such as calling pci_map_sg and its friends. > > > > Technically it's definitely OK to call DMA API from the caller rather than here, > however personally I think it is a bit counter-intuitive: IOMMU page tables > should be constructed within the VFIO IOMMU driver. > Hi Jike, For vGPU, what we have is just a virtual device and a fake IOMMU group, therefore the actual interaction with the real GPU should be managed by the GPU vendor driver. With the default TYPE1 IOMMU, it works with the vfio-pci as it owns the device. Thanks, Neo > -- > Thanks, > Jike >