Mailing List Archive

Do not STI when transitioning from user to kernel mode in
ChangeSet 1.1300, 2005/04/14 23:37:40+01:00, kaf24@firebug.cl.cam.ac.uk

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>



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@lists.xensource.com
http://lists.xensource.com/xen-changelog