[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [Qemu-devel] [PATCH RFC 02/17] hw/acpi: add support for multi
From: |
Marcel Apfelbaum |
Subject: |
[Qemu-ppc] [Qemu-devel] [PATCH RFC 02/17] hw/acpi: add support for multiple root busses |
Date: |
Thu, 22 Jan 2015 21:52:28 +0200 |
If the machine has several root busses, we need to add them to
acpi in order to be properly detected by guests.
Signed-off-by: Marcel Apfelbaum <address@hidden>
---
hw/i386/acpi-build.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 5831450..9837120 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -60,6 +60,8 @@
#include "qom/qom-qobject.h"
#include "exec/ram_addr.h"
+#include "qmp-commands.h"
+
/* These are used to size the ACPI tables for -M pc-i440fx-1.7 and
* -M pc-i440fx-2.0. Even if the actual amount of AML generated grows
* a little bit, there should be plenty of free space since the DSDT
@@ -661,6 +663,34 @@ build_ssdt(AcpiAml *table_aml, GArray *linker,
ssdt =
acpi_def_block("SSDT", 1, ACPI_BUILD_APPNAME6, ACPI_BUILD_APPNAME4, 1);
+ {
+ PciInfoList *info_list, *info;
+ Error *err = NULL;
+
+ info_list = qmp_query_pci(&err);
+ if (err) {
+ error_free(err);
+ return;
+ }
+
+ for (info = info_list; info; info = info->next) {
+ PciInfo *bus_info = info->value;
+
+ if (bus_info->bus == 0) {
+ continue;
+ }
+
+ scope = acpi_scope("\\_SB");
+ dev = acpi_device("PC%.02X", (uint8_t)bus_info->bus);
+ aml_append(&dev, acpi_name_decl("_HID", acpi_string("PNP0A03")));
+ aml_append(&dev,
+ acpi_name_decl("_BBN", acpi_int((uint8_t)bus_info->bus)));
+ aml_append(&scope, dev);
+ aml_append(&ssdt, scope);
+ }
+ qapi_free_PciInfoList(info_list);
+ }
+
scope = acpi_scope("\\_SB.PCI0");
/* build PCI0._CRS */
crs = acpi_resource_template();
--
2.1.0
- [Qemu-ppc] [Qemu-devel] [PATCH RFC 00/17] implement multiple primary busses for pc machines, Marcel Apfelbaum, 2015/01/22
- [Qemu-ppc] [Qemu-devel] [PATCH RFC 02/17] hw/acpi: add support for multiple root busses,
Marcel Apfelbaum <=
- [Qemu-ppc] [Qemu-devel] [PATCH RFC 01/17] acpi: added needed acpi constructs, Marcel Apfelbaum, 2015/01/22
- [Qemu-ppc] [Qemu-devel] [PATCH RFC 03/17] hw/apci: add _PRT method for extra root busses, Marcel Apfelbaum, 2015/01/22
- [Qemu-ppc] [Qemu-devel] [PATCH RFC 04/17] hw/acpi: add _CRS method for extra root busses, Marcel Apfelbaum, 2015/01/22
- [Qemu-ppc] [Qemu-devel] [PATCH RFC 05/17] hw/acpi: remove from root bus 0 the crs resources used by other busses., Marcel Apfelbaum, 2015/01/22
- [Qemu-ppc] [Qemu-devel] [PATCH RFC 07/17] hw/pci: made pci_bus_is_root a PCIBusClass method, Marcel Apfelbaum, 2015/01/22
- [Qemu-ppc] [Qemu-devel] [PATCH RFC 09/17] hw/pci: introduce TYPE_PCI_MAIN_HOST_BRIDGE interface, Marcel Apfelbaum, 2015/01/22
- [Qemu-ppc] [Qemu-devel] [PATCH RFC 10/17] hw/pci: removed 'rootbus nr is 0' assumption from qmp_pci_query, Marcel Apfelbaum, 2015/01/22