qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH qemu] memory: Fix IOMMU replay base address
@ 2016-02-22  6:09 Alexey Kardashevskiy
  2016-02-22  6:26 ` David Gibson
  0 siblings, 1 reply; 10+ messages in thread
From: Alexey Kardashevskiy @ 2016-02-22  6:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexey Kardashevskiy, David Gibson

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
pseries) with its default 32bit DMA window starting at 0 but it is if there is
another DMA window.

This adjusts the replaying address by mr->addr.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/memory.c b/memory.c
index 09041ed..377269b 100644
--- a/memory.c
+++ b/memory.c
@@ -1436,7 +1436,7 @@ void memory_region_iommu_replay(MemoryRegion *mr, Notifier *n,
     IOMMUTLBEntry iotlb;
 
     for (addr = 0; addr < memory_region_size(mr); addr += granularity) {
-        iotlb = mr->iommu_ops->translate(mr, addr, is_write);
+        iotlb = mr->iommu_ops->translate(mr, mr->addr + addr, is_write);
         if (iotlb.perm != IOMMU_NONE) {
             n->notify(n, &iotlb);
         }
-- 
2.5.0.rc3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-02-24  0:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-22  6:09 [Qemu-devel] [PATCH qemu] memory: Fix IOMMU replay base address Alexey Kardashevskiy
2016-02-22  6:26 ` David Gibson
2016-02-22 11:36   ` Alexey Kardashevskiy
2016-02-22 12:12     ` David Gibson
2016-02-23  2:11       ` Alexey Kardashevskiy
2016-02-23  6:20         ` David Gibson
2016-02-23  9:00           ` Alexey Kardashevskiy
2016-02-23  9:56             ` Paolo Bonzini
2016-02-23 11:25               ` David Gibson
2016-02-24  0:19               ` Alexey Kardashevskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).