Received: from eggs.gnu.org ([2001:4830:134:3::10]:52014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxj4-00065O-4k for qemu-devel@nongnu.org; Mon, 07 Sep 2015 10:48:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYxj1-0002DD-Pp for qemu-devel@nongnu.org; Mon, 07 Sep 2015 10:48:53 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:40940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxj1-0002CC-FV for qemu-devel@nongnu.org; Mon, 07 Sep 2015 10:48:51 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 7 Sep 2015 15:48:49 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 397651B08078 for ; Mon, 7 Sep 2015 15:50:22 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t87EmiYY43712632 for ; Mon, 7 Sep 2015 14:48:44 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t87EminV030419 for ; Mon, 7 Sep 2015 08:48:44 -0600 From: Cornelia Huck Date: Mon, 7 Sep 2015 16:48:22 +0200 Message-Id: <1441637317-14471-9-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1441637317-14471-1-git-send-email-cornelia.huck@de.ibm.com> References: <1441637317-14471-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PULL 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: peter.maydell@linaro.org Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, qemu-devel@nongnu.org, 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