diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-10-08 16:50:34 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-10-08 16:50:34 +0100 |
commit | 1d27b91723c252d9a97151dc1959cfd89c5816cb (patch) | |
tree | a63a4ed5c4071c44628160f20b22e20fee003bb4 /include | |
parent | 31c9bd164ddb653915b9029ba0edd40cd57530d9 (diff) | |
parent | 508ce5eb00070809f0d19917a1b2960dfcf5a64b (diff) |
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20151007.0' into staging
VFIO updates 2015-10-07
- Change platform device IRQ setup sequence for compatibility
with upcoming IRQ forwarding (Eric Auger)
- Extensions to support vfio-pci devices on spapr-pci-host-bridge
(David Gibson) [clang problem patch dropped]
# gpg: Signature made Wed 07 Oct 2015 16:30:52 BST using RSA key ID 3BB08B22
# gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>"
# gpg: aka "Alex Williamson <alex@shazbot.org>"
# gpg: aka "Alex Williamson <alwillia@redhat.com>"
# gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>"
* remotes/awilliam/tags/vfio-update-20151007.0:
vfio: Allow hotplug of containers onto existing guest IOMMU mappings
memory: Allow replay of IOMMU mapping notifications
vfio: Record host IOMMU's available IO page sizes
vfio: Check guest IOVA ranges against host IOMMU capabilities
vfio: Generalize vfio_listener_region_add failure path
vfio: Remove unneeded union from VFIOContainer
hw/vfio/platform: do not set resamplefd for edge-sensitive IRQS
hw/vfio/platform: change interrupt/unmask fields into pointer
hw/vfio/platform: irqfd setup sequence update
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/exec/memory.h | 13 | ||||
-rw-r--r-- | include/hw/vfio/vfio-common.h | 23 | ||||
-rw-r--r-- | include/hw/vfio/vfio-platform.h | 4 |
3 files changed, 25 insertions, 15 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h index 5baaf48234..0f07159bb4 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -583,6 +583,19 @@ void memory_region_notify_iommu(MemoryRegion *mr, void memory_region_register_iommu_notifier(MemoryRegion *mr, Notifier *n); /** + * memory_region_iommu_replay: replay existing IOMMU translations to + * a notifier + * + * @mr: the memory region to observe + * @n: the notifier to which to replay iommu mappings + * @granularity: Minimum page granularity to replay notifications for + * @is_write: Whether to treat the replay as a translate "write" + * through the iommu + */ +void memory_region_iommu_replay(MemoryRegion *mr, Notifier *n, + hwaddr granularity, bool is_write); + +/** * memory_region_unregister_iommu_notifier: unregister a notifier for * changes to IOMMU translation entries. * diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index 9b9901fbe2..f037f3c425 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -59,22 +59,19 @@ typedef struct VFIOAddressSpace { struct VFIOGroup; -typedef struct VFIOType1 { - MemoryListener listener; - int error; - bool initialized; -} VFIOType1; - typedef struct VFIOContainer { VFIOAddressSpace *space; int fd; /* /dev/vfio/vfio, empowered by the attached groups */ - struct { - /* enable abstraction to support various iommu backends */ - union { - VFIOType1 type1; - }; - void (*release)(struct VFIOContainer *); - } iommu_data; + MemoryListener listener; + int error; + bool initialized; + /* + * This assumes the host IOMMU can support only a single + * contiguous IOVA window. We may need to generalize that in + * future + */ + hwaddr min_iova, max_iova; + uint64_t iova_pgsizes; QLIST_HEAD(, VFIOGuestIOMMU) giommu_list; QLIST_HEAD(, VFIOGroup) group_list; QLIST_ENTRY(VFIOContainer) next; diff --git a/include/hw/vfio/vfio-platform.h b/include/hw/vfio/vfio-platform.h index c5cf1d79f3..b468f80b1e 100644 --- a/include/hw/vfio/vfio-platform.h +++ b/include/hw/vfio/vfio-platform.h @@ -34,8 +34,8 @@ enum { typedef struct VFIOINTp { QLIST_ENTRY(VFIOINTp) next; /* entry for IRQ list */ QSIMPLEQ_ENTRY(VFIOINTp) pqnext; /* entry for pending IRQ queue */ - EventNotifier interrupt; /* eventfd triggered on interrupt */ - EventNotifier unmask; /* eventfd for unmask on QEMU bypass */ + EventNotifier *interrupt; /* eventfd triggered on interrupt */ + EventNotifier *unmask; /* eventfd for unmask on QEMU bypass */ qemu_irq qemuirq; struct VFIOPlatformDevice *vdev; /* back pointer to device */ int state; /* inactive, pending, active */ |