WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] x86: fix s3 resume on AMD CPUs
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 16 Jun 2009 06:45:40 -0700
Delivery-date: Tue, 16 Jun 2009 06:48:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1245159111 -3600
# Node ID 4c41b0e80e13c6f5d6cfe65ad3bb6756ce40fbb2
# Parent  77bf68bae18499d4e04dcd29cfc281f6c3c322c9
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-unstable changeset:   19770:64a932c92a7c
xen-unstable date:        Tue Jun 16 14:19:34 2009 +0100
---
 xen/arch/x86/acpi/wakeup_prot.S |    6 ++++++
 xen/arch/x86/boot/wakeup.S      |   21 +++++++--------------
 2 files changed, 13 insertions(+), 14 deletions(-)

diff -r 77bf68bae184 -r 4c41b0e80e13 xen/arch/x86/acpi/wakeup_prot.S
--- a/xen/arch/x86/acpi/wakeup_prot.S   Tue Jun 16 14:29:34 2009 +0100
+++ b/xen/arch/x86/acpi/wakeup_prot.S   Tue Jun 16 14:31:51 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 77bf68bae184 -r 4c41b0e80e13 xen/arch/x86/boot/wakeup.S
--- a/xen/arch/x86/boot/wakeup.S        Tue Jun 16 14:29:34 2009 +0100
+++ b/xen/arch/x86/boot/wakeup.S        Tue Jun 16 14:31:51 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.4-testing] x86: fix s3 resume on AMD CPUs, Xen patchbot-3.4-testing <=