]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/x86/kernel/vm86_32.c
x86/entry/32: Pull the MSR_IA32_SYSENTER_CS update code out of native_load_sp0()
[linux.git] / arch / x86 / kernel / vm86_32.c
index 7924a5356c8a9105171f1b07a3911758b815a3ee..5bc1c3ab6287156ce3aef0161874b69d96373c9c 100644 (file)
@@ -54,6 +54,7 @@
 #include <asm/irq.h>
 #include <asm/traps.h>
 #include <asm/vm86.h>
+#include <asm/switch_to.h>
 
 /*
  * Known problems:
@@ -149,6 +150,7 @@ void save_v86_state(struct kernel_vm86_regs *regs, int retval)
        tsk->thread.sp0 = vm86->saved_sp0;
        tsk->thread.sysenter_cs = __KERNEL_CS;
        load_sp0(tss, &tsk->thread);
+       refresh_sysenter_cs(&tsk->thread);
        vm86->saved_sp0 = 0;
        put_cpu();
 
@@ -368,8 +370,10 @@ static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus)
        /* make room for real-mode segments */
        tsk->thread.sp0 += 16;
 
-       if (static_cpu_has(X86_FEATURE_SEP))
+       if (static_cpu_has(X86_FEATURE_SEP)) {
                tsk->thread.sysenter_cs = 0;
+               refresh_sysenter_cs(&tsk->thread);
+       }
 
        load_sp0(tss, &tsk->thread);
        put_cpu();