kvm: Introduce KVM irqchip change notifier
commit3607715a308d94b8c4797d23620e268a4c5bebf6
authorDavid Gibson <david@gibson.dropbear.id.au>
Thu, 17 Oct 2019 01:12:35 +0000 (17 12:12 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 25 Nov 2019 23:11:30 +0000 (26 10:11 +1100)
treea3f1adb13ab965f57e19f2698aa9caab36f52f77
parent454590916caacef2c779351f6c79d1c448bb6f38
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>
accel/kvm/kvm-all.c
accel/stubs/kvm-stub.c
include/sysemu/kvm.h