diff options
author | Yi Min Zhao <zyimin@linux.vnet.ibm.com> | 2017-09-05 12:12:58 +0200 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2017-09-19 18:21:32 +0200 |
commit | ceb7054fd4f00c4893938bfb23688f79be0fa782 (patch) | |
tree | 6d1ca6835a26e1f696061a840cb11700e60c1336 /target | |
parent | 2f84a92ec631f5907207990705a22afb9aad3eef (diff) |
s390x/pci: remove idx from msix msg data
PCIDevice pointer has been a parameter of kvm_arch_fixup_msi_route().
So we don't need to store zpci idx in msix message data to find out the
specific zpci device. Instead, we could use pci device id to find its
corresponding zpci device.
Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Message-Id: <1504606380-49341-2-git-send-email-zyimin@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/s390x/kvm.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index ad7ce9fc70..1130a391d4 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2423,12 +2423,16 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route, uint64_t address, uint32_t data, PCIDevice *dev) { S390PCIBusDevice *pbdev; - uint32_t idx = data >> ZPCI_MSI_VEC_BITS; uint32_t vec = data & ZPCI_MSI_VEC_MASK; - pbdev = s390_pci_find_dev_by_idx(s390_get_phb(), idx); + if (!dev) { + DPRINTF("add_msi_route no pci device\n"); + return -ENODEV; + } + + pbdev = s390_pci_find_dev_by_target(s390_get_phb(), DEVICE(dev)->id); if (!pbdev) { - DPRINTF("add_msi_route no dev\n"); + DPRINTF("add_msi_route no zpci device\n"); return -ENODEV; } |