qemu/hw/vfio
Alexey Kardashevskiy 1610799876 vfio/spapr: Fix indirect levels calculation
The current code assumes that we can address more bits on a PCI bus
for DMA than we really can but there is no way knowing the actual limit.

This makes a better guess for the number of levels and if the kernel
fails to allocate that, this increases the level numbers till succeeded
or reached the 64bit limit.

This adds levels to the trace point.

This may cause the kernel to warn about failed allocation:
   [65122.837458] Failed to allocate a TCE memory, level shift=28
which might happen if MAX_ORDER is not large enough as it can vary:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/Kconfig?h=v5.0-rc2#n727

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-Id: <20190227085149.38596-3-aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-12 10:50:59 +11:00
..
amd-xgbe.c vfio/platform: Make the vfio-platform device non-abstract 2018-10-15 10:52:09 -06:00
ap.c s390x/vfio-ap: Implement hot plug/unplug of vfio-ap device 2019-03-04 11:49:31 +01:00
calxeda-xgmac.c vfio/platform: Make the vfio-platform device non-abstract 2018-10-15 10:52:09 -06:00
ccw.c qemu-error: add {error, warn}_report_once_cond 2018-09-24 17:13:07 +02:00
common.c hw/vfio/common: Refactor container initialization 2019-02-21 21:07:03 -07:00
display.c hw/vfio/display: add ramfb support 2018-10-15 10:52:09 -06:00
Kconfig vfio-pci: enable by default 2019-03-11 14:45:10 +01:00
Makefile.objs hw/vfio/Makefile.objs: Create new CONFIG_* variables for VFIO core and PCI 2019-02-05 16:50:21 +01:00
pci-quirks.c pci: Move NVIDIA vendor id to the rest of ids 2019-02-22 10:51:31 -05:00
pci.c trace: forbid use of %m in trace event format strings 2019-01-24 14:16:56 +00:00
pci.h hw/vfio/display: add ramfb support 2018-10-15 10:52:09 -06:00
platform.c vfio: Clean up error reporting after previous commit 2018-10-19 14:51:34 +02:00
spapr.c vfio/spapr: Fix indirect levels calculation 2019-03-12 10:50:59 +11:00
trace-events vfio/spapr: Fix indirect levels calculation 2019-03-12 10:50:59 +11:00