Re: [Qemu-devel] [PATCH qemu] memory: Fix IOMMU replay base address

2016-02-23 Thread Alexey Kardashevskiy
On 02/23/2016 08:56 PM, Paolo Bonzini wrote: On 23/02/2016 10:00, Alexey Kardashevskiy wrote: tce = tcet->table[addr >> tcet->page_shift]; -ret.iova = addr & page_mask; +ret.iova = (addr + iommu->addr) & page_mask; ret.translated_addr = tce & page_mask;

Re: [Qemu-devel] [PATCH qemu] memory: Fix IOMMU replay base address

2016-02-23 Thread David Gibson
On Tue, Feb 23, 2016 at 10:56:57AM +0100, Paolo Bonzini wrote: > > > On 23/02/2016 10:00, Alexey Kardashevskiy wrote: > >>> > >>> tce = tcet->table[addr >> tcet->page_shift]; > >>> -ret.iova = addr & page_mask; > >>> +ret.iova = (addr + iommu->addr) & page_mask; > >>>

Re: [Qemu-devel] [PATCH qemu] memory: Fix IOMMU replay base address

2016-02-23 Thread Paolo Bonzini
On 23/02/2016 10:00, Alexey Kardashevskiy wrote: >>> >>> tce = tcet->table[addr >> tcet->page_shift]; >>> -ret.iova = addr & page_mask; >>> +ret.iova = (addr + iommu->addr) & page_mask; >>> ret.translated_addr = tce & page_mask; >> >> I wondered about that chan

Re: [Qemu-devel] [PATCH qemu] memory: Fix IOMMU replay base address

2016-02-23 Thread Alexey Kardashevskiy
On 02/23/2016 05:20 PM, David Gibson wrote: On Tue, Feb 23, 2016 at 01:11:35PM +1100, Alexey Kardashevskiy wrote: On 02/22/2016 11:12 PM, David Gibson wrote: On Mon, Feb 22, 2016 at 10:36:19PM +1100, Alexey Kardashevskiy wrote: On 02/22/2016 05:26 PM, David Gibson wrote: On Mon, Feb 22, 2016

Re: [Qemu-devel] [PATCH qemu] memory: Fix IOMMU replay base address

2016-02-22 Thread David Gibson
On Tue, Feb 23, 2016 at 01:11:35PM +1100, Alexey Kardashevskiy wrote: > On 02/22/2016 11:12 PM, David Gibson wrote: > >On Mon, Feb 22, 2016 at 10:36:19PM +1100, Alexey Kardashevskiy wrote: > >>On 02/22/2016 05:26 PM, David Gibson wrote: > >>>On Mon, Feb 22, 2016 at 05:09:39PM +1100, Alexey Kardashe

Re: [Qemu-devel] [PATCH qemu] memory: Fix IOMMU replay base address

2016-02-22 Thread Alexey Kardashevskiy
On 02/22/2016 11:12 PM, David Gibson wrote: On Mon, Feb 22, 2016 at 10:36:19PM +1100, Alexey Kardashevskiy wrote: On 02/22/2016 05:26 PM, David Gibson wrote: On Mon, Feb 22, 2016 at 05:09:39PM +1100, Alexey Kardashevskiy wrote: Since a788f227 "memory: Allow replay of IOMMU mapping notification

Re: [Qemu-devel] [PATCH qemu] memory: Fix IOMMU replay base address

2016-02-22 Thread David Gibson
On Mon, Feb 22, 2016 at 10:36:19PM +1100, Alexey Kardashevskiy wrote: > On 02/22/2016 05:26 PM, David Gibson wrote: > >On Mon, Feb 22, 2016 at 05:09:39PM +1100, Alexey Kardashevskiy wrote: > >>Since a788f227 "memory: Allow replay of IOMMU mapping notifications" > >>when new VFIO listener is added,

Re: [Qemu-devel] [PATCH qemu] memory: Fix IOMMU replay base address

2016-02-22 Thread Alexey Kardashevskiy
On 02/22/2016 05:26 PM, David Gibson wrote: On Mon, Feb 22, 2016 at 05:09:39PM +1100, Alexey Kardashevskiy wrote: Since a788f227 "memory: Allow replay of IOMMU mapping notifications" when new VFIO listener is added, all existing IOMMU mappings are replayed. However there is a problem that the ba

Re: [Qemu-devel] [PATCH qemu] memory: Fix IOMMU replay base address

2016-02-21 Thread David Gibson
On Mon, Feb 22, 2016 at 05:09:39PM +1100, Alexey Kardashevskiy wrote: > Since a788f227 "memory: Allow replay of IOMMU mapping notifications" > when new VFIO listener is added, all existing IOMMU mappings are replayed. > However there is a problem that the base address of an IOMMU memory region > (I

[Qemu-devel] [PATCH qemu] memory: Fix IOMMU replay base address

2016-02-21 Thread Alexey Kardashevskiy
Since a788f227 "memory: Allow replay of IOMMU mapping notifications" when new VFIO listener is added, all existing IOMMU mappings are replayed. However there is a problem that the base address of an IOMMU memory region (IOMMU MR) is ignored which is not a problem for the existing user (which is pse