[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 05/17] hvmloader: add Q35 DSDT table loading



This patch allows to select Q35 DSDT table in the function
hvmloader_acpi_build_tables(). The machine_type global variable is used
to select a proper table (i440/q35).

As we are bound to the qemu-xen device model for Q35, there is no need
to initialize config->dsdt_15cpu/config->dsdt_15cpu_len fields.

Signed-off-by: Alexey Gerasimenko <x1917x@xxxxxxxxx>
Signed-off-by: Thierry Escande <thierry.escande@xxxxxxxxxx>
---
 tools/firmware/hvmloader/util.c | 17 +++++++++++++++--
 tools/firmware/hvmloader/util.h |  2 ++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index f9116bea4d..45519ea583 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -885,8 +885,21 @@ void hvmloader_acpi_build_tables(struct acpi_config 
*config,
     s = xenstore_read("platform/device-model", "");
     if ( !strncmp(s, "qemu_xen", 9) )
     {
-        config->dsdt_anycpu = dsdt_i440_anycpu_qemu_xen;
-        config->dsdt_anycpu_len = dsdt_i440_anycpu_qemu_xen_len;
+        switch ( machine_type )
+        {
+        case MACHINE_TYPE_Q35:
+            config->dsdt_anycpu = dsdt_q35_anycpu_qemu_xen;
+            config->dsdt_anycpu_len = dsdt_q35_anycpu_qemu_xen_len;
+            break;
+        case MACHINE_TYPE_I440:
+            config->dsdt_anycpu = dsdt_i440_anycpu_qemu_xen;
+            config->dsdt_anycpu_len = dsdt_i440_anycpu_qemu_xen_len;
+            break;
+        default:
+            /* Not likely to happen */
+            BUG();
+        }
+
         config->dsdt_15cpu = NULL;
         config->dsdt_15cpu_len = 0;
     }
diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 2f37504aca..4641ca0c46 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -393,7 +393,9 @@ bool check_overlap(uint64_t start, uint64_t size,
                    uint64_t reserved_start, uint64_t reserved_size);
 
 extern const unsigned char dsdt_i440_anycpu_qemu_xen[], dsdt_anycpu[], 
dsdt_15cpu[];
+extern const unsigned char dsdt_q35_anycpu_qemu_xen[];
 extern const int dsdt_i440_anycpu_qemu_xen_len, dsdt_anycpu_len, 
dsdt_15cpu_len;
+extern const int dsdt_q35_anycpu_qemu_xen_len;
 
 unsigned long acpi_pages_allocated(void);
 
-- 
2.51.0



--
Thierry Escande | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.