[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V7 11/24] hw/i386: query only for q35/pc when lookin
From: |
Marcel Apfelbaum |
Subject: |
[Qemu-devel] [PATCH V7 11/24] hw/i386: query only for q35/pc when looking for pci host bridge |
Date: |
Mon, 25 May 2015 18:33:49 +0300 |
Because of the PXB hosts we cannot simply query TYPE_PCI_HOST_BRIDGE anymore.
On i386 arch we only have two pci hosts, so we can look only for them.
Signed-off-by: Marcel Apfelbaum <address@hidden>
---
hw/i386/acpi-build.c | 34 +++++++++++++++++++++++++---------
1 file changed, 25 insertions(+), 9 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 73259e7..166a02f 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -239,13 +239,32 @@ static void acpi_get_misc_info(AcpiMiscInfo *info)
info->applesmc_io_base = applesmc_port();
}
+/*
+ * Because of the PXB hosts we cannot simply query TYPE_PCI_HOST_BRIDGE.
+ * On i386 arch we only have two pci hosts, so we can look only for them.
+ */
+static Object *acpi_get_i386_pci_host(void)
+{
+ PCIHostState *host;
+
+ host = OBJECT_CHECK(PCIHostState,
+ object_resolve_path("/machine/i440fx", NULL),
+ TYPE_PCI_HOST_BRIDGE);
+ if (!host) {
+ host = OBJECT_CHECK(PCIHostState,
+ object_resolve_path("/machine/q35", NULL),
+ TYPE_PCI_HOST_BRIDGE);
+ }
+
+ return OBJECT(host);
+}
+
static void acpi_get_pci_info(PcPciInfo *info)
{
Object *pci_host;
- bool ambiguous;
- pci_host = object_resolve_path_type("", TYPE_PCI_HOST_BRIDGE, &ambiguous);
- g_assert(!ambiguous);
+
+ pci_host = acpi_get_i386_pci_host();
g_assert(pci_host);
info->w32.begin = object_property_get_int(pci_host,
@@ -952,10 +971,9 @@ build_ssdt(GArray *table_data, GArray *linker,
{
Object *pci_host;
PCIBus *bus = NULL;
- bool ambiguous;
- pci_host = object_resolve_path_type("", TYPE_PCI_HOST_BRIDGE,
&ambiguous);
- if (!ambiguous && pci_host) {
+ pci_host = acpi_get_i386_pci_host();
+ if (pci_host) {
bus = PCI_HOST_BRIDGE(pci_host)->bus;
}
@@ -1272,10 +1290,8 @@ static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg)
{
Object *pci_host;
QObject *o;
- bool ambiguous;
- pci_host = object_resolve_path_type("", TYPE_PCI_HOST_BRIDGE, &ambiguous);
- g_assert(!ambiguous);
+ pci_host = acpi_get_i386_pci_host();
g_assert(pci_host);
o = object_property_get_qobject(pci_host, PCIE_HOST_MCFG_BASE, NULL);
--
2.1.0
- [Qemu-devel] [PATCH V7 01/24] acpi: add aml_or() term, (continued)
- [Qemu-devel] [PATCH V7 01/24] acpi: add aml_or() term, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 03/24] acpi: add aml_lless() term, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 04/24] acpi: add aml_index() term, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 02/24] acpi: add aml_add() term, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 05/24] acpi: add aml_shiftleft() term, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 06/24] acpi: add aml_shiftright() term, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 07/24] acpi: add aml_increment() term, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 08/24] acpi: add aml_while() term, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 09/24] hw/pci: made pci_bus_is_root a PCIBusClass method, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 10/24] hw/pci: made pci_bus_num a PCIBusClass method, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 11/24] hw/i386: query only for q35/pc when looking for pci host bridge,
Marcel Apfelbaum <=
- [Qemu-devel] [PATCH V7 12/24] hw/pci: extend PCI config access to support devices behind PXB, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 14/24] hw/apci: add _PRT method for extra PCI root busses, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 13/24] hw/acpi: add support for i440fx 'snooping' root busses, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 15/24] hw/acpi: add _CRS method for extra root busses, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 16/24] hw/acpi: remove from root bus 0 the crs resources used by other buses., Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 17/24] hw/pci: removed 'rootbus nr is 0' assumption from qmp_pci_query, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 18/24] hw/pci: introduce PCI Expander Bridge (PXB), Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 19/24] hw/pci: inform bios if the system has extra pci root buses, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 21/24] hw/pci: add support for NUMA nodes, Marcel Apfelbaum, 2015/05/25
- [Qemu-devel] [PATCH V7 20/24] hw/pxb: add map_irq func, Marcel Apfelbaum, 2015/05/25