Re: [Qemu-devel] [PATCH] vfio: avoid adding same iommu mr for notify

2016-11-20 Thread Peter Xu
On Thu, Nov 17, 2016 at 02:24:54PM +1100, David Gibson wrote: > On Mon, Nov 14, 2016 at 07:59:28PM -0500, Peter Xu wrote: > > When one IOMMU memory region is splitted into multiple memory sections, > > vfio will register multiple same notifiers to a vIOMMU for the same > > region. That's not sensib

Re: [Qemu-devel] [PATCH] vfio: avoid adding same iommu mr for notify

2016-11-16 Thread David Gibson
On Mon, Nov 14, 2016 at 07:59:28PM -0500, Peter Xu wrote: > When one IOMMU memory region is splitted into multiple memory sections, > vfio will register multiple same notifiers to a vIOMMU for the same > region. That's not sensible. What we need is to register one IOMMU > notifier for each IOMMU re

Re: [Qemu-devel] [PATCH] vfio: avoid adding same iommu mr for notify

2016-11-15 Thread Peter Xu
On Tue, Nov 15, 2016 at 04:11:57PM +1100, Alexey Kardashevskiy wrote: > On 15/11/16 11:59, Peter Xu wrote: > > When one IOMMU memory region is splitted into multiple memory sections, > > > Out of curiosity - when does this happen? My understanding: each PCI device will have one IOMMU region when

Re: [Qemu-devel] [PATCH] vfio: avoid adding same iommu mr for notify

2016-11-14 Thread Alexey Kardashevskiy
On 15/11/16 11:59, Peter Xu wrote: > When one IOMMU memory region is splitted into multiple memory sections, Out of curiosity - when does this happen? > vfio will register multiple same notifiers to a vIOMMU for the same > region. That's not sensible. What we need is to register one IOMMU > not

Re: [Qemu-devel] [PATCH] vfio: avoid adding same iommu mr for notify

2016-11-14 Thread Peter Xu
On Mon, Nov 14, 2016 at 07:59:28PM -0500, Peter Xu wrote: > When one IOMMU memory region is splitted into multiple memory sections, > vfio will register multiple same notifiers to a vIOMMU for the same > region. That's not sensible. What we need is to register one IOMMU > notifier for each IOMMU re

[Qemu-devel] [PATCH] vfio: avoid adding same iommu mr for notify

2016-11-14 Thread Peter Xu
When one IOMMU memory region is splitted into multiple memory sections, vfio will register multiple same notifiers to a vIOMMU for the same region. That's not sensible. What we need is to register one IOMMU notifier for each IOMMU region, not per section. Solution is simple - we traverse the conta