All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm: set gsi_bits and max_gsi correctly
@ 2012-03-28 18:18 ` Jason Baron
  0 siblings, 0 replies; 7+ messages in thread
From: Jason Baron @ 2012-03-28 18:18 UTC (permalink / raw)
  To: kvm; +Cc: qemu-devel, jan.kiszka, alex.williamson

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 <jbaron@redhat.com>
---
 kvm-all.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index ab88c7c..b616c7d 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -873,7 +873,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.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-11  2:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-28 18:18 [PATCH] kvm: set gsi_bits and max_gsi correctly Jason Baron
2012-03-28 18:18 ` [Qemu-devel] " Jason Baron
2012-03-28 18:20 ` Alex Williamson
2012-03-28 18:20   ` [Qemu-devel] " Alex Williamson
2012-03-28 18:27   ` Jan Kiszka
2012-03-28 18:27     ` [Qemu-devel] " Jan Kiszka
2012-04-11  2:14 ` Marcelo Tosatti

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.