qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/4] s390x/pci: remove idx from msix msg data


From: Yi Min Zhao
Subject: Re: [Qemu-devel] [PATCH 2/4] s390x/pci: remove idx from msix msg data
Date: Tue, 29 Aug 2017 12:33:38 +0800
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0



在 2017/8/28 下午11:04, Cornelia Huck 写道:
On Mon, 28 Aug 2017 10:04:45 +0200
Yi Min Zhao <address@hidden> wrote:

PCIDevcie pointer has been a parameter of kvm_arch_fixup_msi_route().
s/PCIDevcie/PCIDevice
Thanks!

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 <address@hidden>
---
  hw/s390x/s390-pci-bus.c  | 16 +++++-----------
  hw/s390x/s390-pci-bus.h  |  2 ++
  hw/s390x/s390-pci-inst.c | 24 ------------------------
  target/s390x/kvm.c       |  7 +++++--
  4 files changed, 12 insertions(+), 37 deletions(-)
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index 1c68c36663..e348bfb7cc 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -2503,10 +2503,13 @@ 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) {
+        return -ENODEV;
+    }
+
+    pbdev = s390_pci_find_dev_by_target(s390_get_phb(), DEVICE(dev)->id);
You need to replace the stub for s390_pci_find_dev_by_idx() with a stub
for s390_pci_find_dev_by_target() in s390-pci-stubs.c (on my s390-next
branch), so that it compiles without CONFIG_PCI.
OK. Got it.

      if (!pbdev) {
          DPRINTF("add_msi_route no dev\n");
          return -ENODEV;






reply via email to

[Prev in Thread] Current Thread [Next in Thread]