[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 53/58] acpi: madt: skip pci override on pci-less systems.
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 53/58] acpi: madt: skip pci override on pci-less systems. |
Date: |
Fri, 12 Jun 2020 10:52:58 -0400 |
From: Gerd Hoffmann <kraxel@redhat.com>
Needed for microvm.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200520132003.9492-8-kraxel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/i386/acpi-common.h | 3 ++-
hw/i386/acpi-build.c | 2 +-
hw/i386/acpi-common.c | 26 +++++++++++++++-----------
3 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/hw/i386/acpi-common.h b/hw/i386/acpi-common.h
index c30e461f18..9cac18dddf 100644
--- a/hw/i386/acpi-common.h
+++ b/hw/i386/acpi-common.h
@@ -9,6 +9,7 @@
#define ACPI_BUILD_IOAPIC_ID 0x0
void acpi_build_madt(GArray *table_data, BIOSLinker *linker,
- X86MachineState *x86ms, AcpiDeviceIf *adev);
+ X86MachineState *x86ms, AcpiDeviceIf *adev,
+ bool has_pci);
#endif
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 26c0c8aefa..473cbdfffd 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2588,7 +2588,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState
*machine)
acpi_add_table(table_offsets, tables_blob);
acpi_build_madt(tables_blob, tables->linker, x86ms,
- ACPI_DEVICE_IF(pcms->acpi_dev));
+ ACPI_DEVICE_IF(pcms->acpi_dev), true);
vmgenid_dev = find_vmgenid_dev();
if (vmgenid_dev) {
diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c
index 5caca16a0b..ab9b00581a 100644
--- a/hw/i386/acpi-common.c
+++ b/hw/i386/acpi-common.c
@@ -72,7 +72,8 @@ void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,
}
void acpi_build_madt(GArray *table_data, BIOSLinker *linker,
- X86MachineState *x86ms, AcpiDeviceIf *adev)
+ X86MachineState *x86ms, AcpiDeviceIf *adev,
+ bool has_pci)
{
MachineClass *mc = MACHINE_GET_CLASS(x86ms);
const CPUArchIdList *apic_ids = mc->possible_cpu_arch_ids(MACHINE(x86ms));
@@ -111,18 +112,21 @@ void acpi_build_madt(GArray *table_data, BIOSLinker
*linker,
intsrcovr->gsi = cpu_to_le32(2);
intsrcovr->flags = cpu_to_le16(0); /* conforms to bus specifications
*/
}
- for (i = 1; i < 16; i++) {
+
+ 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))) {
- /* No need for a INT source override structure. */
- continue;
+ if (!(ACPI_BUILD_PCI_IRQS & (1 << i))) {
+ /* No need for a INT source override structure. */
+ continue;
+ }
+ intsrcovr = acpi_data_push(table_data, sizeof *intsrcovr);
+ intsrcovr->type = ACPI_APIC_XRUPT_OVERRIDE;
+ intsrcovr->length = sizeof(*intsrcovr);
+ intsrcovr->source = i;
+ intsrcovr->gsi = cpu_to_le32(i);
+ intsrcovr->flags = cpu_to_le16(0xd); /* active high, level
triggered */
}
- intsrcovr = acpi_data_push(table_data, sizeof *intsrcovr);
- intsrcovr->type = ACPI_APIC_XRUPT_OVERRIDE;
- intsrcovr->length = sizeof(*intsrcovr);
- intsrcovr->source = i;
- intsrcovr->gsi = cpu_to_le32(i);
- intsrcovr->flags = cpu_to_le16(0xd); /* active high, level triggered
*/
}
if (x2apic_mode) {
--
MST
- [PULL v2 41/58] Refactor out libvhost-user fault generation logic, (continued)
- [PULL v2 41/58] Refactor out libvhost-user fault generation logic, Michael S. Tsirkin, 2020/06/12
- [PULL v2 42/58] Support ram slot configuration in libvhost-user, Michael S. Tsirkin, 2020/06/12
- [PULL v2 43/58] Support adding individual regions in libvhost-user, Michael S. Tsirkin, 2020/06/12
- [PULL v2 44/58] Support individual region unmap in libvhost-user, Michael S. Tsirkin, 2020/06/12
- [PULL v2 45/58] Lift max ram slots limit in libvhost-user, Michael S. Tsirkin, 2020/06/12
- [PULL v2 46/58] libvhost-user: advertise vring features, Michael S. Tsirkin, 2020/06/12
- [PULL v2 47/58] hw/pci: Fix crash when running QEMU with "-nic model=rocker", Michael S. Tsirkin, 2020/06/12
- [PULL v2 51/58] acpi: make build_madt() more generic., Michael S. Tsirkin, 2020/06/12
- [PULL v2 55/58] acpi: ged: rename event memory region, Michael S. Tsirkin, 2020/06/12
- [PULL v2 52/58] acpi: create acpi-common.c and move madt code, Michael S. Tsirkin, 2020/06/12
- [PULL v2 53/58] acpi: madt: skip pci override on pci-less systems.,
Michael S. Tsirkin <=
- [PULL v2 54/58] acpi: fadt: add hw-reduced sleep register support, Michael S. Tsirkin, 2020/06/12
- [PULL v2 57/58] pci: Display PCI IRQ pin in "info pci", Michael S. Tsirkin, 2020/06/12
- [PULL v2 56/58] Fix parameter type in vhost migration log path, Michael S. Tsirkin, 2020/06/12
- [PULL v2 31/58] hw/pci/pci_bridge: Correct pci_bridge_io memory region size, Michael S. Tsirkin, 2020/06/12
- [PULL v2 05/58] qtest: allow DSDT acpi table changes, Michael S. Tsirkin, 2020/06/12
- [PULL v2 04/58] tests/acpi: update expected SRAT files, Michael S. Tsirkin, 2020/06/12
- [PULL v2 02/58] diffs-allowed: add the SRAT AML to diffs-allowed, Michael S. Tsirkin, 2020/06/12
- [PULL v2 18/58] tests/acpi: Add void tables for Q35/TPM-TIS bios-tables-test, Michael S. Tsirkin, 2020/06/12
- [PULL v2 25/58] virtio-balloon: Implement support for page poison reporting feature, Michael S. Tsirkin, 2020/06/12
- [PULL v2 14/58] acpi: Convert build_tpm2() to build_append* API, Michael S. Tsirkin, 2020/06/12