[13/13] microvm/acpi: use GSI 16-23 for virtio
diff mbox series

Message ID 20200319080117.7725-14-kraxel@redhat.com
State New
Headers show
Series
  • microvm: add acpi support
Related show

Commit Message

Gerd Hoffmann March 19, 2020, 8:01 a.m. UTC
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 8-15.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/i386/microvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Konrad Rzeszutek Wilk March 20, 2020, 3:30 p.m. UTC | #1
On Thu, Mar 19, 2020 at 09:01:17AM +0100, Gerd Hoffmann wrote:
> 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.

7 interrupt lines? Is there a specific requirements of which
ones should be assigned to what device?

Or perhaps - could you include /proc/interrupts in the commit if that is OK?

> 
> With acpi disabled we continue to use lines 8-15.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/i386/microvm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
> index 834b10aee0a2..139181daed06 100644
> --- a/hw/i386/microvm.c
> +++ b/hw/i386/microvm.c
> @@ -122,7 +122,7 @@ static void microvm_devices_init(MicrovmMachineState *mms)
>  
>      kvmclock_create();
>  
> -    mms->virtio_irq_base = 8;
> +    mms->virtio_irq_base = acpi_enabled ? 16 : 8;
>      for (i = 0; i < VIRTIO_NUM_TRANSPORTS; i++) {
>          sysbus_create_simple("virtio-mmio",
>                               VIRTIO_MMIO_BASE + i * 512,
> -- 
> 2.18.2
>
Gerd Hoffmann March 23, 2020, 10:23 a.m. UTC | #2
On Fri, Mar 20, 2020 at 11:30:16AM -0400, Konrad Rzeszutek Wilk wrote:
> On Thu, Mar 19, 2020 at 09:01:17AM +0100, Gerd Hoffmann wrote:
> > 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.
> 
> 7 interrupt lines? Is there a specific requirements of which
> ones should be assigned to what device?

8 lines (23 is inclusive), one for each virtio device.  It wouldn't give
you separate config change or per-queue interrupts (I think virtio-mmio
doesn't support that).  It only avoids sharing interrupts with legacy
pc devices like rtc and acpi.

cheers,
  Gerd

Patch
diff mbox series

diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index 834b10aee0a2..139181daed06 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -122,7 +122,7 @@  static void microvm_devices_init(MicrovmMachineState *mms)
 
     kvmclock_create();
 
-    mms->virtio_irq_base = 8;
+    mms->virtio_irq_base = acpi_enabled ? 16 : 8;
     for (i = 0; i < VIRTIO_NUM_TRANSPORTS; i++) {
         sysbus_create_simple("virtio-mmio",
                              VIRTIO_MMIO_BASE + i * 512,