[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/55] hw/i386: extend pxb query for all PC machines
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 10/55] hw/i386: extend pxb query for all PC machines |
Date: |
Tue, 22 Dec 2015 18:53:05 +0200 |
From: Marcel Apfelbaum <address@hidden>
Add bus property to PC machines and use it when looking
for primary PCI root bus (bus 0).
Signed-off-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Acked-by: Eduardo Habkost <address@hidden>
---
include/hw/i386/pc.h | 1 +
hw/i386/acpi-build.c | 3 +--
hw/i386/pc.c | 2 +-
hw/i386/pc_piix.c | 1 +
hw/i386/pc_q35.c | 1 +
5 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index beb44ca..bbebf15 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -51,6 +51,7 @@ struct PCMachineState {
OnOffAuto vmport;
OnOffAuto smm;
ram_addr_t below_4g_mem_size, above_4g_mem_size;
+ PCIBus *bus;
};
#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index eb156cb..a60436b 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -950,8 +950,7 @@ build_ssdt(GArray *table_data, GArray *linker,
/* Reserve space for header */
acpi_data_push(ssdt->buf, sizeof(AcpiTableHeader));
- /* Extra PCI root buses are implemented only for i440fx */
- bus = find_i440fx();
+ bus = PC_MACHINE(machine)->bus;
if (bus) {
QLIST_FOREACH(bus, &bus->child, sibling) {
uint8_t bus_num = pci_bus_num(bus);
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 00b59cd..48aa37a 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1167,7 +1167,7 @@ void pc_guest_info_machine_done(Notifier *notifier, void
*data)
PcGuestInfoState *guest_info_state = container_of(notifier,
PcGuestInfoState,
machine_done);
- PCIBus *bus = find_i440fx();
+ PCIBus *bus = PC_MACHINE(qdev_get_machine())->bus;
if (bus) {
int extra_hosts = 0;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 7d847b2..9654628 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -185,6 +185,7 @@ static void pc_init1(MachineState *machine,
pcms->below_4g_mem_size,
pcms->above_4g_mem_size,
pci_memory, ram_memory);
+ pcms->bus = pci_bus;
} else {
pci_bus = NULL;
i440fx_state = NULL;
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 6aaa0ee..b87e7ec 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -181,6 +181,7 @@ static void pc_q35_init(MachineState *machine)
qdev_init_nofail(DEVICE(q35_host));
phb = PCI_HOST_BRIDGE(q35_host);
host_bus = phb->bus;
+ pcms->bus = phb->bus;
/* create ISA bus */
lpc = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_DEV,
ICH9_LPC_FUNC), true,
--
MST
- [Qemu-devel] [PULL 00/55] acpi, pc features, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 01/55] mmap-alloc: tweak a comment on ppc64, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 02/55] pc: Move compat boolean globals to PCMachineClass, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 03/55] pc: Move legacy_acpi_table_size global to PCMachineClass, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 05/55] pc: Move enforce_aligned_dimm to PCMachineClass, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 04/55] pc: Move acpi_data_size global to PCMachineClass, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 06/55] pc: Remove enforce-aligned-dimm QOM property, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 08/55] hw/acpi: merge pxb adjacent memory/IO ranges, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 07/55] pc: Move option_rom_has_mr/rom_file_has_mr globals to MachineClass, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 10/55] hw/i386: extend pxb query for all PC machines,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 09/55] hw/pxb: introduce pxb-pcie expander for PCIe machines, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 11/55] q35: Remove MCHPCIState.guest_info field, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 12/55] pc: Group and document related PCMachineState/PCMachineclass fields, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 13/55] Add a base IPMI interface, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 15/55] ipmi: Add an external connection simulation interface, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 14/55] ipmi: Add a local BMC simulation, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 17/55] ipmi: Add a BT low-level interface, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 16/55] ipmi: Add an ISA KCS low-level interface, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 18/55] ipmi: Add tests, Michael S. Tsirkin, 2015/12/22
- [Qemu-devel] [PULL 20/55] ipmi: Add migration capability to the IPMI devices., Michael S. Tsirkin, 2015/12/22