direct-io.hg

changeset 4533:c62f4ac13428

bitkeeper revision 1.1300 (425ef0b4lXDHXsulXDmrVOvOZAhPXQ)

Do not STI when transitioning from user to kernel mode in
x86/64 Xen. Otherwise, by directly entering restore_all_guest
without first executing test_all_events, we risk ignoring
pending softirq and event-delivery work.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Apr 14 22:37:40 2005 +0000 (2005-04-14)
parents b4ebb22003b1
children 22de1b327a43
files xen/arch/x86/x86_64/entry.S
line diff
     1.1 --- a/xen/arch/x86/x86_64/entry.S	Thu Apr 14 22:30:46 2005 +0000
     1.2 +++ b/xen/arch/x86/x86_64/entry.S	Thu Apr 14 22:37:40 2005 +0000
     1.3 @@ -19,6 +19,14 @@
     1.4          movq (reg),reg;
     1.5  
     1.6          ALIGN
     1.7 +/* %rbx: struct exec_domain, interrupts disabled */
     1.8 +switch_to_kernel:
     1.9 +        leaq  EDOMAIN_trap_bounce(%rbx),%rdx
    1.10 +        movq  EDOMAIN_syscall_addr(%rbx),%rax
    1.11 +        movq  %rax,TRAPBOUNCE_eip(%rdx)
    1.12 +        movw  $0,TRAPBOUNCE_flags(%rdx)
    1.13 +        call  create_bounce_frame
    1.14 +
    1.15  /* %rbx: struct exec_domain */
    1.16  restore_all_guest:
    1.17          RESTORE_ALL
    1.18 @@ -104,20 +112,12 @@ ENTRY(syscall_enter)
    1.19          pushq $0
    1.20          movl  $TRAP_syscall,4(%rsp)
    1.21          SAVE_ALL
    1.22 -        sti
    1.23          GET_CURRENT(%rbx)
    1.24          testb $TF_kernel_mode,EDOMAIN_thread_flags(%rbx)
    1.25 -        jnz   hypercall
    1.26 +        jz    switch_to_kernel
    1.27  
    1.28 -        leaq  EDOMAIN_trap_bounce(%rbx),%rdx
    1.29 -        movq  EDOMAIN_syscall_addr(%rbx),%rax
    1.30 -        movq  %rax,TRAPBOUNCE_eip(%rdx)
    1.31 -        movw  $0,TRAPBOUNCE_flags(%rdx)
    1.32 -        call  create_bounce_frame
    1.33 -        jmp   restore_all_guest
    1.34 -
    1.35 -/* %rbx: struct exec_domain */
    1.36 -hypercall:
    1.37 +/*hypercall:*/
    1.38 +        sti
    1.39          movq  %r10,%rcx
    1.40          andq  $(NR_hypercalls-1),%rax
    1.41          leaq  SYMBOL_NAME(hypercall_table)(%rip),%r10