]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
microblaze: evict the check for kernel_mode(regs) from do_notify_resume()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 29 Apr 2012 07:35:29 +0000 (03:35 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 3 Feb 2013 23:16:01 +0000 (18:16 -0500)
Only one caller hasn't done it in assembler - work_pending on !MMU.
Everything else can't reach do_notify_resume() if we are returning
to kernel mode, so move that check to that sole caller and make
do_notify_resume() reachable only when returning to userland.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/microblaze/kernel/entry-nommu.S
arch/microblaze/kernel/signal.c

index 70da83a49670539829365a7012395de497a348be..29a05d62ec1a4f7e31a810cb506bf81cda92063d 100644 (file)
@@ -482,6 +482,8 @@ ENTRY(ret_from_kernel_thread)
        addk    r3, r0, r0
 
 work_pending:
+       lwi     r11, r1, PT_MODE
+       bneid   r11, 2f
        enable_irq
 
        andi    r11, r19, _TIF_NEED_RESCHED
@@ -507,6 +509,7 @@ ENTRY(ret_to_user)
 no_work_pending:
        disable_irq
 
+2:
        /* save r31 */
        swi     r31, r0, PER_CPU(CURRENT_SAVE)
        /* save mode indicator */
index dfd61e2f1189a75dfbdad91d8ff437d7fae491d7..9f7a8bde068626aa05100aecf9753c70369dfdfd 100644 (file)
@@ -343,15 +343,6 @@ static void do_signal(struct pt_regs *regs, int in_syscall)
 
 asmlinkage void do_notify_resume(struct pt_regs *regs, int in_syscall)
 {
-       /*
-        * 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 (kernel_mode(regs))
-               return;
-
        if (test_thread_flag(TIF_SIGPENDING))
                do_signal(regs, in_syscall);