Skip to content

Commit 150ac78

Browse files
amlutoIngo Molnar
authored andcommitted
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>
1 parent 39e8701 commit 150ac78

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

arch/x86/entry/entry_32.S

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@
153153

154154
#endif /* CONFIG_X86_32_LAZY_GS */
155155

156-
.macro SAVE_ALL
156+
.macro SAVE_ALL pt_regs_ax=%eax
157157
cld
158158
PUSH_GS
159159
pushl %fs
160160
pushl %es
161161
pushl %ds
162-
pushl %eax
162+
pushl \pt_regs_ax
163163
pushl %ebp
164164
pushl %edi
165165
pushl %esi
@@ -370,20 +370,17 @@ ENDPROC(entry_SYSENTER_32)
370370
# system call handler stub
371371
ENTRY(entry_INT80_32)
372372
ASM_CLAC
373-
pushl %eax # save orig_eax
374-
SAVE_ALL
375-
GET_THREAD_INFO(%ebp)
376-
# system call tracing in operation / emulation
377-
testl $_TIF_WORK_SYSCALL_ENTRY, TI_flags(%ebp)
378-
jnz syscall_trace_entry
379-
cmpl $(NR_syscalls), %eax
380-
jae syscall_badsys
381-
syscall_call:
382-
call *sys_call_table(, %eax, 4)
383-
syscall_after_call:
384-
movl %eax, PT_EAX(%esp) # store the return value
385-
syscall_exit:
386-
jmp syscall_exit_work
373+
pushl %eax /* pt_regs->orig_ax */
374+
SAVE_ALL pt_regs_ax=$-ENOSYS /* save rest, load -ENOSYS into ax */
375+
376+
/*
377+
* User mode is traced as though IRQs are on, and the interrupt gate
378+
* turned them off.
379+
*/
380+
TRACE_IRQS_OFF
381+
382+
movl %esp, %eax
383+
call do_int80_syscall_32
387384

388385
restore_all:
389386
TRACE_IRQS_IRET
@@ -491,11 +488,6 @@ syscall_fault:
491488
jmp resume_userspace
492489
END(syscall_fault)
493490

494-
syscall_badsys:
495-
movl $-ENOSYS, %eax
496-
jmp syscall_after_call
497-
END(syscall_badsys)
498-
499491
sysenter_badsys:
500492
movl $-ENOSYS, %eax
501493
jmp sysenter_after_call

0 commit comments

Comments
 (0)