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

[Xen-changelog] [xen-unstable] x86: fix s3 resume on AMD CPUs



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1245158374 -3600
# Node ID 64a932c92a7c0c6e5e027b55718f5fff2aac9e9c
# Parent  2d68d518038b70bdb1cdb3eb078f1d394dd08437
x86: fix s3 resume on AMD CPUs

Avoid longjmp as it has different semantics than on Intel CPUs in long
mode. Also add a few comments and remove a pointless reload of DS.

Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
---
 xen/arch/x86/acpi/wakeup_prot.S |    6 ++++++
 xen/arch/x86/boot/wakeup.S      |   21 +++++++--------------
 2 files changed, 13 insertions(+), 14 deletions(-)

diff -r 2d68d518038b -r 64a932c92a7c xen/arch/x86/acpi/wakeup_prot.S
--- a/xen/arch/x86/acpi/wakeup_prot.S   Tue Jun 16 14:04:15 2009 +0100
+++ b/xen/arch/x86/acpi/wakeup_prot.S   Tue Jun 16 14:19:34 2009 +0100
@@ -142,6 +142,12 @@ __ret_point:
         LOAD_GREG(sp)
 
 #if defined(__x86_64__)
+        /* Reload code selector */
+        pushq   $(__HYPERVISOR_CS64)
+        leaq    1f(%rip),%rax
+        pushq   %rax
+        lretq
+1:
 
         mov     REF(saved_cr8), %rax
         mov     %rax, %cr8
diff -r 2d68d518038b -r 64a932c92a7c xen/arch/x86/boot/wakeup.S
--- a/xen/arch/x86/boot/wakeup.S        Tue Jun 16 14:04:15 2009 +0100
+++ b/xen/arch/x86/boot/wakeup.S        Tue Jun 16 14:19:34 2009 +0100
@@ -110,6 +110,7 @@ video_flags:    .long 0
         # Add offset for any reference to xen specific symbols
 
 wakeup_32:
+        /* Set up segment registers and initial stack for protected mode */
         mov     $BOOT_DS, %eax
         mov     %eax, %ds
         mov     %eax, %ss
@@ -152,6 +153,7 @@ 1:      wrmsr
 
         wbinvd
 
+        /* Enable paging and flush prefetch queue */
         mov     $0x80050033,%eax /* hi-to-lo: PG,AM,WP,NE,ET,MP,PE */
         mov     %eax,%cr0
         jmp     1f
@@ -163,31 +165,22 @@ 1:
         ljmp    $BOOT_CS64, $bootsym_phys(wakeup_64)
 
         .code64
-        .align  8
-        .word   0,0,0
-lgdt_descr:
-        .word   LAST_RESERVED_GDT_BYTE
-        .quad   boot_cpu_gdt_table - FIRST_RESERVED_GDT_BYTE
-        
 wakeup_64:
-        lgdt    lgdt_descr(%rip)
-        mov     $(__HYPERVISOR_DS64), %eax
-        mov     %eax, %ds
+        /* Jump to high mappings and the higher-level wakeup code. */
+        movq    ret_point(%rip), %rbx
+        jmp     *%rbx
 
-        # long jump to return point, with cs reload
-        rex64 ljmp    *ret_point(%rip)
-
-        .align 8
 ret_point:
         .quad   __ret_point
-        .word   __HYPERVISOR_CS64
 
 #else /* !defined(__x86_64__) */
+
         lgdt    gdt_descr
         mov     $(__HYPERVISOR_DS), %eax
         mov     %eax, %ds
 
         ljmp    $(__HYPERVISOR_CS), $__ret_point
+
 #endif
 
 bogus_saved_magic:

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