direct-io.hg

changeset 15416:b35b8053012e

Fix x86/64 failsafe callback handling.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Jun 21 18:02:50 2007 +0100 (2007-06-21)
parents 04d4b7b6f5b7
children 015d9abeacfb
files xen/arch/x86/x86_64/compat/entry.S xen/arch/x86/x86_64/entry.S
line diff
     1.1 --- a/xen/arch/x86/x86_64/compat/entry.S	Thu Jun 21 15:17:31 2007 +0100
     1.2 +++ b/xen/arch/x86/x86_64/compat/entry.S	Thu Jun 21 18:02:50 2007 +0100
     1.3 @@ -143,12 +143,12 @@ compat_restore_all_guest:
     1.4  .Lft0:  iretq
     1.5  
     1.6  .section .fixup,"ax"
     1.7 -.Lfx0:  popq  -15*8-8(%rsp)            # error_code/entry_vector
     1.8 -        SAVE_ALL                       # 15*8 bytes pushed
     1.9 -        movq  -8(%rsp),%rsi            # error_code/entry_vector
    1.10 -        sti                            # after stack abuse (-1024(%rsp))
    1.11 +.Lfx0:  sti
    1.12 +        SAVE_ALL
    1.13 +        movq  UREGS_error_code(%rsp),%rsi
    1.14 +        movq  %rsp,%rax
    1.15 +        andq  $~0xf,%rsp
    1.16          pushq $__HYPERVISOR_DS         # SS
    1.17 -        leaq  8(%rsp),%rax
    1.18          pushq %rax                     # RSP
    1.19          pushfq                         # RFLAGS
    1.20          pushq $__HYPERVISOR_CS         # CS
     2.1 --- a/xen/arch/x86/x86_64/entry.S	Thu Jun 21 15:17:31 2007 +0100
     2.2 +++ b/xen/arch/x86/x86_64/entry.S	Thu Jun 21 18:02:50 2007 +0100
     2.3 @@ -57,23 +57,23 @@ 1:      sysretl
     2.4  /* No special register assumptions. */
     2.5  iret_exit_to_guest:
     2.6          addq  $8,%rsp
     2.7 -.Lft1:  iretq
     2.8 +.Lft0:  iretq
     2.9  
    2.10  .section .fixup,"ax"
    2.11 -.Lfx1:  popq  -15*8-8(%rsp)            # error_code/entry_vector
    2.12 -        SAVE_ALL                       # 15*8 bytes pushed
    2.13 -        movq  -8(%rsp),%rsi            # error_code/entry_vector
    2.14 -        sti                            # after stack abuse (-1024(%rsp))
    2.15 +.Lfx0:  sti
    2.16 +        SAVE_ALL
    2.17 +        movq  UREGS_error_code(%rsp),%rsi
    2.18 +        movq  %rsp,%rax
    2.19 +        andq  $~0xf,%rsp
    2.20          pushq $__HYPERVISOR_DS         # SS
    2.21 -        leaq  8(%rsp),%rax
    2.22          pushq %rax                     # RSP
    2.23 -        pushf                          # RFLAGS
    2.24 +        pushfq                         # RFLAGS
    2.25          pushq $__HYPERVISOR_CS         # CS
    2.26 -        leaq  .Ldf1(%rip),%rax
    2.27 +        leaq  .Ldf0(%rip),%rax
    2.28          pushq %rax                     # RIP
    2.29          pushq %rsi                     # error_code/entry_vector
    2.30          jmp   handle_exception
    2.31 -.Ldf1:  GET_CURRENT(%rbx)
    2.32 +.Ldf0:  GET_CURRENT(%rbx)
    2.33          jmp   test_all_events
    2.34  failsafe_callback:
    2.35          GET_CURRENT(%rbx)
    2.36 @@ -88,10 +88,10 @@ 1:      call  create_bounce_frame
    2.37          jmp   test_all_events
    2.38  .previous
    2.39  .section __pre_ex_table,"a"
    2.40 -        .quad .Lft1,.Lfx1
    2.41 +        .quad .Lft0,.Lfx0
    2.42  .previous
    2.43  .section __ex_table,"a"
    2.44 -        .quad .Ldf1,failsafe_callback
    2.45 +        .quad .Ldf0,failsafe_callback
    2.46  .previous
    2.47  
    2.48          ALIGN