diff options
-rw-r--r-- | arch/x86/kernel/entry_32.S | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 79d97e68f042..7b784f4ef1e4 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -98,12 +98,6 @@ | |||
98 | #endif | 98 | #endif |
99 | .endm | 99 | .endm |
100 | 100 | ||
101 | #ifdef CONFIG_VM86 | ||
102 | #define resume_userspace_sig check_userspace | ||
103 | #else | ||
104 | #define resume_userspace_sig resume_userspace | ||
105 | #endif | ||
106 | |||
107 | /* | 101 | /* |
108 | * User gs save/restore | 102 | * User gs save/restore |
109 | * | 103 | * |
@@ -327,10 +321,19 @@ ret_from_exception: | |||
327 | preempt_stop(CLBR_ANY) | 321 | preempt_stop(CLBR_ANY) |
328 | ret_from_intr: | 322 | ret_from_intr: |
329 | GET_THREAD_INFO(%ebp) | 323 | GET_THREAD_INFO(%ebp) |
330 | check_userspace: | 324 | resume_userspace_sig: |
325 | #ifdef CONFIG_VM86 | ||
331 | movl PT_EFLAGS(%esp), %eax # mix EFLAGS and CS | 326 | movl PT_EFLAGS(%esp), %eax # mix EFLAGS and CS |
332 | movb PT_CS(%esp), %al | 327 | movb PT_CS(%esp), %al |
333 | andl $(X86_EFLAGS_VM | SEGMENT_RPL_MASK), %eax | 328 | andl $(X86_EFLAGS_VM | SEGMENT_RPL_MASK), %eax |
329 | #else | ||
330 | /* | ||
331 | * We can be coming here from a syscall done in the kernel space, | ||
332 | * e.g. a failed kernel_execve(). | ||
333 | */ | ||
334 | movl PT_CS(%esp), %eax | ||
335 | andl $SEGMENT_RPL_MASK, %eax | ||
336 | #endif | ||
334 | cmpl $USER_RPL, %eax | 337 | cmpl $USER_RPL, %eax |
335 | jb resume_kernel # not returning to v8086 or userspace | 338 | jb resume_kernel # not returning to v8086 or userspace |
336 | 339 | ||