ia64/xen-unstable

changeset 17711:4c8fc8def9b3

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@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri May 23 09:48:44 2008 +0100 (2008-05-23)
parents fbc8cf8e0d6b
children 91a9e28aed46
files xen/arch/x86/acpi/power.c xen/include/asm-x86/tboot.h
line diff
     1.1 --- a/xen/arch/x86/acpi/power.c	Fri May 23 09:47:45 2008 +0100
     1.2 +++ b/xen/arch/x86/acpi/power.c	Fri May 23 09:48:44 2008 +0100
     1.3 @@ -238,9 +238,17 @@ static int acpi_get_wake_status(void)
     1.4  static void tboot_sleep(u8 sleep_state)
     1.5  {
     1.6     uint32_t shutdown_type;
     1.7 -   
     1.8 -   *((struct acpi_sleep_info *)(unsigned long)g_tboot_shared->acpi_sinfo) =
     1.9 -       acpi_sinfo;
    1.10 +
    1.11 +   g_tboot_shared->acpi_sinfo.pm1a_cnt =
    1.12 +                           (uint16_t)acpi_sinfo.pm1a_cnt_blk.address;
    1.13 +   g_tboot_shared->acpi_sinfo.pm1b_cnt =
    1.14 +                           (uint16_t)acpi_sinfo.pm1b_cnt_blk.address;
    1.15 +   g_tboot_shared->acpi_sinfo.pm1a_evt =
    1.16 +                           (uint16_t)acpi_sinfo.pm1a_evt_blk.address;
    1.17 +   g_tboot_shared->acpi_sinfo.pm1b_evt =
    1.18 +                           (uint16_t)acpi_sinfo.pm1b_evt_blk.address;
    1.19 +   g_tboot_shared->acpi_sinfo.pm1a_cnt_val = acpi_sinfo.pm1a_cnt_val;
    1.20 +   g_tboot_shared->acpi_sinfo.pm1b_cnt_val = acpi_sinfo.pm1b_cnt_val;
    1.21  
    1.22     switch ( sleep_state )
    1.23     {
     2.1 --- a/xen/include/asm-x86/tboot.h	Fri May 23 09:47:45 2008 +0100
     2.2 +++ b/xen/include/asm-x86/tboot.h	Fri May 23 09:48:44 2008 +0100
     2.3 @@ -46,7 +46,15 @@ typedef struct __attribute__ ((__packed_
     2.4  } uuid_t;
     2.5  
     2.6  /* used to communicate between tboot and the launched kernel (i.e. Xen) */
     2.7 -#define MAX_TB_ACPI_SINFO_SIZE   64
     2.8 +
     2.9 +typedef struct __attribute__ ((__packed__)) {
    2.10 +    uint16_t pm1a_cnt;
    2.11 +    uint16_t pm1b_cnt;
    2.12 +    uint16_t pm1a_evt;
    2.13 +    uint16_t pm1b_evt;
    2.14 +    uint16_t pm1a_cnt_val;
    2.15 +    uint16_t pm1b_cnt_val;
    2.16 +} tboot_acpi_sleep_info;
    2.17  
    2.18  typedef struct __attribute__ ((__packed__)) {
    2.19      /* version 0x01+ fields: */
    2.20 @@ -58,8 +66,9 @@ typedef struct __attribute__ ((__packed_
    2.21      uint32_t  shutdown_type;     /* type of shutdown (TB_SHUTDOWN_*) */
    2.22      uint32_t  s3_tb_wakeup_entry;/* entry point for tboot s3 wake up */
    2.23      uint32_t  s3_k_wakeup_entry; /* entry point for xen s3 wake up */
    2.24 -    uint8_t   acpi_sinfo[MAX_TB_ACPI_SINFO_SIZE];
    2.25 -                                 /* where kernel put acpi sleep info in Sx */
    2.26 +    tboot_acpi_sleep_info
    2.27 +              acpi_sinfo;        /* where kernel put acpi sleep info in Sx */
    2.28 +    uint8_t   reserved[52];      /* this pad is for compat with old field */
    2.29      /* version 0x02+ fields: */
    2.30      uint32_t  tboot_base;        /* starting addr for tboot */
    2.31      uint32_t  tboot_size;        /* size of tboot */