Re: [Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-19 Thread Peter Xu
On Wed, Jan 18, 2017 at 03:49:44PM +0800, Peter Xu wrote: [...] > I was trying to invalidate the entire address space by sending a big > IOTLB notification to vfio-pci, which looks like: > > IOMMUTLBEntry entry = { > .target_as = _space_memory, > .iova = 0, >

Re: [Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-17 Thread Peter Xu
On Tue, Jan 17, 2017 at 08:46:04AM -0700, Alex Williamson wrote: > On Tue, 17 Jan 2017 22:00:00 +0800 > Peter Xu wrote: > > > On Mon, Jan 16, 2017 at 12:53:57PM -0700, Alex Williamson wrote: > > > On Fri, 13 Jan 2017 11:06:39 +0800 > > > Peter Xu wrote: > >

Re: [Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-17 Thread Alex Williamson
On Tue, 17 Jan 2017 22:00:00 +0800 Peter Xu wrote: > On Mon, Jan 16, 2017 at 12:53:57PM -0700, Alex Williamson wrote: > > On Fri, 13 Jan 2017 11:06:39 +0800 > > Peter Xu wrote: > > > > > This is preparation work to finally enabled dynamic switching

Re: [Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-17 Thread Peter Xu
On Mon, Jan 16, 2017 at 06:25:32PM +0200, Michael S. Tsirkin wrote: [...] > > > I think this does not give more readability :) May I was wrong, let leave > > > this for maintainer. > > > > > > Thanks :) > > > > Thanks for reviewing this series so fast! > > > > I have no strong opinion as

Re: [Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-17 Thread Peter Xu
On Mon, Jan 16, 2017 at 12:53:57PM -0700, Alex Williamson wrote: > On Fri, 13 Jan 2017 11:06:39 +0800 > Peter Xu wrote: > > > This is preparation work to finally enabled dynamic switching ON/OFF for > > VT-d protection. The old VT-d codes is using static IOMMU address space, >

Re: [Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-16 Thread Alex Williamson
On Fri, 13 Jan 2017 11:06:39 +0800 Peter Xu wrote: > This is preparation work to finally enabled dynamic switching ON/OFF for > VT-d protection. The old VT-d codes is using static IOMMU address space, > and that won't satisfy vfio-pci device listeners. > > Let me explain. >

Re: [Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-16 Thread Michael S. Tsirkin
On Mon, Jan 16, 2017 at 04:32:24PM +0800, Peter Xu wrote: > On Mon, Jan 16, 2017 at 04:25:35PM +0800, Jason Wang wrote: > > > > > > On 2017年01月16日 16:12, Peter Xu wrote: > > >On Mon, Jan 16, 2017 at 04:01:00PM +0800, Jason Wang wrote: > > >> > > >>On 2017年01月16日 15:50, Peter Xu wrote: > > >>>On

Re: [Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-16 Thread Peter Xu
On Mon, Jan 16, 2017 at 04:25:35PM +0800, Jason Wang wrote: > > > On 2017年01月16日 16:12, Peter Xu wrote: > >On Mon, Jan 16, 2017 at 04:01:00PM +0800, Jason Wang wrote: > >> > >>On 2017年01月16日 15:50, Peter Xu wrote: > >>>On Mon, Jan 16, 2017 at 02:20:31PM +0800, Jason Wang wrote: > >>> > >>>[...]

Re: [Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-16 Thread Jason Wang
On 2017年01月16日 16:12, Peter Xu wrote: On Mon, Jan 16, 2017 at 04:01:00PM +0800, Jason Wang wrote: On 2017年01月16日 15:50, Peter Xu wrote: On Mon, Jan 16, 2017 at 02:20:31PM +0800, Jason Wang wrote: [...] diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index fd75112..2596f11

Re: [Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-16 Thread Peter Xu
On Mon, Jan 16, 2017 at 04:01:00PM +0800, Jason Wang wrote: > > > On 2017年01月16日 15:50, Peter Xu wrote: > >On Mon, Jan 16, 2017 at 02:20:31PM +0800, Jason Wang wrote: > > > >[...] > > > >>>diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c > >>>index fd75112..2596f11 100644 > >>>---

Re: [Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-16 Thread Jason Wang
On 2017年01月16日 15:50, Peter Xu wrote: On Mon, Jan 16, 2017 at 02:20:31PM +0800, Jason Wang wrote: [...] diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index fd75112..2596f11 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -1343,9 +1343,49 @@ static void

Re: [Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-15 Thread Peter Xu
On Mon, Jan 16, 2017 at 02:20:31PM +0800, Jason Wang wrote: [...] > >diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c > >index fd75112..2596f11 100644 > >--- a/hw/i386/intel_iommu.c > >+++ b/hw/i386/intel_iommu.c > >@@ -1343,9 +1343,49 @@ static void

Re: [Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-15 Thread Jason Wang
On 2017年01月13日 11:06, Peter Xu wrote: This is preparation work to finally enabled dynamic switching ON/OFF for VT-d protection. The old VT-d codes is using static IOMMU address space, and that won't satisfy vfio-pci device listeners. Let me explain. vfio-pci devices depend on the memory

[Qemu-devel] [PATCH RFC v3 13/14] intel_iommu: allow dynamic switch of IOMMU region

2017-01-12 Thread Peter Xu
This is preparation work to finally enabled dynamic switching ON/OFF for VT-d protection. The old VT-d codes is using static IOMMU address space, and that won't satisfy vfio-pci device listeners. Let me explain. vfio-pci devices depend on the memory region listener and IOMMU replay mechanism to