]> git.proxmox.com Git - mirror_qemu.git/commitdiff
s390x/kvm: make setting of in-kernel irq routes more efficient
authorJens Freimann <jfrei@linux.vnet.ibm.com>
Mon, 27 Jul 2015 14:53:27 +0000 (16:53 +0200)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Mon, 7 Sep 2015 14:10:43 +0000 (16:10 +0200)
When we add new adapter routes we call kvm_irqchip_add_route() for every
virtqueue and in the same step also do the KVM_SET_GSI_ROUTING ioctl.

This is unnecessary costly as the interface allows us to set multiple
routes in one go. Let's first add all routes to the table stored in the
global kvm_state and then do the ioctl to commit the routes to the
in-kernel irqchip.

This saves us several ioctls to the kernel where for each call a list
is reallocated and populated.

Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hw/intc/s390_flic_kvm.c
kvm-all.c

index b471e7a41e46c86148db9f44e810542da500b430..48714f96a35056c212afa71a0eea34f38ade4b81 100644 (file)
@@ -228,6 +228,8 @@ static int kvm_s390_add_adapter_routes(S390FLICState *fs,
         routes->gsi[i] = ret;
         routes->adapter.ind_offset++;
     }
+    kvm_irqchip_commit_routes(kvm_state);
+
     /* Restore passed-in structure to original state. */
     routes->adapter.ind_offset = ind_offset;
     return 0;
index 06e06f2b3fd681c0de1fb54c5c2d8062564a648c..c6f51287569cb7f8ea9ed9801745f03a470339cd 100644 (file)
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1293,7 +1293,6 @@ int kvm_irqchip_add_adapter_route(KVMState *s, AdapterInfo *adapter)
     kroute.u.adapter.adapter_id = adapter->adapter_id;
 
     kvm_add_routing_entry(s, &kroute);
-    kvm_irqchip_commit_routes(s);
 
     return virq;
 }