public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot for Dmitry V. Levin" <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: dvlasenk@redhat.com, hpa@zytor.com, luto@amacapital.net,
	ldv@altlinux.org, linux-kernel@vger.kernel.org,
	peterz@infradead.org, torvalds@linux-foundation.org,
	lineprinter0@gmail.com, luto@kernel.org, brgerst@gmail.com,
	tglx@linutronix.de, mingo@kernel.org, bp@alien8.de
Subject: [tip:x86/asm] x86/signal: Cleanup get_nr_restart_syscall()
Date: Tue, 19 Jan 2016 05:39:18 -0800	[thread overview]
Message-ID: <tip-95d97adb2bb85d964bae4538e0574e742e522dda@git.kernel.org> (raw)
In-Reply-To: <20160111145515.GB29007@altlinux.org>

Commit-ID:  95d97adb2bb85d964bae4538e0574e742e522dda
Gitweb:     http://git.kernel.org/tip/95d97adb2bb85d964bae4538e0574e742e522dda
Author:     Dmitry V. Levin <ldv@altlinux.org>
AuthorDate: Thu, 17 Dec 2015 23:56:52 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 19 Jan 2016 12:55:47 +0100

x86/signal: Cleanup get_nr_restart_syscall()

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>
Acked-by: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Elvira Khabirova <lineprinter0@gmail.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>
Link: http://lkml.kernel.org/r/20160111145515.GB29007@altlinux.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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
 }
 
 /*

      reply	other threads:[~2016-01-19 13:40 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         ` [PATCH v2] " Dmitry V. Levin
2015-12-19 20:48           ` Andy Lutomirski
2016-01-11 14:55             ` [RESEND PATCH " Dmitry V. Levin
2016-01-19 13:39               ` tip-bot for Dmitry V. Levin [this message]

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=tip-95d97adb2bb85d964bae4538e0574e742e522dda@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=ldv@altlinux.org \
    --cc=lineprinter0@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox