qemu/include
David Gibson a788f227ef memory: Allow replay of IOMMU mapping notifications
When we have guest visible IOMMUs, we allow notifiers to be registered
which will be informed of all changes to IOMMU mappings.  This is used by
vfio to keep the host IOMMU mappings in sync with guest IOMMU mappings.

However, unlike with a memory region listener, an iommu notifier won't be
told about any mappings which already exist in the (guest) IOMMU at the
time it is registered.  This can cause problems if hotplugging a VFIO
device onto a guest bus which had existing guest IOMMU mappings, but didn't
previously have an VFIO devices (and hence no host IOMMU mappings).

This adds a memory_region_iommu_replay() function to handle this case.  It
replays any existing mappings in an IOMMU memory region to a specified
notifier.  Because the IOMMU memory region doesn't internally remember the
granularity of the guest IOMMU it has a small hack where the caller must
specify a granularity at which to replay mappings.

If there are finer mappings in the guest IOMMU these will be reported in
the iotlb structures passed to the notifier which it must handle (probably
causing it to flag an error).  This isn't new - the VFIO iommu notifier
must already handle notifications about guest IOMMU mappings too short
for it to represent in the host IOMMU.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2015-10-05 12:39:03 -06:00
..
block block: Introduce a new API bdrv_co_no_copy_on_readv() 2015-09-25 08:37:07 -04:00
crypto crypto: introduce new module for handling TLS sessions 2015-09-15 15:07:43 +01:00
disas disas: Add print_insn to disassemble info 2015-07-09 15:20:40 +02:00
exec memory: Allow replay of IOMMU mapping notifications 2015-10-05 12:39:03 -06:00
fpu softfloat: expand out STATUS macro 2015-02-06 16:11:38 +00:00
hw vfio: Record host IOMMU's available IO page sizes 2015-10-05 12:38:41 -06:00
libdecnumber Fix new typos in comments (found by codespell) 2014-07-18 17:45:36 +04:00
migration migration: qemu-file more size_t'ifying 2015-09-29 11:33:02 +05:30
monitor hmp: added io apic dump state 2015-09-25 12:04:42 +02:00
net vhost-user: add a new message to disable/enable a specific virt queue. 2015-09-24 16:27:53 +03:00
qapi qapi: Introduce a first class 'any' type 2015-09-21 09:56:49 +02:00
qemu typedef: add typedef for QemuOpts 2015-09-25 12:04:45 +02:00
qom cpu: Provide vcpu throttling interface 2015-09-30 09:42:04 +02:00
standard-headers target-i386: move asm-x86/hyperv.h to standard-headers 2015-09-16 17:33:32 +02:00
sysemu oslib-win32: only provide localtime_r/gmtime_r if missing 2015-09-24 21:13:49 +02:00
ui gtk: avoid redefining _WIN32_WINNT macro 2015-09-24 20:52:28 +02:00
config.h
elf.h elf: Update EM_MOXIE definition 2015-09-25 12:04:43 +02:00
glib-compat.h glib: remove stale compat functions 2015-05-22 15:58:06 -04:00
qemu-common.h utils: rename strtosz to use qemu prefix 2015-09-25 12:04:41 +02:00
qemu-io.h qemu-io: Use BlockBackend 2015-02-16 15:07:19 +00:00
qjson.h QJSON: Add JSON writer 2015-02-05 17:16:14 +01:00
trace-tcg.h trace: [tcg] Generate TCG tracing routines 2014-08-12 14:26:12 +01:00
trace.h trace: [tcg] Include event definitions in "trace.h" 2014-08-12 14:26:12 +01:00