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

[Xen-changelog] [xen-unstable] hvmloader: Load DSDT table from parameter



# HG changeset patch
# User Anthony PERARD <anthony.perard@xxxxxxxxxx>
# Date 1319818667 -3600
# Node ID 2e16d8e6a965be8f62c99c6e456988cfa72b7e1d
# Parent  1a912ce93b506a185b54fd97986214e6eff8a0bc
hvmloader: Load DSDT table from parameter

In order to have two different DSDT tables for rombios and SeaBIOS,
this patch introduce a new parameter to acpi_build_tables() which
contain the DSDT table to load.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Committed-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 1a912ce93b50 -r 2e16d8e6a965 tools/firmware/hvmloader/acpi/acpi2_0.h
--- a/tools/firmware/hvmloader/acpi/acpi2_0.h   Fri Oct 28 17:16:51 2011 +0100
+++ b/tools/firmware/hvmloader/acpi/acpi2_0.h   Fri Oct 28 17:17:47 2011 +0100
@@ -391,7 +391,14 @@
 
 #pragma pack ()
 
-void acpi_build_tables(unsigned int physical);
+struct acpi_config {
+    unsigned char *dsdt_anycpu;
+    int dsdt_anycpu_len;
+    unsigned char *dsdt_15cpu;
+    int dsdt_15cpu_len;
+};
+
+void acpi_build_tables(struct acpi_config *config, unsigned int physical);
 
 #endif /* _ACPI_2_0_H_ */
 
diff -r 1a912ce93b50 -r 2e16d8e6a965 tools/firmware/hvmloader/acpi/build.c
--- a/tools/firmware/hvmloader/acpi/build.c     Fri Oct 28 17:16:51 2011 +0100
+++ b/tools/firmware/hvmloader/acpi/build.c     Fri Oct 28 17:17:47 2011 +0100
@@ -47,17 +47,6 @@
     uint32_t madt_lapic0_addr;  /* 16   - Address of first MADT LAPIC struct */
 };
 
-/*
- * Alternative DSDTs we get linked against. A cover-all DSDT for up to the
- * implementation-defined maximum number of VCPUs, and an alternative for use
- * when a guest can only have up to 15 VCPUs.
- * 
- * The latter is required for Windows 2000, which experiences a BSOD of
- * KMODE_EXCEPTION_NOT_HANDLED if it sees more than 15 processor objects.
- */
-extern unsigned char dsdt_anycpu[], dsdt_15cpu;
-extern int dsdt_anycpu_len, dsdt_15cpu_len;
-
 /* Number of processor objects in the chosen DSDT. */
 static unsigned int nr_processor_objects;
 
@@ -285,7 +274,7 @@
     return nr_tables;
 }
 
-void acpi_build_tables(unsigned int physical)
+void acpi_build_tables(struct acpi_config *config, unsigned int physical)
 {
     struct acpi_info *acpi_info = (struct acpi_info 
*)ACPI_INFO_PHYSICAL_ADDRESS;
     struct acpi_20_rsdp *rsdp;
@@ -308,18 +297,26 @@
     if (!facs) goto oom;
     memcpy(facs, &Facs, sizeof(struct acpi_20_facs));
 
-    if ( hvm_info->nr_vcpus <= 15 )
+    /*
+     * Alternative DSDTs we get linked against. A cover-all DSDT for up to the
+     * implementation-defined maximum number of VCPUs, and an alternative for 
use
+     * when a guest can only have up to 15 VCPUs.
+     *
+     * The latter is required for Windows 2000, which experiences a BSOD of
+     * KMODE_EXCEPTION_NOT_HANDLED if it sees more than 15 processor objects.
+     */
+    if ( hvm_info->nr_vcpus <= 15 && config->dsdt_15cpu)
     {
-        dsdt = mem_alloc(dsdt_15cpu_len, 16);
+        dsdt = mem_alloc(config->dsdt_15cpu_len, 16);
         if (!dsdt) goto oom;
-        memcpy(dsdt, &dsdt_15cpu, dsdt_15cpu_len);
+        memcpy(dsdt, config->dsdt_15cpu, config->dsdt_15cpu_len);
         nr_processor_objects = 15;
     }
     else
     {
-        dsdt = mem_alloc(dsdt_anycpu_len, 16);
+        dsdt = mem_alloc(config->dsdt_anycpu_len, 16);
         if (!dsdt) goto oom;
-        memcpy(dsdt, &dsdt_anycpu, dsdt_anycpu_len);
+        memcpy(dsdt, config->dsdt_anycpu, config->dsdt_anycpu_len);
         nr_processor_objects = HVM_MAX_VCPUS;
     }
 
diff -r 1a912ce93b50 -r 2e16d8e6a965 tools/firmware/hvmloader/rombios.c
--- a/tools/firmware/hvmloader/rombios.c        Fri Oct 28 17:16:51 2011 +0100
+++ b/tools/firmware/hvmloader/rombios.c        Fri Oct 28 17:17:47 2011 +0100
@@ -40,6 +40,9 @@
 #define ROMBIOS_MAXOFFSET      0x0000FFFF
 #define ROMBIOS_END            (ROMBIOS_BEGIN + ROMBIOS_SIZE)
 
+extern unsigned char dsdt_anycpu[], dsdt_15cpu[];
+extern int dsdt_anycpu_len, dsdt_15cpu_len;
+
 static void rombios_setup_e820(void)
 {
     /*
@@ -112,7 +115,14 @@
 
 static void rombios_acpi_build_tables(void)
 {
-    acpi_build_tables(ACPI_PHYSICAL_ADDRESS);
+    struct acpi_config config = {
+        .dsdt_anycpu = dsdt_anycpu,
+        .dsdt_anycpu_len = dsdt_anycpu_len,
+        .dsdt_15cpu = dsdt_15cpu,
+        .dsdt_15cpu_len = dsdt_15cpu_len,
+    };
+
+    acpi_build_tables(&config, ACPI_PHYSICAL_ADDRESS);
 }
 
 static void rombios_create_mp_tables(void)
diff -r 1a912ce93b50 -r 2e16d8e6a965 tools/firmware/hvmloader/seabios.c
--- a/tools/firmware/hvmloader/seabios.c        Fri Oct 28 17:16:51 2011 +0100
+++ b/tools/firmware/hvmloader/seabios.c        Fri Oct 28 17:17:47 2011 +0100
@@ -31,6 +31,9 @@
 #define ROM_INCLUDE_SEABIOS
 #include "roms.inc"
 
+extern unsigned char dsdt_anycpu_qemu_xen[];
+extern int dsdt_anycpu_qemu_xen_len;
+
 struct seabios_info {
     char signature[14]; /* XenHVMSeaBIOS\0 */
     uint8_t length;     /* Length of this struct */
@@ -91,7 +94,14 @@
 static void seabios_acpi_build_tables(void)
 {
     uint32_t rsdp = (uint32_t)scratch_alloc(sizeof(struct acpi_20_rsdp), 0);
-    acpi_build_tables(rsdp);
+    struct acpi_config config = {
+        .dsdt_anycpu = dsdt_anycpu_qemu_xen,
+        .dsdt_anycpu_len = dsdt_anycpu_qemu_xen_len,
+        .dsdt_15cpu = NULL,
+        .dsdt_15cpu_len = 0,
+    };
+
+    acpi_build_tables(&config, rsdp);
     add_table(rsdp);
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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