microvm/acpi: use GSI 16-23 for virtio
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 15 Sep 2020 12:08:58 +0000 (14:08 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 17 Sep 2020 12:16:19 +0000 (14:16 +0200)
With ACPI enabled and IO-APIC being properly declared in the ACPI tables
we can use interrupt lines 16-23 for virtio and avoid shared interrupts.

With acpi disabled we continue to use lines 5-12.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Sergio Lopez <slp@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-id: 20200915120909.20838-11-kraxel@redhat.com

hw/i386/microvm.c

index e1b86da8a92ec895b9d540a85152886e2ac48a1b..ca0c9983f137d83e0011b94758e98a05d6f1a552 100644 (file)
@@ -125,7 +125,7 @@ static void microvm_devices_init(MicrovmMachineState *mms)
 
     kvmclock_create();
 
-    mms->virtio_irq_base = 5;
+    mms->virtio_irq_base = x86_machine_is_acpi_enabled(x86ms) ? 16 : 5;
     for (i = 0; i < VIRTIO_NUM_TRANSPORTS; i++) {
         sysbus_create_simple("virtio-mmio",
                              VIRTIO_MMIO_BASE + i * 512,