aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/signal.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-04-30 18:24:46 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-06-01 13:01:51 -0400
commit44fbbb3dc687c9709a6f2236197316e5c79ab1eb (patch)
treed3c995b1cb7e3f9ac5af09b8d78f6c839a65f35a /arch/x86/kernel/signal.c
parent29bf5dd895219e5111099908040aecfc1509f9bb (diff)
x86: get rid of calling do_notify_resume() when returning to kernel mode
If we end up calling do_notify_resume() with !user_mode(refs), it does nothing (do_signal() explicitly bails out and we can't get there with TIF_NOTIFY_RESUME in such situations). Then we jump to resume_userspace_sig, which rechecks the same thing and bails out to resume_kernel, thus breaking the loop. It's easier and cheaper to check *before* calling do_notify_resume() and bail out to resume_kernel immediately. And kill the check in do_signal()... Note that on amd64 we can't get there with !user_mode() at all - asm glue takes care of that. Acked-and-reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/x86/kernel/signal.c')
-rw-r--r--arch/x86/kernel/signal.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index e8a89374d356..21af737053aa 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -737,16 +737,6 @@ static void do_signal(struct pt_regs *regs)
737 siginfo_t info; 737 siginfo_t info;
738 int signr; 738 int signr;
739 739
740 /*
741 * We want the common case to go fast, which is why we may in certain
742 * cases get here from kernel mode. Just return without doing anything
743 * if so.
744 * X86_32: vm86 regs switched out by assembly code before reaching
745 * here, so testing against kernel CS suffices.
746 */
747 if (!user_mode(regs))
748 return;
749
750 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 740 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
751 if (signr > 0) { 741 if (signr > 0) {
752 /* Whee! Actually deliver the signal. */ 742 /* Whee! Actually deliver the signal. */