OSDN Git Service

x86: make pci irqs runtime configurable
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 16 Oct 2020 11:38:31 +0000 (13:38 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 21 Oct 2020 09:36:05 +0000 (11:36 +0200)
Add a variable to x86 machine state instead of
hard-coding the PCI interrupts.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20201016113835.17465-4-kraxel@redhat.com

hw/i386/acpi-common.c
hw/i386/x86.c
include/hw/i386/x86.h

index ab9b005..1584abb 100644 (file)
@@ -115,8 +115,7 @@ void acpi_build_madt(GArray *table_data, BIOSLinker *linker,
 
     if (has_pci) {
         for (i = 1; i < 16; i++) {
-#define ACPI_BUILD_PCI_IRQS ((1<<5) | (1<<9) | (1<<10) | (1<<11))
-            if (!(ACPI_BUILD_PCI_IRQS & (1 << i))) {
+            if (!(x86ms->pci_irq_mask & (1 << i))) {
                 /* No need for a INT source override structure. */
                 continue;
             }
index 3137a20..5944fc4 100644 (file)
@@ -1178,6 +1178,7 @@ static void x86_machine_initfn(Object *obj)
     x86ms->smm = ON_OFF_AUTO_AUTO;
     x86ms->acpi = ON_OFF_AUTO_AUTO;
     x86ms->smp_dies = 1;
+    x86ms->pci_irq_mask = ACPI_BUILD_PCI_IRQS;
 }
 
 static void x86_machine_class_init(ObjectClass *oc, void *data)
index d5dcf7a..bfa9cb2 100644 (file)
@@ -58,6 +58,7 @@ struct X86MachineState {
 
     /* CPU and apic information: */
     bool apic_xrupt_override;
+    unsigned pci_irq_mask;
     unsigned apic_id_limit;
     uint16_t boot_cpus;
     unsigned smp_dies;
@@ -114,6 +115,7 @@ bool x86_machine_is_acpi_enabled(const X86MachineState *x86ms);
 /* Global System Interrupts */
 
 #define GSI_NUM_PINS IOAPIC_NUM_PINS
+#define ACPI_BUILD_PCI_IRQS ((1<<5) | (1<<9) | (1<<10) | (1<<11))
 
 typedef struct GSIState {
     qemu_irq i8259_irq[ISA_NUM_IRQS];