From: Peter Maydell Date: Tue, 7 Jul 2015 08:22:40 +0000 (+0100) Subject: Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150706.0' into... X-Git-Tag: qemu-xen-4.7.0-rc1~193 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1452673888f6d7f0454276d049846c9bec659233;p=qemu-xen.git Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150706.0' into staging VFIO updates for 2.4-rc0 - "real" host page size API (Peter Crosthwaite) - platform device irqfd support (Eric Auger) - spapr container disconnect fix (Alexey Kardashevskiy) - quirk for broken Chelsio hardware (Gabriel Laupre) - coverity fix (Paolo Bonzini) # gpg: Signature made Mon Jul 6 19:23:49 2015 BST using RSA key ID 3BB08B22 # gpg: Good signature from "Alex Williamson " # gpg: aka "Alex Williamson " # gpg: aka "Alex Williamson " # gpg: aka "Alex Williamson " * remotes/awilliam/tags/vfio-update-20150706.0: vfio/pci : Add pba_offset PCI quirk for Chelsio T5 devices vfio: Unregister IOMMU notifiers when container is destroyed hw/vfio/platform: add irqfd support kvm: some fixes to kvm_resamplefds_allowed sysbus: add irq_routing_notifier intc: arm_gic_kvm: set the qemu_irq/gsi mapping kvm-all.c: add qemu_irq/gsi hash table and utility routines kvm: rename kvm_irqchip_[add,remove]_irqfd_notifier with gsi suffix vfio: cpu: Use "real" page size API cpu-all: complete "real" host page size API vfio: fix return type of pread Signed-off-by: Peter Maydell Conflicts: kvm-all.c --- 1452673888f6d7f0454276d049846c9bec659233 diff --cc kvm-all.c index edff01ca03,cb8318707a..06e06f2b3f --- a/kvm-all.c +++ b/kvm-all.c @@@ -1345,7 -1344,36 +1348,36 @@@ int kvm_irqchip_remove_irqfd_notifier_g false); } + int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n, + EventNotifier *rn, qemu_irq irq) + { + gpointer key, gsi; + gboolean found = g_hash_table_lookup_extended(s->gsimap, irq, &key, &gsi); + + if (!found) { + return -ENXIO; + } + return kvm_irqchip_add_irqfd_notifier_gsi(s, n, rn, GPOINTER_TO_INT(gsi)); + } + + int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, + qemu_irq irq) + { + gpointer key, gsi; + gboolean found = g_hash_table_lookup_extended(s->gsimap, irq, &key, &gsi); + + if (!found) { + return -ENXIO; + } + return kvm_irqchip_remove_irqfd_notifier_gsi(s, n, GPOINTER_TO_INT(gsi)); + } + + void kvm_irqchip_set_qemuirq_gsi(KVMState *s, qemu_irq irq, int gsi) + { + g_hash_table_insert(s->gsimap, irq, GINT_TO_POINTER(gsi)); + } + -static int kvm_irqchip_create(MachineState *machine, KVMState *s) +static void kvm_irqchip_create(MachineState *machine, KVMState *s) { int ret; @@@ -1380,6 -1404,10 +1412,8 @@@ kvm_halt_in_kernel_allowed = true; kvm_init_irq_routing(s); + + s->gsimap = g_hash_table_new(g_direct_hash, g_direct_equal); - - return 0; } /* Find number of supported CPUs using the recommended