From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWN2q-0006fl-OH for qemu-devel@nongnu.org; Mon, 31 Aug 2015 07:14:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWN2m-0006KC-LP for qemu-devel@nongnu.org; Mon, 31 Aug 2015 07:14:36 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:55628) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWN2m-0006Jr-BC for qemu-devel@nongnu.org; Mon, 31 Aug 2015 07:14:32 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 31 Aug 2015 12:14:31 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 645CA17D8056 for ; Mon, 31 Aug 2015 12:16:10 +0100 (BST) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t7VBEQS511796486 for ; Mon, 31 Aug 2015 11:14:29 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t7VBEG2m022214 for ; Mon, 31 Aug 2015 05:14:16 -0600 From: Cornelia Huck Date: Mon, 31 Aug 2015 13:13:48 +0200 Message-Id: <1441019643-10677-9-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1441019643-10677-1-git-send-email-cornelia.huck@de.ibm.com> References: <1441019643-10677-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH 08/23] s390x/kvm: make setting of in-kernel irq routes more efficient List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, agraf@suse.de From: Jens Freimann 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 Reviewed-by: David Hildenbrand Acked-by: Paolo Bonzini Signed-off-by: Cornelia Huck --- hw/intc/s390_flic_kvm.c | 2 ++ kvm-all.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index b471e7a..48714f9 100644 --- a/hw/intc/s390_flic_kvm.c +++ b/hw/intc/s390_flic_kvm.c @@ -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; diff --git a/kvm-all.c b/kvm-all.c index 06e06f2..c6f5128 100644 --- 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; } -- 2.5.1