summaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2016-03-09 11:56:06 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2016-03-16 09:55:10 +1100
commit3153119e9bb79ebd82e08d2fde80d1c3a039b6b2 (patch)
treeb7874a5faa5fd67c65fe3fa1e92aebf127fb686b /include/hw
parentf1a6cf3ef734aab142d5f7ce52e219474ababf6b (diff)
downloadqemu-3153119e9bb79ebd82e08d2fde80d1c3a039b6b2.tar.gz
vfio: Start improving VFIO/EEH interface
At present the code handling IBM's Enhanced Error Handling (EEH) interface on VFIO devices operates by bypassing the usual VFIO logic with vfio_container_ioctl(). That's a poorly designed interface with unclear semantics about exactly what can be operated on. In particular it operates on a single vfio container internally (hence the name), but takes an address space and group id, from which it deduces the container in a rather roundabout way. groupids are something that code outside vfio shouldn't even be aware of. This patch creates new interfaces for EEH operations. Internally we have vfio_eeh_container_op() which takes a VFIOContainer object directly. For external use we have vfio_eeh_as_ok() which determines if an AddressSpace is usable for EEH (at present this means it has a single container with exactly one group attached), and vfio_eeh_as_op() which will perform an operation on an AddressSpace in the unambiguous case, and otherwise returns an error. This interface still isn't great, but it's enough of an improvement to allow a number of cleanups in other places. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru> Acked-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/vfio/vfio.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hw/vfio/vfio.h b/include/hw/vfio/vfio.h
index 0b26cd8e11..fd3933be62 100644
--- a/include/hw/vfio/vfio.h
+++ b/include/hw/vfio/vfio.h
@@ -5,5 +5,7 @@
extern int vfio_container_ioctl(AddressSpace *as, int32_t groupid,
int req, void *param);
+bool vfio_eeh_as_ok(AddressSpace *as);
+int vfio_eeh_as_op(AddressSpace *as, uint32_t op);
#endif