Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932177AbbLRXhj (ORCPT ); Fri, 18 Dec 2015 18:37:39 -0500 Received: from pegasus3.altlinux.org ([194.107.17.103]:49839 "EHLO pegasus3.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751592AbbLRXhi (ORCPT ); Fri, 18 Dec 2015 18:37:38 -0500 Date: Sat, 19 Dec 2015 02:37:36 +0300 From: "Dmitry V. Levin" To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andy Lutomirski Cc: Elvira Khabirova , X86 ML , "linux-kernel@vger.kernel.org" Subject: [PATCH] x86/signal: Cleanup get_nr_restart_syscall Message-ID: <20151218233736.GA28013@altlinux.org> References: <20151213034437.GA2392@altlinux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1499 Lines: 43 Check for TS_COMPAT instead of TIF_IA32 to distinguish ia32 tasks from 64-bit tasks. Check for __X32_SYSCALL_BIT only if CONFIG_X86_X32_ABI is defined. Signed-off-by: Dmitry V. Levin Cc: Elvira Khabirova Cc: Andy Lutomirski --- arch/x86/kernel/signal.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index cb6282c..ff7dedc 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c @@ -692,12 +692,15 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs) static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs) { -#if defined(CONFIG_X86_32) || !defined(CONFIG_X86_64) +#ifdef CONFIG_X86_64 + if (is_ia32_task()) + return __NR_ia32_restart_syscall; +# ifdef CONFIG_X86_X32_ABI + if (regs->orig_ax & __X32_SYSCALL_BIT) + return __NR_restart_syscall | __X32_SYSCALL_BIT; +# endif +#endif return __NR_restart_syscall; -#else /* !CONFIG_X86_32 && CONFIG_X86_64 */ - return test_thread_flag(TIF_IA32) ? __NR_ia32_restart_syscall : - __NR_restart_syscall | (regs->orig_ax & __X32_SYSCALL_BIT); -#endif /* CONFIG_X86_32 || !CONFIG_X86_64 */ } /* -- ldv -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/