From a975a24aed372ba665a8b159e4cd14b6e105a296 Mon Sep 17 00:00:00 2001 From: Yi Min Zhao Date: Wed, 23 Nov 2016 11:08:29 +0800 Subject: 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 Reviewed-by: Pierre Morel Signed-off-by: Cornelia Huck --- target/s390x/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target/s390x') 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; -- cgit v1.2.3