|
@@ -287,10 +287,9 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
|
|
|
info->regs.pt.ds = 0;
|
|
|
info->regs.pt.es = 0;
|
|
|
info->regs.pt.fs = 0;
|
|
|
-
|
|
|
-/* we are clearing gs later just before "jmp resume_userspace",
|
|
|
- * because it is not saved/restored.
|
|
|
- */
|
|
|
+#ifndef CONFIG_X86_32_LAZY_GS
|
|
|
+ info->regs.pt.gs = 0;
|
|
|
+#endif
|
|
|
|
|
|
/*
|
|
|
* The flags register is also special: we cannot trust that the user
|
|
@@ -343,7 +342,9 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
|
|
|
__asm__ __volatile__(
|
|
|
"movl %0,%%esp\n\t"
|
|
|
"movl %1,%%ebp\n\t"
|
|
|
+#ifdef CONFIG_X86_32_LAZY_GS
|
|
|
"mov %2, %%gs\n\t"
|
|
|
+#endif
|
|
|
"jmp resume_userspace"
|
|
|
: /* no outputs */
|
|
|
:"r" (&info->regs), "r" (task_thread_info(tsk)), "r" (0));
|