diff options
author | Yi Min Zhao <zyimin@linux.vnet.ibm.com> | 2016-11-23 11:08:29 +0800 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2017-01-20 10:01:59 +0100 |
commit | a975a24aed372ba665a8b159e4cd14b6e105a296 (patch) | |
tree | e9828610ce5f8784bc16ef04517c985c53b36e4e /target | |
parent | e70377dfa4bbc2e101066ca35675bed4129c5a8c (diff) |
s390x/pci: optimize calling s390_get_phb()
A function may recursively call device search functions or may call
serveral different device search function. Passing the S390pciState to
search functions as an argument instead of looking up it inside the
search functions lowers the number of calling s390_get_phb().
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')
-rw-r--r-- | target/s390x/kvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 97afe02599..c47db9a884 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2301,7 +2301,7 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route, uint32_t idx = data >> ZPCI_MSI_VEC_BITS; uint32_t vec = data & ZPCI_MSI_VEC_MASK; - pbdev = s390_pci_find_dev_by_idx(idx); + pbdev = s390_pci_find_dev_by_idx(s390_get_phb(), idx); if (!pbdev) { DPRINTF("add_msi_route no dev\n"); return -ENODEV; |