From: Marcel Apfelbaum <marcel@redhat.com>
To: qemu-devel@nongnu.org
Cc: ehabkost@redhat.com, mst@redhat.com, armbru@redhat.com,
kraxel@redhat.com, laine@redhat.com, pbonzini@redhat.com,
marcel@redhat.com, imammedo@redhat.com, lersek@redhat.com,
rth@twiddle.net
Subject: [Qemu-devel] [PATCH V3 3/3] hw/i386: extend pxb query for all PC machines
Date: Thu, 26 Nov 2015 18:00:28 +0200 [thread overview]
Message-ID: <1448553628-5446-4-git-send-email-marcel@redhat.com> (raw)
In-Reply-To: <1448553628-5446-1-git-send-email-marcel@redhat.com>
Add bus property to PC machines and use it when looking
for primary PCI root bus (bus 0).
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
---
hw/i386/acpi-build.c | 3 +--
hw/i386/pc.c | 2 +-
hw/i386/pc_piix.c | 1 +
hw/i386/pc_q35.c | 1 +
include/hw/i386/pc.h | 1 +
5 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 736b252..bca3f06 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 5e20e07..07697ed 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1174,7 +1174,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 07d0baa..ca6ef9a 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -197,6 +197,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 0fdae09..822b3e5 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -192,6 +192,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,
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 854c330..e42771c 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -41,6 +41,7 @@ struct PCMachineState {
OnOffAuto smm;
bool enforce_aligned_dimm;
ram_addr_t below_4g_mem_size, above_4g_mem_size;
+ PCIBus *bus;
};
#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
--
2.1.0
next prev parent reply other threads:[~2015-11-26 16:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-26 16:00 [Qemu-devel] [PATCH V3 0/3] hw/pcie: Multi-root support for Q35 Marcel Apfelbaum
2015-11-26 16:00 ` [Qemu-devel] [PATCH V3 1/3] hw/acpi: merge pxb adjacent memory/IO ranges Marcel Apfelbaum
2015-11-26 16:00 ` [Qemu-devel] [PATCH V3 2/3] hw/pxb: introduce pxb-pcie expander for PCIe machines Marcel Apfelbaum
2015-11-26 16:00 ` Marcel Apfelbaum [this message]
2015-11-27 17:28 ` [Qemu-devel] [PATCH V3 3/3] hw/i386: extend pxb query for all PC machines Eduardo Habkost
2015-11-29 8:46 ` Marcel Apfelbaum
2015-11-30 15:07 ` Eduardo Habkost
2015-12-01 14:07 ` Marcel Apfelbaum
2015-12-01 14:48 ` Eduardo Habkost
2015-12-01 14:55 ` Marcel Apfelbaum
2015-12-01 15:09 ` Eduardo Habkost
2015-12-01 16:50 ` Marcel Apfelbaum
2015-12-01 17:10 ` Eduardo Habkost
2015-12-01 18:20 ` Eduardo Habkost
2015-12-01 20:53 ` Marcel Apfelbaum
2015-12-01 22:33 ` Eduardo Habkost
2015-11-26 17:01 ` [Qemu-devel] [PATCH V3 0/3] hw/pcie: Multi-root support for Q35 Laszlo Ersek
2015-11-26 18:35 ` Marcel Apfelbaum
2015-11-27 17:04 ` Igor Mammedov
2015-11-29 8:53 ` Marcel Apfelbaum
2015-11-29 12:37 ` Marcel Apfelbaum
2015-11-30 5:23 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1448553628-5446-4-git-send-email-marcel@redhat.com \
--to=marcel@redhat.com \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=kraxel@redhat.com \
--cc=laine@redhat.com \
--cc=lersek@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.