* [Qemu-devel] [PULL for-2.12 0/1] vfio fix
@ 2018-04-05 18:41 Alex Williamson
2018-04-05 18:41 ` [Qemu-devel] [PULL for-2.12 1/1] vfio: Use a trace point when a RAM section cannot be DMA mapped Alex Williamson
2018-04-06 12:40 ` [Qemu-devel] [PULL for-2.12 0/1] vfio fix Peter Maydell
0 siblings, 2 replies; 3+ messages in thread
From: Alex Williamson @ 2018-04-05 18:41 UTC (permalink / raw)
To: qemu-devel
The following changes since commit 0e87fdc966d05f4e5ad868034fcd8ee2a08ca62d:
Update version for v2.12.0-rc2 release (2018-04-04 20:37:20 +0100)
are available in the Git repository at:
git://github.com/awilliam/qemu-vfio.git tags/vfio-fixes-20180405.0
for you to fetch changes up to 5c08600547c059e3fd072995f9f367cdaf3c7d9d:
vfio: Use a trace point when a RAM section cannot be DMA mapped (2018-04-05 10:48:52 -0600)
----------------------------------------------------------------
VFIO fixes 2018-04-05
- Convert over zealous error_report to trace point and make more
meaningful (Eric Auger)
----------------------------------------------------------------
Eric Auger (1):
vfio: Use a trace point when a RAM section cannot be DMA mapped
hw/vfio/common.c | 11 +++++------
hw/vfio/trace-events | 1 +
2 files changed, 6 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PULL for-2.12 1/1] vfio: Use a trace point when a RAM section cannot be DMA mapped
2018-04-05 18:41 [Qemu-devel] [PULL for-2.12 0/1] vfio fix Alex Williamson
@ 2018-04-05 18:41 ` Alex Williamson
2018-04-06 12:40 ` [Qemu-devel] [PULL for-2.12 0/1] vfio fix Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2018-04-05 18:41 UTC (permalink / raw)
To: qemu-devel
From: Eric Auger <eric.auger@redhat.com>
Commit 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 page size and thus cannot be DMA mapped.
This patch fixes the trace by printing the region name and the
memory region section offset within the address space (instead of
offset_within_region).
We also turn the error_report into a trace event. Indeed, In some
cases, the traces can be confusing to non expert end-users and
let think the use case does not work (whereas it works as before).
This is the case where a BAR is successively mapped at different
GPAs and its sections are not compatible with dma map. The listener
is called several times and traces are issued for each intermediate
mapping. The end-user cannot easily match those GPAs against the
final GPA output by lscpi. So let's keep those information to
informed users. In mid term, the plan is to advise the user about
BAR relocation relevance.
Fixes: 567b5b309abe ("vfio/pci: Relax DMA map errors for MMIO regions")
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
hw/vfio/common.c | 11 +++++------
hw/vfio/trace-events | 1 +
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 5e8471621800..07ffa0ba1062 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -548,12 +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
- " is not aligned to 0x%"HWADDR_PRIx
- " and cannot be mapped for DMA",
- section->offset_within_region,
- int128_getlo(section->size),
- pgmask + 1);
+ trace_vfio_listener_region_add_no_dma_map(
+ memory_region_name(section->mr),
+ section->offset_within_address_space,
+ int128_getlo(section->size),
+ pgmask + 1);
return;
}
}
diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events
index 79f63a2ff6f7..20109cb7581f 100644
--- a/hw/vfio/trace-events
+++ b/hw/vfio/trace-events
@@ -90,6 +90,7 @@ vfio_iommu_map_notify(const char *op, uint64_t iova_start, uint64_t iova_end) "i
vfio_listener_region_add_skip(uint64_t start, uint64_t end) "SKIPPING region_add 0x%"PRIx64" - 0x%"PRIx64
vfio_listener_region_add_iommu(uint64_t start, uint64_t end) "region_add [iommu] 0x%"PRIx64" - 0x%"PRIx64
vfio_listener_region_add_ram(uint64_t iova_start, uint64_t iova_end, void *vaddr) "region_add [ram] 0x%"PRIx64" - 0x%"PRIx64" [%p]"
+vfio_listener_region_add_no_dma_map(const char *name, uint64_t iova, uint64_t size, uint64_t page_size) "Region \"%s\" 0x%"PRIx64" size=0x%"PRIx64" is not aligned to 0x%"PRIx64" and cannot be mapped for DMA"
vfio_listener_region_del_skip(uint64_t start, uint64_t end) "SKIPPING region_del 0x%"PRIx64" - 0x%"PRIx64
vfio_listener_region_del(uint64_t start, uint64_t end) "region_del 0x%"PRIx64" - 0x%"PRIx64
vfio_disconnect_container(int fd) "close container->fd=%d"
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PULL for-2.12 0/1] vfio fix
2018-04-05 18:41 [Qemu-devel] [PULL for-2.12 0/1] vfio fix Alex Williamson
2018-04-05 18:41 ` [Qemu-devel] [PULL for-2.12 1/1] vfio: Use a trace point when a RAM section cannot be DMA mapped Alex Williamson
@ 2018-04-06 12:40 ` Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2018-04-06 12:40 UTC (permalink / raw)
To: Alex Williamson; +Cc: QEMU Developers
On 5 April 2018 at 19:41, Alex Williamson <alex.williamson@redhat.com> wrote:
> The following changes since commit 0e87fdc966d05f4e5ad868034fcd8ee2a08ca62d:
>
> Update version for v2.12.0-rc2 release (2018-04-04 20:37:20 +0100)
>
> are available in the Git repository at:
>
> git://github.com/awilliam/qemu-vfio.git tags/vfio-fixes-20180405.0
>
> for you to fetch changes up to 5c08600547c059e3fd072995f9f367cdaf3c7d9d:
>
> vfio: Use a trace point when a RAM section cannot be DMA mapped (2018-04-05 10:48:52 -0600)
>
> ----------------------------------------------------------------
> VFIO fixes 2018-04-05
>
> - Convert over zealous error_report to trace point and make more
> meaningful (Eric Auger)
>
> ----------------------------------------------------------------
> Eric Auger (1):
> vfio: Use a trace point when a RAM section cannot be DMA mapped
>
> hw/vfio/common.c | 11 +++++------
> hw/vfio/trace-events | 1 +
> 2 files changed, 6 insertions(+), 6 deletions(-)
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-06 12:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-05 18:41 [Qemu-devel] [PULL for-2.12 0/1] vfio fix Alex Williamson
2018-04-05 18:41 ` [Qemu-devel] [PULL for-2.12 1/1] vfio: Use a trace point when a RAM section cannot be DMA mapped Alex Williamson
2018-04-06 12:40 ` [Qemu-devel] [PULL for-2.12 0/1] vfio fix Peter Maydell
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).