[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/17] x86: make pci irqs runtime configurable
From: |
Gerd Hoffmann |
Subject: |
[PULL 03/17] x86: make pci irqs runtime configurable |
Date: |
Wed, 21 Oct 2020 16:48:38 +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
---
include/hw/i386/x86.h | 2 ++
hw/i386/acpi-common.c | 3 +--
hw/i386/x86.c | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h
index d5dcf7a07fdc..bfa9cb2a258b 100644
--- a/include/hw/i386/x86.h
+++ b/include/hw/i386/x86.h
@@ -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];
diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c
index ab9b00581a15..1584abb3e6b0 100644
--- a/hw/i386/acpi-common.c
+++ b/hw/i386/acpi-common.c
@@ -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;
}
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 3137a2008588..5944fc44edca 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -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)
--
2.27.0
- [PULL 05/17] apci: drop has_pci arg for acpi_build_madt, (continued)
- [PULL 05/17] apci: drop has_pci arg for acpi_build_madt, Gerd Hoffmann, 2020/10/21
- [PULL 11/17] usb/xhci: fixup xhci kconfig deps, Gerd Hoffmann, 2020/10/21
- [PULL 07/17] tests/acpi: disallow changes for microvm/APIC.pcie, Gerd Hoffmann, 2020/10/21
- [PULL 08/17] acpi: add aml builder stubs, Gerd Hoffmann, 2020/10/21
- [PULL 10/17] usb/xhci: add xhci_sysbus_build_aml() helper, Gerd Hoffmann, 2020/10/21
- [PULL 09/17] usb/xhci: add include/hw/usb/xhci.h header file, Gerd Hoffmann, 2020/10/21
- [PULL 01/17] tests/acpi: allow changes for microvm/APIC.pcie, Gerd Hoffmann, 2020/10/21
- [PULL 02/17] tests/acpi: add empty microvm/APIC.pcie, Gerd Hoffmann, 2020/10/21
- [PULL 15/17] tests/acpi: add microvm usb test, Gerd Hoffmann, 2020/10/21
- [PULL 12/17] microvm: add usb support, Gerd Hoffmann, 2020/10/21
- [PULL 03/17] x86: make pci irqs runtime configurable,
Gerd Hoffmann <=
- [PULL 16/17] tests/acpi: add microvm rtc test, Gerd Hoffmann, 2020/10/21
- [PULL 06/17] tests/acpi: update expected data files, Gerd Hoffmann, 2020/10/21
- Re: [PULL 00/17] Microvm 20201021 patches, Peter Maydell, 2020/10/22