Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-07 Thread Lan Tianyu
On 2016年12月08日 10:39, Peter Xu wrote: > Btw, do you have time to help review my RFC series for "vt-d replay"? > :) I'd like to receive any further review comments besides the issues > mentioned above since IMHO they can be seperated from current series, > I have noted them down in my pending list.

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-07 Thread Peter Xu
On Wed, Dec 07, 2016 at 10:04:57PM +0800, Lan Tianyu wrote: [...] > >Even if the context entry is cleared and invalidated, IMHO it does not > >mean that we should be using GPA address space, nor do we need to put > >it into guest physical address space. Instead, it simply means this > >device can

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-07 Thread Lan Tianyu
On 2016年12月07日 14:43, Peter Xu wrote: On Wed, Dec 07, 2016 at 02:09:16PM +0800, Lan Tianyu wrote: On 2016年12月06日 18:59, 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

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-06 Thread Peter Xu
On Wed, Dec 07, 2016 at 02:09:16PM +0800, Lan Tianyu wrote: > On 2016年12月06日 18:59, 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. > >>> > >>> Co

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-06 Thread Lan Tianyu
On 2016年12月06日 18:59, 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

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-06 Thread Alex Williamson
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

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-06 Thread Peter Xu
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_ENABL

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-06 Thread Lan Tianyu
On 2016年12月06日 15:22, Peter Xu wrote: > On Tue, Dec 06, 2016 at 03:06:20PM +0800, Lan Tianyu wrote: >> On 2016年12月06日 14:51, Peter Xu wrote: >>> On Tue, Dec 06, 2016 at 02:30:24PM +0800, Lan Tianyu wrote: >>> >>> [...] >>> >> 2. How to restore GPA->HPA mapping when IOVA is disabled by guest. >>

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-05 Thread Peter Xu
On Tue, Dec 06, 2016 at 03:06:20PM +0800, Lan Tianyu wrote: > On 2016年12月06日 14:51, Peter Xu wrote: > > On Tue, Dec 06, 2016 at 02:30:24PM +0800, Lan Tianyu wrote: > > > > [...] > > > 2. How to restore GPA->HPA mapping when IOVA is disabled by guest. > When guest enables IOVA for device

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-05 Thread Lan Tianyu
On 2016年12月06日 14:51, Peter Xu wrote: > On Tue, Dec 06, 2016 at 02:30:24PM +0800, Lan Tianyu wrote: > > [...] > 2. How to restore GPA->HPA mapping when IOVA is disabled by guest. When guest enables IOVA for device, vIOMMU will invalidate all previous GPA->HPA mapping and update IOV

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-05 Thread Peter Xu
On Tue, Dec 06, 2016 at 02:30:24PM +0800, Lan Tianyu wrote: [...] > >> 2. How to restore GPA->HPA mapping when IOVA is disabled by guest. > >> When guest enables IOVA for device, vIOMMU will invalidate all previous > >> GPA->HPA mapping and update IOVA->HPA mapping to pIOMMU via iommu > >> notifi

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-05 Thread Lan Tianyu
On 2016年12月02日 14:52, Peter Xu wrote: > On Thu, Dec 01, 2016 at 02:44:14PM +0800, Lan Tianyu wrote: > > [...] > >> Hi: >> I think there are still other gaps to enable passthough device with >> vIOMMU's DMA translation support. >> >> 1. Since this patchset is to shadow guest IO page table to >> pI

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-05 Thread Peter Xu
On Fri, Dec 02, 2016 at 10:30:34AM -0700, Alex Williamson wrote: [...] > On the host though, I'd expect we still have separate IOMMU domains, > one for each device and we do DMA_{UN}MAP ioctls separately per > container. Thanks, I have a RFC version of replay implementation that used the way to

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-05 Thread Lan, Tianyu
On 12/3/2016 1:30 AM, Alex Williamson wrote: > On Fri, 2 Dec 2016 14:08:59 +0800 > Peter Xu wrote: > >> On Thu, Dec 01, 2016 at 04:27:52PM +0800, Lan Tianyu wrote: >>> On 2016年11月30日 17:23, Peter Xu wrote: On Mon, Nov 28, 2016 at 05:51:50PM +0200, Aviv B.D wrote: > * intel_iommu's replay

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-02 Thread Alex Williamson
On Fri, 2 Dec 2016 14:08:59 +0800 Peter Xu wrote: > On Thu, Dec 01, 2016 at 04:27:52PM +0800, Lan Tianyu wrote: > > On 2016年11月30日 17:23, Peter Xu wrote: > > > On Mon, Nov 28, 2016 at 05:51:50PM +0200, Aviv B.D wrote: > > >> * intel_iommu's replay op is not implemented yet (May come in differ

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-02 Thread Alex Williamson
On Fri, 2 Dec 2016 13:59:25 +0800 Peter Xu wrote: > On Thu, Dec 01, 2016 at 04:21:38AM +, Tian, Kevin wrote: > > > From: Peter Xu > > > Sent: Wednesday, November 30, 2016 5:24 PM > > > > > > On Mon, Nov 28, 2016 at 05:51:50PM +0200, Aviv B.D wrote: > > > > * intel_iommu's replay op is not

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-01 Thread Peter Xu
On Fri, Dec 02, 2016 at 06:23:52AM +, Tian, Kevin wrote: [...] > > IIUC the vfio container is created in: > > > > vfio_realize > > vfio_get_group > > vfio_connect_container > > > > Along the way (for vfio_get_group()), we have: > > > > group = vfio_get_group(groupid, pci_device_iom

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-01 Thread Peter Xu
On Thu, Dec 01, 2016 at 02:44:14PM +0800, Lan Tianyu wrote: [...] > Hi: > I think there are still other gaps to enable passthough device with > vIOMMU's DMA translation support. > > 1. Since this patchset is to shadow guest IO page table to > pIOMMU(physical IOMMU) vfio_dma_map/umap(), there wil

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-01 Thread Tian, Kevin
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Friday, December 02, 2016 1:59 PM > > On Thu, Dec 01, 2016 at 04:21:38AM +, Tian, Kevin wrote: > > > From: Peter Xu > > > Sent: Wednesday, November 30, 2016 5:24 PM > > > > > > On Mon, Nov 28, 2016 at 05:51:50PM +0200, Aviv B.D wrote: > > > >

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-01 Thread Peter Xu
On Thu, Dec 01, 2016 at 08:42:04AM -0700, Alex Williamson wrote: > On Wed, 30 Nov 2016 17:23:59 +0800 > Peter Xu wrote: > > > On Mon, Nov 28, 2016 at 05:51:50PM +0200, Aviv B.D wrote: > > > * intel_iommu's replay op is not implemented yet (May come in different > > > patch > > > set). > > >

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-01 Thread Peter Xu
On Thu, Dec 01, 2016 at 04:27:52PM +0800, Lan Tianyu wrote: > On 2016年11月30日 17:23, Peter Xu wrote: > > On Mon, Nov 28, 2016 at 05:51:50PM +0200, Aviv B.D wrote: > >> * intel_iommu's replay op is not implemented yet (May come in different > >> patch > >> set). > >> The replay function is requ

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-01 Thread Peter Xu
On Thu, Dec 01, 2016 at 04:21:38AM +, Tian, Kevin wrote: > > From: Peter Xu > > Sent: Wednesday, November 30, 2016 5:24 PM > > > > On Mon, Nov 28, 2016 at 05:51:50PM +0200, Aviv B.D wrote: > > > * intel_iommu's replay op is not implemented yet (May come in different > > > patch > > > set).

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-01 Thread Alex Williamson
On Wed, 30 Nov 2016 17:23:59 +0800 Peter Xu wrote: > On Mon, Nov 28, 2016 at 05:51:50PM +0200, Aviv B.D wrote: > > * intel_iommu's replay op is not implemented yet (May come in different > > patch > > set). > > The replay function is required for hotplug vfio device and to move > > devices

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-01 Thread Lan Tianyu
On 2016年11月30日 17:23, Peter Xu wrote: > On Mon, Nov 28, 2016 at 05:51:50PM +0200, Aviv B.D wrote: >> * intel_iommu's replay op is not implemented yet (May come in different >> patch >> set). >> The replay function is required for hotplug vfio device and to move >> devices >> between exist

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-12-01 Thread Lan Tianyu
On 2016年12月01日 12:21, Tian, Kevin wrote: >> I am thinking about this replay thing recently and now I start to >> > doubt whether the whole vt-d vIOMMU framework suites this... >> > >> > Generally speaking, current work is throwing away the IOMMU "domain" >> > layer here. We maintain the mapping on

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-11-30 Thread Lan Tianyu
On 2016年11月28日 23:51, Aviv B.D wrote: > From: "Aviv Ben-David" > > * Advertize Cache Mode capability in iommu cap register. > This capability is controlled by "cache-mode" property of intel-iommu > device. > To enable this option call QEMU with "-device intel-iommu,cache-mode=true". > > * On

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-11-30 Thread Tian, Kevin
> From: Peter Xu > Sent: Wednesday, November 30, 2016 5:24 PM > > On Mon, Nov 28, 2016 at 05:51:50PM +0200, Aviv B.D wrote: > > * intel_iommu's replay op is not implemented yet (May come in different > > patch > > set). > > The replay function is required for hotplug vfio device and to move

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-11-30 Thread Tian, Kevin
> From: Aviv B.D > Sent: Monday, November 28, 2016 11:52 PM > > From: "Aviv Ben-David" > > * Advertize Cache Mode capability in iommu cap register. > This capability is controlled by "cache-mode" property of intel-iommu > device. > To enable this option call QEMU with "-device intel-iommu,c

Re: [Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-11-30 Thread Peter Xu
On Mon, Nov 28, 2016 at 05:51:50PM +0200, Aviv B.D wrote: > * intel_iommu's replay op is not implemented yet (May come in different patch > set). > The replay function is required for hotplug vfio device and to move devices > between existing domains. I am thinking about this replay thing

[Qemu-devel] [PATCH v7 0/5] IOMMU: intel_iommu support map and unmap notifications

2016-11-28 Thread Aviv B.D
From: "Aviv Ben-David" * Advertize Cache Mode capability in iommu cap register. This capability is controlled by "cache-mode" property of intel-iommu device. To enable this option call QEMU with "-device intel-iommu,cache-mode=true". * On page cache invalidation in intel vIOMMU, check if th