[Qemu-devel] [PATCH 19/26] hw: acpi: reduced: Add MCFG support

Samuel Ortiz posted 27 patches 7 years ago
Only 26 patches received!
[Qemu-devel] [PATCH 19/26] hw: acpi: reduced: Add MCFG support
Posted by Samuel Ortiz 7 years ago
From: Yang Zhong <yang.zhong@intel.com>

For PCIe based platform, we need to add an MCFG table to the
hardware-reduced DSDT.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 hw/acpi/reduced.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/acpi/reduced.c b/hw/acpi/reduced.c
index 364b105f58..0f6397c740 100644
--- a/hw/acpi/reduced.c
+++ b/hw/acpi/reduced.c
@@ -94,6 +94,7 @@ static void acpi_reduced_build(MachineState *ms, AcpiBuildTables *tables,
     Range pci_hole, pci_hole64;
     Object *pci_host;
     PCIBus *bus = NULL;
+    AcpiMcfgInfo mcfg;
     GArray *tables_blob = tables->table_data;
 
     acpi_get_pci_holes(&pci_hole, &pci_hole64);
@@ -127,6 +128,12 @@ static void acpi_reduced_build(MachineState *ms, AcpiBuildTables *tables,
     acpi_add_table(table_offsets, tables_blob);
     mc->firmware_build_methods.acpi.madt(tables_blob, tables->linker, ms, conf);
 
+    if (acpi_get_mcfg(&mcfg)) {
+        acpi_add_table(table_offsets, tables_blob);
+        mc->firmware_build_methods.acpi.mcfg(tables_blob,
+                                             tables->linker, &mcfg);
+    }
+
     /* RSDT is pointed to by RSDP */
     xsdt = tables_blob->len;
     build_xsdt(tables_blob, tables->linker, table_offsets, NULL, NULL);
-- 
2.17.2