aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2015-10-05 20:48:14 -0400
committerIngo Molnar <mingo@kernel.org>2015-10-09 03:41:10 -0400
commit150ac78d63afb96360dab448b7b4d33c98c8266c (patch)
treecd3c17b46b780fc98128d940d4c27b192836cd99
parent39e8701f33d65c7f51d749a5d12a1379065e0926 (diff)
x86/entry/32: Switch INT80 to the new C syscall path
Signed-off-by: Andy Lutomirski <luto@kernel.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Link: http://lkml.kernel.org/r/a7e8d8df96838eae3208dd0441023f3ce7a81831.1444091585.git.luto@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/entry/entry_32.S34
1 files changed, 13 insertions, 21 deletions
diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index 36b6beb181f6..02881e528945 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -153,13 +153,13 @@
153 153
154#endif /* CONFIG_X86_32_LAZY_GS */ 154#endif /* CONFIG_X86_32_LAZY_GS */
155 155
156.macro SAVE_ALL 156.macro SAVE_ALL pt_regs_ax=%eax
157 cld 157 cld
158 PUSH_GS 158 PUSH_GS
159 pushl %fs 159 pushl %fs
160 pushl %es 160 pushl %es
161 pushl %ds 161 pushl %ds
162 pushl %eax 162 pushl \pt_regs_ax
163 pushl %ebp 163 pushl %ebp
164 pushl %edi 164 pushl %edi
165 pushl %esi 165 pushl %esi
@@ -370,20 +370,17 @@ ENDPROC(entry_SYSENTER_32)
370 # system call handler stub 370 # system call handler stub
371ENTRY(entry_INT80_32) 371ENTRY(entry_INT80_32)
372 ASM_CLAC 372 ASM_CLAC
373 pushl %eax # save orig_eax 373 pushl %eax /* pt_regs->orig_ax */
374 SAVE_ALL 374 SAVE_ALL pt_regs_ax=$-ENOSYS /* save rest, load -ENOSYS into ax */
375 GET_THREAD_INFO(%ebp) 375
376 # system call tracing in operation / emulation 376 /*
377 testl $_TIF_WORK_SYSCALL_ENTRY, TI_flags(%ebp) 377 * User mode is traced as though IRQs are on, and the interrupt gate
378 jnz syscall_trace_entry 378 * turned them off.
379 cmpl $(NR_syscalls), %eax 379 */
380 jae syscall_badsys 380 TRACE_IRQS_OFF
381syscall_call: 381
382 call *sys_call_table(, %eax, 4) 382 movl %esp, %eax
383syscall_after_call: 383 call do_int80_syscall_32
384 movl %eax, PT_EAX(%esp) # store the return value
385syscall_exit:
386 jmp syscall_exit_work
387 384
388restore_all: 385restore_all:
389 TRACE_IRQS_IRET 386 TRACE_IRQS_IRET
@@ -491,11 +488,6 @@ syscall_fault:
491 jmp resume_userspace 488 jmp resume_userspace
492END(syscall_fault) 489END(syscall_fault)
493 490
494syscall_badsys:
495 movl $-ENOSYS, %eax
496 jmp syscall_after_call
497END(syscall_badsys)
498
499sysenter_badsys: 491sysenter_badsys:
500 movl $-ENOSYS, %eax 492 movl $-ENOSYS, %eax
501 jmp sysenter_after_call 493 jmp sysenter_after_call