From: "Dmitry V. Levin" <ldv@altlinux.org>
To: "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Andy Lutomirski <luto@kernel.org>
Cc: Elvira Khabirova <lineprinter0@gmail.com>,
X86 ML <x86@kernel.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH v2] x86/signal: Cleanup get_nr_restart_syscall
Date: Sat, 19 Dec 2015 17:43:34 +0300 [thread overview]
Message-ID: <20151219144334.GA4827@altlinux.org> (raw)
In-Reply-To: <5674FA8A.60806@zytor.com>
Check for TS_COMPAT instead of TIF_IA32 to distinguish ia32 tasks
from 64-bit tasks.
Check for __X32_SYSCALL_BIT iff CONFIG_X86_X32_ABI is defined.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Cc: Elvira Khabirova <lineprinter0@gmail.com>
Cc: Andy Lutomirski <luto@amacapital.net>
---
v2: reintroduced __NR_restart_syscall | (regs->orig_ax & __X32_SYSCALL_BIT)
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..c07ff5d 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;
+#endif
+#ifdef CONFIG_X86_X32_ABI
+ return __NR_restart_syscall | (regs->orig_ax & __X32_SYSCALL_BIT);
+#else
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 */
+#endif
}
/*
--
ldv
next prev parent reply other threads:[~2015-12-19 14:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-07 23:22 [PATCH] x86/signal: fix restart_syscall number for x32 tasks Andy Lutomirski
2015-12-13 3:44 ` Dmitry V. Levin
2015-12-17 20:27 ` Andy Lutomirski
2015-12-18 23:37 ` [PATCH] x86/signal: Cleanup get_nr_restart_syscall Dmitry V. Levin
2015-12-19 6:34 ` H. Peter Anvin
2015-12-19 14:43 ` Dmitry V. Levin [this message]
2015-12-19 20:48 ` [PATCH v2] " Andy Lutomirski
2016-01-11 14:55 ` [RESEND PATCH " Dmitry V. Levin
2016-01-19 13:39 ` [tip:x86/asm] x86/signal: Cleanup get_nr_restart_syscall() tip-bot for Dmitry V. Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151219144334.GA4827@altlinux.org \
--to=ldv@altlinux.org \
--cc=hpa@zytor.com \
--cc=lineprinter0@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.