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

[Xen-changelog] [IA64] Correctly set aml code of domU dsdt.



# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 8df6a730817826de45fca3c068f06c548a86f5ae
# Parent  2de2952715d92b6e7a7b2a7c2db35e8b893f7c56
[IA64] Correctly set aml code of domU dsdt.

Previously it was corrupted (bad length).

Signed-off-by: Tristan Gingold <tristan.gingold@xxxxxxxx>
---
 xen/arch/ia64/xen/dom_fw.c |   37 ++++++++++++++++++++++++++++---------
 1 files changed, 28 insertions(+), 9 deletions(-)

diff -r 2de2952715d9 -r 8df6a7308178 xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c        Wed May 17 15:52:55 2006 -0600
+++ b/xen/arch/ia64/xen/dom_fw.c        Wed May 17 15:53:00 2006 -0600
@@ -541,7 +541,7 @@ struct fake_acpi_tables {
        struct fadt_descriptor_rev2 fadt;
        struct facs_descriptor_rev2 facs;
        struct acpi_table_header dsdt;
-       u8 aml[16];
+       u8 aml[8 + 11 * MAX_VIRT_CPUS];
        struct acpi_table_madt madt;
        struct acpi_table_lsapic lsapic[MAX_VIRT_CPUS];
        u8 pm1a_evt_blk[4];
@@ -561,6 +561,7 @@ dom_fw_fake_acpi(struct domain *d, struc
        struct acpi_table_madt *madt = &tables->madt;
        struct acpi_table_lsapic *lsapic = tables->lsapic;
        int i;
+       int aml_len;
 
        memset(tables, 0, sizeof(struct fake_acpi_tables));
 
@@ -629,7 +630,6 @@ dom_fw_fake_acpi(struct domain *d, struc
        /* setup DSDT with trivial namespace. */ 
        strncpy(dsdt->signature, DSDT_SIG, 4);
        dsdt->revision = 1;
-       dsdt->length = sizeof(struct acpi_table_header) + sizeof(tables->aml);
        strcpy(dsdt->oem_id, "XEN");
        strcpy(dsdt->oem_table_id, "Xen/ia64");
        strcpy(dsdt->asl_compiler_id, "XEN");
@@ -637,15 +637,33 @@ dom_fw_fake_acpi(struct domain *d, struc
 
        /* Trivial namespace, avoids ACPI CA complaints */
        tables->aml[0] = 0x10; /* Scope */
-       tables->aml[1] = 0x12; /* length/offset to next object */
-       strncpy((char *)&tables->aml[2], "_SB_", 4);
+       tables->aml[1] = 0x40; /* length/offset to next object (patched) */
+       tables->aml[2] = 0x00;
+       strncpy((char *)&tables->aml[3], "_SB_", 4);
 
        /* The processor object isn't absolutely necessary, revist for SMP */
-       tables->aml[6] = 0x5b; /* processor object */
-       tables->aml[7] = 0x83;
-       tables->aml[8] = 0x0b; /* next */
-       strncpy((char *)&tables->aml[9], "CPU0", 4);
-
+       aml_len = 7;
+       for (i = 0; i < 3; i++) {
+               unsigned char *p = tables->aml + aml_len;
+               p[0] = 0x5b; /* processor object */
+               p[1] = 0x83;
+               p[2] = 0x0b; /* next */
+               p[3] = 'C';
+               p[4] = 'P';
+               snprintf ((char *)p + 5, 3, "%02x", i);
+               if (i < 16)
+                       p[5] = 'U';
+               p[7] = i;       /* acpi_id */
+               p[8] = 0;       /* pblk_addr */
+               p[9] = 0;
+               p[10] = 0;
+               p[11] = 0;
+               p[12] = 0;      /* pblk_len */
+               aml_len += 13;
+       }
+       tables->aml[1] = 0x40 + ((aml_len - 1) & 0x0f);
+       tables->aml[2] = (aml_len - 1) >> 4;
+       dsdt->length = sizeof(struct acpi_table_header) + aml_len;
        dsdt->checksum = generate_acpi_checksum(dsdt, dsdt->length);
 
        /* setup MADT */
@@ -662,6 +680,7 @@ dom_fw_fake_acpi(struct domain *d, struc
        for (i = 0; i < MAX_VIRT_CPUS; i++) {
                lsapic[i].header.type = ACPI_MADT_LSAPIC;
                lsapic[i].header.length = sizeof(struct acpi_table_lsapic);
+               lsapic[i].acpi_id = i;
                lsapic[i].id = i;
                lsapic[i].eid = 0;
                lsapic[i].flags.enabled = (d->vcpu[i] != NULL);

_______________________________________________
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®.