All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qemu-kvm: reserve the low 24 gsi values
@ 2009-07-21 15:57 Michael S. Tsirkin
  2009-07-21 17:21 ` Gleb Natapov
  0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2009-07-21 15:57 UTC (permalink / raw)
  To: kvm, avi, gleb

reserve gsi 0 to 23 so that they won't be allocated for msi

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

---

diff --git a/qemu-kvm.c b/qemu-kvm.c
index c6c9fc6..f440b2d 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -1613,10 +1613,12 @@ int kvm_get_irq_route_gsi(kvm_context_t kvm)
 {
 	int i, bit;
 	uint32_t *buf = kvm->used_gsi_bitmap;
+	uint32_t mask = 0xff000000;
 
 	/* Return the lowest unused GSI in the bitmap */
-	for (i = 0; i < kvm->max_gsi / 32; i++) {
-		bit = ffs(~buf[i]);
+	for (i = 0; i < kvm->max_gsi / 32; i++) {
+		bit = ffs(~buf[i] & mask);
+		mask = 0xffffffff;
 		if (!bit)
 			continue;
 

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

end of thread, other threads:[~2009-07-21 20:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-21 15:57 [PATCH] qemu-kvm: reserve the low 24 gsi values Michael S. Tsirkin
2009-07-21 17:21 ` Gleb Natapov
2009-07-21 20:23   ` Michael S. Tsirkin

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.