diff options
author | Peter Xu <peterx@redhat.com> | 2016-07-14 13:56:32 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-07-21 20:44:19 +0300 |
commit | e1d4fb2de594ab0cbe78846bc79617b9bd50c867 (patch) | |
tree | 3369f93474f9b692104f7b84cf957dab44472dcc /hw/pci/pci.c | |
parent | 38d87493f37e5dc442c7419c5843fcf60bb39d63 (diff) | |
download | qemu-e1d4fb2de594ab0cbe78846bc79617b9bd50c867.zip qemu-e1d4fb2de594ab0cbe78846bc79617b9bd50c867.tar.gz qemu-e1d4fb2de594ab0cbe78846bc79617b9bd50c867.tar.bz2 |
kvm-irqchip: x86: add msi route notify fn
One more IEC notifier is added to let msi routes know about the IEC
changes. When interrupt invalidation happens, all registered msi routes
will be updated for all PCI devices.
Since both vfio and vhost are possible gsi route consumers, this patch
will go one step further to keep them safe in split irqchip mode and
when irqfd is enabled.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
[move trace-events lines into target-i386/trace-events]
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci/pci.c')
-rw-r--r-- | hw/pci/pci.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 149994b..728c6d4 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2596,6 +2596,21 @@ PCIDevice *pci_get_function_0(PCIDevice *pci_dev) } } +MSIMessage pci_get_msi_message(PCIDevice *dev, int vector) +{ + MSIMessage msg; + if (msix_enabled(dev)) { + msg = msix_get_message(dev, vector); + } else if (msi_enabled(dev)) { + msg = msi_get_message(dev, vector); + } else { + /* Should never happen */ + error_report("%s: unknown interrupt type", __func__); + abort(); + } + return msg; +} + static const TypeInfo pci_device_type_info = { .name = TYPE_PCI_DEVICE, .parent = TYPE_DEVICE, |