diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2019-10-17 12:12:35 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2019-11-26 10:11:30 +1100 |
commit | 3607715a308d94b8c4797d23620e268a4c5bebf6 (patch) | |
tree | a3f1adb13ab965f57e19f2698aa9caab36f52f77 /include/sysemu/kvm.h | |
parent | 454590916caacef2c779351f6c79d1c448bb6f38 (diff) | |
download | qemu-3607715a308d94b8c4797d23620e268a4c5bebf6.zip qemu-3607715a308d94b8c4797d23620e268a4c5bebf6.tar.gz qemu-3607715a308d94b8c4797d23620e268a4c5bebf6.tar.bz2 |
kvm: Introduce KVM irqchip change notifier
Awareness of an in kernel irqchip is usually local to the machine and its
top-level interrupt controller. However, in a few cases other things need
to know about it. In particular vfio devices need this in order to
accelerate interrupt delivery.
If interrupt routing is changed, such devices may need to readjust their
connection to the KVM irqchip. pci_bus_fire_intx_routing_notifier() exists
to do just this.
However, for the pseries machine type we have a situation where the routing
remains constant but the top-level irq chip itself is changed. This occurs
because of PAPR feature negotiation which allows the guest to decide
between the older XICS and newer XIVE irq chip models (both of which are
paravirtualized).
To allow devices like vfio to adjust to this change, introduce a new
notifier for the purpose kvm_irqchip_change_notify().
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Tested-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/sysemu/kvm.h')
-rw-r--r-- | include/sysemu/kvm.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 9d14328..9fe233b 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -201,6 +201,7 @@ typedef struct KVMCapabilityInfo { struct KVMState; typedef struct KVMState KVMState; extern KVMState *kvm_state; +typedef struct Notifier Notifier; /* external API */ @@ -401,6 +402,10 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg); void kvm_irqchip_add_irq_route(KVMState *s, int gsi, int irqchip, int pin); +void kvm_irqchip_add_change_notifier(Notifier *n); +void kvm_irqchip_remove_change_notifier(Notifier *n); +void kvm_irqchip_change_notify(void); + void kvm_get_apic_state(DeviceState *d, struct kvm_lapic_state *kapic); struct kvm_guest_debug; |