Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: Fix do_signal() prototype

Once x86 exports its do_signal(), the prototypes will clash.

Fix the clash and also improve the code a bit: remove the
unnecessary kern_do_signal() indirection. This allows
interrupt_end() to share the 'regs' parameter calculation.

Also remove the unused return code to match x86.

Minimally build and boot tested.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Richard Weinberger <richard.weinberger@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: paulmck@linux.vnet.ibm.com
Link: http://lkml.kernel.org/r/67c57eac09a589bac3c6c5ff22f9623ec55a184a.1435952415.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>

+9 -12
+2 -1
arch/um/include/shared/kern_util.h
··· 22 22 extern unsigned long alloc_stack(int order, int atomic); 23 23 extern void free_stack(unsigned long stack, int order); 24 24 25 - extern int do_signal(void); 25 + struct pt_regs; 26 + extern void do_signal(struct pt_regs *regs); 26 27 extern void interrupt_end(void); 27 28 extern void relay_signal(int sig, struct siginfo *si, struct uml_pt_regs *regs); 28 29
+4 -2
arch/um/kernel/process.c
··· 90 90 91 91 void interrupt_end(void) 92 92 { 93 + struct pt_regs *regs = &current->thread.regs; 94 + 93 95 if (need_resched()) 94 96 schedule(); 95 97 if (test_thread_flag(TIF_SIGPENDING)) 96 - do_signal(); 98 + do_signal(regs); 97 99 if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) 98 - tracehook_notify_resume(&current->thread.regs); 100 + tracehook_notify_resume(regs); 99 101 } 100 102 101 103 void exit_thread(void)
+1 -7
arch/um/kernel/signal.c
··· 64 64 signal_setup_done(err, ksig, singlestep); 65 65 } 66 66 67 - static int kern_do_signal(struct pt_regs *regs) 67 + void do_signal(struct pt_regs *regs) 68 68 { 69 69 struct ksignal ksig; 70 70 int handled_sig = 0; ··· 110 110 */ 111 111 if (!handled_sig) 112 112 restore_saved_sigmask(); 113 - return handled_sig; 114 - } 115 - 116 - int do_signal(void) 117 - { 118 - return kern_do_signal(&current->thread.regs); 119 113 }
+1 -1
arch/um/kernel/tlb.c
··· 291 291 /* We are under mmap_sem, release it such that current can terminate */ 292 292 up_write(&current->mm->mmap_sem); 293 293 force_sig(SIGKILL, current); 294 - do_signal(); 294 + do_signal(&current->thread.regs); 295 295 } 296 296 } 297 297
+1 -1
arch/um/kernel/trap.c
··· 173 173 void fatal_sigsegv(void) 174 174 { 175 175 force_sigsegv(SIGSEGV, current); 176 - do_signal(); 176 + do_signal(&current->thread.regs); 177 177 /* 178 178 * This is to tell gcc that we're not returning - do_signal 179 179 * can, in general, return, but in this case, it's not, since