vfio/pci: Respond to KVM irqchip change notifier
commitc5478fea27ac47ed3b57e0489a49b62f36024763
authorDavid Gibson <david@gibson.dropbear.id.au>
Thu, 17 Oct 2019 01:38:30 +0000 (17 12:38 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 25 Nov 2019 23:11:30 +0000 (26 10:11 +1100)
treefcce0f7582bd235baba9a333454502c029bb1e41
parentad54dbd89d7142c00669f8b6f4806c92ab468b45
vfio/pci: Respond to KVM irqchip change notifier

VFIO PCI devices already respond to the pci intx routing notifier, in order
to update kernel irqchip mappings when routing is updated.  However this
won't handle the case where the irqchip itself is replaced by a different
model while retaining the same routing.  This case can happen on
the pseries machine type due to PAPR feature negotiation.

To handle that case, add a handler for the irqchip change notifier, which
does much the same thing as the routing notifier, but is unconditional,
rather than being a no-op when the routing hasn't changed.

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>
hw/vfio/pci.c
hw/vfio/pci.h