Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1306362 > unrolled thread

[RESEND PATCH v2] x86/signal: Cleanup get_nr_restart_syscall

Started by"Dmitry V. Levin" <ldv@altlinux.org>
First post2016-01-11 16:00 +0100
Last post2016-01-11 16:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RESEND PATCH v2] x86/signal: Cleanup get_nr_restart_syscall "Dmitry V. Levin" <ldv@altlinux.org> - 2016-01-11 16:00 +0100

#1306362 — [RESEND PATCH v2] x86/signal: Cleanup get_nr_restart_syscall

From"Dmitry V. Levin" <ldv@altlinux.org>
Date2016-01-11 16:00 +0100
Subject[RESEND PATCH v2] x86/signal: Cleanup get_nr_restart_syscall
Message-ID<qPM6T-3KB-29@gated-at.bofh.it>
Date: Thu Dec 17 23:56:52 2015 +0000

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.

Suggested-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Cc: Elvira Khabirova <lineprinter0@gmail.com>
Acked-by: 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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web