diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 1fa244777..b2e6277ec 100755 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -317,11 +317,6 @@ impl Vm { .transpose() .map_err(Error::InitramfsFile)?; - let ioapic = GsiApic::new( - X86_64_IRQ_BASE, - ioapic::NUM_IOAPIC_PINS as u32 - X86_64_IRQ_BASE, - ); - // Let's allocate 64 GiB of addressable MMIO space, starting at 0. let allocator = Arc::new(Mutex::new( SystemAllocator::new( @@ -331,7 +326,10 @@ impl Vm { 1 << get_host_cpu_phys_bits(), layout::MEM_32BIT_RESERVED_START, layout::MEM_32BIT_DEVICES_SIZE, - vec![ioapic], + vec![GsiApic::new( + X86_64_IRQ_BASE, + ioapic::NUM_IOAPIC_PINS as u32 - X86_64_IRQ_BASE, + )], ) .ok_or(Error::CreateSystemAllocator)?, ));