diff -r 112680f620bf xen/arch/x86/acpi/wakeup_prot.S --- a/xen/arch/x86/acpi/wakeup_prot.S Mon Jun 08 18:23:57 2009 +0100 +++ b/xen/arch/x86/acpi/wakeup_prot.S Wed Jun 10 15:15:16 2009 +0200 @@ -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 112680f620bf xen/arch/x86/boot/wakeup.S --- a/xen/arch/x86/boot/wakeup.S Mon Jun 08 18:23:57 2009 +0100 +++ b/xen/arch/x86/boot/wakeup.S Wed Jun 10 15:15:16 2009 +0200 @@ -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,8 +153,10 @@ 1: wrmsr wbinvd + /* Enable paging */ mov $0x80050033,%eax /* hi-to-lo: PG,AM,WP,NE,ET,MP,PE */ mov %eax,%cr0 + /* Flush prefetch queue */ jmp 1f 1: @@ -174,8 +177,11 @@ wakeup_64: mov $(__HYPERVISOR_DS64), %eax mov %eax, %ds - # long jump to return point, with cs reload - rex64 ljmp *ret_point(%rip) + /* Continue with wakeup in the high-level wakeup code. + * Reload cs there. + */ + movq ret_point(%rip), %rbx + jmp *%rbx .align 8 ret_point: