From 84849b3ed8081e9e2eb0e441c699eda807853cb6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 24 Apr 2012 16:40:34 -0400 Subject: arm: trim _TIF_WORK_MASK, get rid of useless test and branch... Acked-by: Russell King Signed-off-by: Al Viro --- arch/arm/kernel/entry-common.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'arch/arm/kernel/entry-common.S') diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 54ee265dd819..82aaf0aeb85d 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -53,8 +53,9 @@ fast_work_pending: work_pending: tst r1, #_TIF_NEED_RESCHED bne work_resched - tst r1, #_TIF_SIGPENDING|_TIF_NOTIFY_RESUME - beq no_work_pending + /* + * TIF_SIGPENDING or TIF_NOTIFY_RESUME must've been set if we got here + */ mov r0, sp @ 'regs' mov r2, why @ 'syscall' tst r1, #_TIF_SIGPENDING @ delivering a signal? -- cgit v1.2.3 From 21c1176a72bd019d513b26e05d491a31b50b18d2 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 28 Apr 2012 17:51:42 -0400 Subject: arm: if we get into work_pending while returning to kernel mode, just go away checking in do_signal() is pointless - if we get there with !user_mode(regs) (and we might), we'll end up looping indefinitely. Check in work_pending and break out of the loop if so. Acked-by: Russell King Signed-off-by: Al Viro --- arch/arm/kernel/entry-common.S | 3 +++ arch/arm/kernel/signal.c | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'arch/arm/kernel/entry-common.S') diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 82aaf0aeb85d..b669b49d7cc4 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -56,7 +56,10 @@ work_pending: /* * TIF_SIGPENDING or TIF_NOTIFY_RESUME must've been set if we got here */ + ldr r2, [sp, #S_PSR] mov r0, sp @ 'regs' + tst r2, #15 @ are we returning to user mode? + bne no_work_pending @ no? just leave, then... mov r2, why @ 'syscall' tst r1, #_TIF_SIGPENDING @ delivering a signal? movne why, #0 @ prevent further restarts diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 3b37c14c47f5..6b37d4ddf0b6 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c @@ -608,15 +608,6 @@ static void do_signal(struct pt_regs *regs, int syscall) siginfo_t info; int signr; - /* - * We want the common case to go fast, which - * is why we may in certain cases get here from - * kernel mode. Just return without doing anything - * if so. - */ - if (!user_mode(regs)) - return; - /* * If we were from a system call, check for system call restarting... */ -- cgit v1.2.3