All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH qemu] vfio: Print address space address when cannot map MMIO for DMA
@ 2018-03-22  8:18 Alexey Kardashevskiy
  2018-03-28 21:03 ` Auger Eric
  0 siblings, 1 reply; 10+ messages in thread
From: Alexey Kardashevskiy @ 2018-03-22  8:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexey Kardashevskiy, Alex Williamson, Auger Eric

The 567b5b309abe ("vfio/pci: Relax DMA map errors for MMIO regions") added
an error message if a passed memory section address or size is not aligned
to the minimal IOMMU page size. However although it checks
offset_within_address_space for the alignment, offset_within_region is
printed instead which makes it harder to find out what device caused
the message so this replaces offset_within_region with
offset_within_address_space.

While we are here, this replaces '..' with 'size=' (as the second number
is a size, not an end offset) and adds a memory region name.

Fixes: 567b5b309abe "vfio/pci: Relax DMA map errors for MMIO regions"
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---

Message on slightly hacked QEMU (iommu pagesize=8K) looks now like this:

qemu-system-x86_64: Region "0000:00:1a.0 BAR 0 mmaps[0]" 0xfebc0000 size=0x1000 is not aligned to 0x2000 and cannot be mapped for DMA
---
 hw/vfio/common.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 5e84716..e2db596 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -548,10 +548,11 @@ static void vfio_listener_region_add(MemoryListener *listener,
         hwaddr pgmask = (1ULL << ctz64(hostwin->iova_pgsizes)) - 1;
 
         if ((iova & pgmask) || (int128_get64(llsize) & pgmask)) {
-            error_report("Region 0x%"HWADDR_PRIx"..0x%"HWADDR_PRIx
+            error_report("Region \"%s\" 0x%"HWADDR_PRIx" size=0x%"HWADDR_PRIx
                          " is not aligned to 0x%"HWADDR_PRIx
                          " and cannot be mapped for DMA",
-                         section->offset_within_region,
+                         memory_region_name(section->mr),
+                         section->offset_within_address_space,
                          int128_getlo(section->size),
                          pgmask + 1);
             return;
-- 
2.11.0

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

end of thread, other threads:[~2018-04-03  7:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22  8:18 [Qemu-devel] [PATCH qemu] vfio: Print address space address when cannot map MMIO for DMA Alexey Kardashevskiy
2018-03-28 21:03 ` Auger Eric
2018-03-28 22:13   ` Alex Williamson
2018-03-29 14:42     ` Auger Eric
2018-03-29 16:03       ` Alex Williamson
2018-03-29  1:55   ` Alexey Kardashevskiy
2018-03-29 10:14     ` Auger Eric
2018-04-03  3:30       ` Alexey Kardashevskiy
2018-04-03  7:06         ` Auger Eric
2018-03-29 16:09     ` Alex Williamson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.