[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 51/58] acpi: make build_madt() more generic.
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 51/58] acpi: make build_madt() more generic. |
Date: |
Fri, 12 Jun 2020 10:52:54 -0400 |
From: Gerd Hoffmann <kraxel@redhat.com>
Remove PCMachineState dependency from build_madt().
Pass AcpiDeviceIf as separate argument instead of
depending on PCMachineState->acpi_dev.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20200520132003.9492-6-kraxel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/i386/acpi-build.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 1ecb68f45f..d217fc1fe6 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -366,14 +366,13 @@ void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,
}
static void
-build_madt(GArray *table_data, BIOSLinker *linker, PCMachineState *pcms)
+build_madt(GArray *table_data, BIOSLinker *linker,
+ X86MachineState *x86ms, AcpiDeviceIf *adev)
{
- MachineClass *mc = MACHINE_GET_CLASS(pcms);
- X86MachineState *x86ms = X86_MACHINE(pcms);
- const CPUArchIdList *apic_ids = mc->possible_cpu_arch_ids(MACHINE(pcms));
+ MachineClass *mc = MACHINE_GET_CLASS(x86ms);
+ const CPUArchIdList *apic_ids = mc->possible_cpu_arch_ids(MACHINE(x86ms));
int madt_start = table_data->len;
- AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_GET_CLASS(pcms->acpi_dev);
- AcpiDeviceIf *adev = ACPI_DEVICE_IF(pcms->acpi_dev);
+ AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_GET_CLASS(adev);
bool x2apic_mode = false;
AcpiMultipleApicTable *madt;
@@ -2708,7 +2707,8 @@ void acpi_build(AcpiBuildTables *tables, MachineState
*machine)
aml_len += tables_blob->len - fadt;
acpi_add_table(table_offsets, tables_blob);
- build_madt(tables_blob, tables->linker, pcms);
+ build_madt(tables_blob, tables->linker, x86ms,
+ ACPI_DEVICE_IF(pcms->acpi_dev));
vmgenid_dev = find_vmgenid_dev();
if (vmgenid_dev) {
--
MST
- [PULL v2 38/58] Add VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS, (continued)
- [PULL v2 38/58] Add VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS, Michael S. Tsirkin, 2020/06/12
- [PULL v2 39/58] Transmit vhost-user memory regions individually, Michael S. Tsirkin, 2020/06/12
- [PULL v2 40/58] Lift max memory slots limit imposed by vhost-user, Michael S. Tsirkin, 2020/06/12
- [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 <=
- [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, 2020/06/12
- [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