From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: [PATCH 5/7] kvm: set gsi_bits and max_gsi correctly Date: Thu, 12 Apr 2012 22:32:40 -0300 Message-ID: References: Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Jason Baron , Marcelo Tosatti To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:6924 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757534Ab2DMBgx (ORCPT ); Thu, 12 Apr 2012 21:36:53 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: From: Jason Baron The current kvm_init_irq_routing() doesn't set up the used_gsi_bitmap correctly, and as a consequence pins max_gsi to 32 when it really should be 1024. I ran into this limitation while testing pci passthrough, where I consistently got an -ENOSPC return from kvm_get_irq_route_gsi() called from assigned_dev_update_msix_mmio(). Signed-off-by: Jason Baron Acked-by: Alex Williamson Acked-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- kvm-all.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 5ff954a..b8e9dc6 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -871,7 +871,7 @@ static void kvm_init_irq_routing(KVMState *s) unsigned int gsi_bits, i; /* Round up so we can search ints using ffs */ - gsi_bits = (gsi_count + 31) / 32; + gsi_bits = ALIGN(gsi_count, 32); s->used_gsi_bitmap = g_malloc0(gsi_bits / 8); s->max_gsi = gsi_bits; -- 1.7.6.4