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

[Xen-changelog] Do not STI when transitioning from user to kernel mode in



ChangeSet 1.1300, 2005/04/14 23:37:40+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        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@xxxxxxxxxxxxx>



 entry.S |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)


diff -Nru a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S       2005-04-14 19:03:38 -04:00
+++ b/xen/arch/x86/x86_64/entry.S       2005-04-14 19:03:38 -04:00
@@ -19,6 +19,14 @@
         movq (reg),reg;
 
         ALIGN
+/* %rbx: struct exec_domain, interrupts disabled */
+switch_to_kernel:
+        leaq  EDOMAIN_trap_bounce(%rbx),%rdx
+        movq  EDOMAIN_syscall_addr(%rbx),%rax
+        movq  %rax,TRAPBOUNCE_eip(%rdx)
+        movw  $0,TRAPBOUNCE_flags(%rdx)
+        call  create_bounce_frame
+
 /* %rbx: struct exec_domain */
 restore_all_guest:
         RESTORE_ALL
@@ -104,20 +112,12 @@
         pushq $0
         movl  $TRAP_syscall,4(%rsp)
         SAVE_ALL
-        sti
         GET_CURRENT(%rbx)
         testb $TF_kernel_mode,EDOMAIN_thread_flags(%rbx)
-        jnz   hypercall
+        jz    switch_to_kernel
 
-        leaq  EDOMAIN_trap_bounce(%rbx),%rdx
-        movq  EDOMAIN_syscall_addr(%rbx),%rax
-        movq  %rax,TRAPBOUNCE_eip(%rdx)
-        movw  $0,TRAPBOUNCE_flags(%rdx)
-        call  create_bounce_frame
-        jmp   restore_all_guest
-
-/* %rbx: struct exec_domain */
-hypercall:
+/*hypercall:*/
+        sti
         movq  %r10,%rcx
         andq  $(NR_hypercalls-1),%rax
         leaq  SYMBOL_NAME(hypercall_table)(%rip),%r10

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