Received: from eggs.gnu.org ([2001:4830:134:3::10]:60394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cEJ4u-0000Ph-Ac for qemu-devel@nongnu.org; Tue, 06 Dec 2016 11:58:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cEJ4r-0004ta-1s for qemu-devel@nongnu.org; Tue, 06 Dec 2016 11:58:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54410) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cEJ4q-0004tO-SI for qemu-devel@nongnu.org; Tue, 06 Dec 2016 11:58:48 -0500 Date: Tue, 6 Dec 2016 09:58:46 -0700 From: Alex Williamson Message-ID: <20161206095846.36d994f3@t450s.home> In-Reply-To: <20161206105914.GB3469@pxdev.xzpeter.org> References: <1480348315-13332-1-git-send-email-bd.aviv@gmail.com> <8188dd5e-2c71-dbd0-9a1a-9c8af6f74b96@intel.com> <20161202065214.GF21601@pxdev.xzpeter.org> <088c2afd-575e-99af-1686-023c116352ab@intel.com> <20161206065155.GB4344@pxdev.xzpeter.org> <6d37d046-8e5a-7662-baa6-445d3985fde7@intel.com> <20161206072228.GC4344@pxdev.xzpeter.org> <20161206105914.GB3469@pxdev.xzpeter.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu Cc: Lan Tianyu , "Aviv B.D" , qemu-devel@nongnu.org, "Michael S. Tsirkin" , Jan Kiszka , Jason Wang , "Liu, Yi L" , "Wu, Fengguang" On Tue, 6 Dec 2016 18:59:14 +0800 Peter Xu wrote: > On Tue, Dec 06, 2016 at 04:27:39PM +0800, Lan Tianyu wrote: > > [...] > > > > > > >> User space driver(E.G DPDK) also can enable/disable > > >> IOVA for device dynamically. > > > > > > Could you provide more detailed (or any pointer) on how to do that? I > > > did try to find it myself, I see an VFIO_IOMMU_ENABLE ioctl, but looks > > > like it is for ppc only. > > > > No, I just give an example that user space may do that but no more > > research. But since Qemu already can enable device's IOVA, other user > > application also should can do that with the same VFIO interface, right? > > AFAIU we can't do that at least on x86. We can use vfio interface to > bind group into container, but we should not be able to dynamically > disable IOMMU protection. IIUC That needs to taint the kernel. > > The only way I know is that we probe vfio-pci with no-iommu mode, in > that case, we disabled IOMMU, but we can never dynamically enable it > as well. > > Please correct me if I am wrong. A vfio user such as QEMU enabling or disabling translation in the vIOMMU is "simply" assigning the vfio container to the system AddressSpace (as we do w/o vIOMMU) or the device specific, IOMMU domain, AddressSpace. The device must be protected by the pIOMMU domain (container) at all times. Thanks, Alex