vfio: Use a trace point when a RAM section cannot be DMA mapped
commit5c08600547c059e3fd072995f9f367cdaf3c7d9d
authorEric Auger <eric.auger@redhat.com>
Wed, 4 Apr 2018 20:30:50 +0000 (4 22:30 +0200)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 5 Apr 2018 16:48:52 +0000 (5 10:48 -0600)
treee6fc27de01df6316e6e4967711a2f2229c116c4c
parent0e87fdc966d05f4e5ad868034fcd8ee2a08ca62d
vfio: Use a trace point when a RAM section cannot be DMA mapped

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
hw/vfio/trace-events