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

[Xen-changelog] [xen-unstable] tboot, s3: Fix S3 issue of Xen and tboot, since the structure



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1211532524 -3600
# Node ID 4c8fc8def9b30d4d72a418960d168c77d3325ce1
# Parent  fbc8cf8e0d6b3c419c798a77de4db930db0cd6a4
tboot, s3: Fix S3 issue of Xen and tboot, since the structure
acpi_sleep_info is changed but some of the code in Xen is not
synchronized up with this change, which causes Xen S3 failure.

Signed-off-by: Shane Wang <shane.wang@xxxxxxxxx>
---
 xen/arch/x86/acpi/power.c   |   14 +++++++++++---
 xen/include/asm-x86/tboot.h |   15 ++++++++++++---
 2 files changed, 23 insertions(+), 6 deletions(-)

diff -r fbc8cf8e0d6b -r 4c8fc8def9b3 xen/arch/x86/acpi/power.c
--- a/xen/arch/x86/acpi/power.c Fri May 23 09:47:45 2008 +0100
+++ b/xen/arch/x86/acpi/power.c Fri May 23 09:48:44 2008 +0100
@@ -238,9 +238,17 @@ static void tboot_sleep(u8 sleep_state)
 static void tboot_sleep(u8 sleep_state)
 {
    uint32_t shutdown_type;
-   
-   *((struct acpi_sleep_info *)(unsigned long)g_tboot_shared->acpi_sinfo) =
-       acpi_sinfo;
+
+   g_tboot_shared->acpi_sinfo.pm1a_cnt =
+                           (uint16_t)acpi_sinfo.pm1a_cnt_blk.address;
+   g_tboot_shared->acpi_sinfo.pm1b_cnt =
+                           (uint16_t)acpi_sinfo.pm1b_cnt_blk.address;
+   g_tboot_shared->acpi_sinfo.pm1a_evt =
+                           (uint16_t)acpi_sinfo.pm1a_evt_blk.address;
+   g_tboot_shared->acpi_sinfo.pm1b_evt =
+                           (uint16_t)acpi_sinfo.pm1b_evt_blk.address;
+   g_tboot_shared->acpi_sinfo.pm1a_cnt_val = acpi_sinfo.pm1a_cnt_val;
+   g_tboot_shared->acpi_sinfo.pm1b_cnt_val = acpi_sinfo.pm1b_cnt_val;
 
    switch ( sleep_state )
    {
diff -r fbc8cf8e0d6b -r 4c8fc8def9b3 xen/include/asm-x86/tboot.h
--- a/xen/include/asm-x86/tboot.h       Fri May 23 09:47:45 2008 +0100
+++ b/xen/include/asm-x86/tboot.h       Fri May 23 09:48:44 2008 +0100
@@ -46,7 +46,15 @@ typedef struct __attribute__ ((__packed_
 } uuid_t;
 
 /* used to communicate between tboot and the launched kernel (i.e. Xen) */
-#define MAX_TB_ACPI_SINFO_SIZE   64
+
+typedef struct __attribute__ ((__packed__)) {
+    uint16_t pm1a_cnt;
+    uint16_t pm1b_cnt;
+    uint16_t pm1a_evt;
+    uint16_t pm1b_evt;
+    uint16_t pm1a_cnt_val;
+    uint16_t pm1b_cnt_val;
+} tboot_acpi_sleep_info;
 
 typedef struct __attribute__ ((__packed__)) {
     /* version 0x01+ fields: */
@@ -58,8 +66,9 @@ typedef struct __attribute__ ((__packed_
     uint32_t  shutdown_type;     /* type of shutdown (TB_SHUTDOWN_*) */
     uint32_t  s3_tb_wakeup_entry;/* entry point for tboot s3 wake up */
     uint32_t  s3_k_wakeup_entry; /* entry point for xen s3 wake up */
-    uint8_t   acpi_sinfo[MAX_TB_ACPI_SINFO_SIZE];
-                                 /* where kernel put acpi sleep info in Sx */
+    tboot_acpi_sleep_info
+              acpi_sinfo;        /* where kernel put acpi sleep info in Sx */
+    uint8_t   reserved[52];      /* this pad is for compat with old field */
     /* version 0x02+ fields: */
     uint32_t  tboot_base;        /* starting addr for tboot */
     uint32_t  tboot_size;        /* size of tboot */

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