summaryrefslogtreecommitdiff
path: root/target-s390x
diff options
context:
space:
mode:
authorYi Min Zhao <zyimin@linux.vnet.ibm.com>2016-05-06 18:44:40 +0800
committerCornelia Huck <cornelia.huck@de.ibm.com>2016-07-11 09:48:05 +0200
commitcdd85eb2804018ab46a742ebf64dc5366b9fae73 (patch)
tree624e475a5749db7d07f6d0732902a759d914f777 /target-s390x
parent0a608a6e132abffa8fd9455e2354a47acb95847e (diff)
downloadqemu-cdd85eb2804018ab46a742ebf64dc5366b9fae73.tar.gz
s390x/pci: replace fid with idx in msg data of msix
Present code uses fid as the part of message data of msix for looking up the specific zpci device. However it limits the usable range of fid, and the code looking up the zpci device may fail due to truncation of the fid. In addition, fh is composed of enabled bit, FH_VIRT and the array index. So we can use the array index as the identifier to store in msg data. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'target-s390x')
-rw-r--r--target-s390x/kvm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 45e94ca48a..2991bff6a4 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -2246,10 +2246,10 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route,
uint64_t address, uint32_t data, PCIDevice *dev)
{
S390PCIBusDevice *pbdev;
- uint32_t fid = data >> ZPCI_MSI_VEC_BITS;
+ uint32_t idx = data >> ZPCI_MSI_VEC_BITS;
uint32_t vec = data & ZPCI_MSI_VEC_MASK;
- pbdev = s390_pci_find_dev_by_fid(fid);
+ pbdev = s390_pci_find_dev_by_idx(idx);
if (!pbdev) {
DPRINTF("add_msi_route no dev\n");
return -ENODEV;