From d34f31fe7b12b24a42410054a2bc9066f3b45892 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Mon, 20 Jan 2020 11:31:01 +0100 Subject: [PATCH] vmm: Fix KvmInterruptManager when base is different from 0 When the base InterruptIndex is different from 0, the loop allocating GSI and HashMap entries won't work as expected. The for loop needs to start from base, but the limit must be base+count so that we allocate a number of "count" entries. Signed-off-by: Sebastien Boeuf --- vmm/src/interrupt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmm/src/interrupt.rs b/vmm/src/interrupt.rs index 45c34f349..1ee4de91d 100644 --- a/vmm/src/interrupt.rs +++ b/vmm/src/interrupt.rs @@ -272,7 +272,7 @@ impl InterruptManager for KvmInterruptManager { let mut irq_routes: HashMap = HashMap::with_capacity(count as usize); - for i in base..count { + for i in base..base + count { irq_routes.insert(i, InterruptRoute::new(&mut allocator)?); }