From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758904AbbJINNg (ORCPT ); Fri, 9 Oct 2015 09:13:36 -0400 Received: from terminus.zytor.com ([198.137.202.10]:46125 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751231AbbJINNd (ORCPT ); Fri, 9 Oct 2015 09:13:33 -0400 Date: Fri, 9 Oct 2015 06:12:44 -0700 From: tip-bot for Andy Lutomirski Message-ID: Cc: luto@amacapital.net, hpa@zytor.com, bp@alien8.de, luto@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, brgerst@gmail.com, mingo@kernel.org, dvlasenk@redhat.com, peterz@infradead.org, torvalds@linux-foundation.org Reply-To: torvalds@linux-foundation.org, peterz@infradead.org, mingo@kernel.org, dvlasenk@redhat.com, brgerst@gmail.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, luto@kernel.org, bp@alien8.de, luto@amacapital.net, hpa@zytor.com In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/entry/32: Switch INT80 to the new C syscall path Git-Commit-ID: 150ac78d63afb96360dab448b7b4d33c98c8266c X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 150ac78d63afb96360dab448b7b4d33c98c8266c Gitweb: http://git.kernel.org/tip/150ac78d63afb96360dab448b7b4d33c98c8266c Author: Andy Lutomirski AuthorDate: Mon, 5 Oct 2015 17:48:14 -0700 Committer: Ingo Molnar CommitDate: Fri, 9 Oct 2015 09:41:10 +0200 x86/entry/32: Switch INT80 to the new C syscall path Signed-off-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Link: http://lkml.kernel.org/r/a7e8d8df96838eae3208dd0441023f3ce7a81831.1444091585.git.luto@kernel.org Signed-off-by: Ingo Molnar --- arch/x86/entry/entry_32.S | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S index 36b6beb..02881e5 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -153,13 +153,13 @@ #endif /* CONFIG_X86_32_LAZY_GS */ -.macro SAVE_ALL +.macro SAVE_ALL pt_regs_ax=%eax cld PUSH_GS pushl %fs pushl %es pushl %ds - pushl %eax + pushl \pt_regs_ax pushl %ebp pushl %edi pushl %esi @@ -370,20 +370,17 @@ ENDPROC(entry_SYSENTER_32) # system call handler stub ENTRY(entry_INT80_32) ASM_CLAC - pushl %eax # save orig_eax - SAVE_ALL - GET_THREAD_INFO(%ebp) - # system call tracing in operation / emulation - testl $_TIF_WORK_SYSCALL_ENTRY, TI_flags(%ebp) - jnz syscall_trace_entry - cmpl $(NR_syscalls), %eax - jae syscall_badsys -syscall_call: - call *sys_call_table(, %eax, 4) -syscall_after_call: - movl %eax, PT_EAX(%esp) # store the return value -syscall_exit: - jmp syscall_exit_work + pushl %eax /* pt_regs->orig_ax */ + SAVE_ALL pt_regs_ax=$-ENOSYS /* save rest, load -ENOSYS into ax */ + + /* + * User mode is traced as though IRQs are on, and the interrupt gate + * turned them off. + */ + TRACE_IRQS_OFF + + movl %esp, %eax + call do_int80_syscall_32 restore_all: TRACE_IRQS_IRET @@ -491,11 +488,6 @@ syscall_fault: jmp resume_userspace END(syscall_fault) -syscall_badsys: - movl $-ENOSYS, %eax - jmp syscall_after_call -END(syscall_badsys) - sysenter_badsys: movl $-ENOSYS, %eax jmp sysenter_after_call