diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-07-03 15:44:20 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-07-07 04:58:54 -0400 |
commit | ccaee5f851470dec6894a6835b6fadffc2bb7514 (patch) | |
tree | 3937d1d2a22c530a52cacfd5f28989996feaef09 | |
parent | 5e99cb7c35ca0580da8e892f91c655d35ecf8798 (diff) |
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>
-rw-r--r-- | arch/um/include/shared/kern_util.h | 3 | ||||
-rw-r--r-- | arch/um/kernel/process.c | 6 | ||||
-rw-r--r-- | arch/um/kernel/signal.c | 8 | ||||
-rw-r--r-- | arch/um/kernel/tlb.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/trap.c | 2 |
5 files changed, 9 insertions, 12 deletions
diff --git a/arch/um/include/shared/kern_util.h b/arch/um/include/shared/kern_util.h index 83a91f976330..35ab97e4bb9b 100644 --- a/arch/um/include/shared/kern_util.h +++ b/arch/um/include/shared/kern_util.h | |||
@@ -22,7 +22,8 @@ extern int kmalloc_ok; | |||
22 | extern unsigned long alloc_stack(int order, int atomic); | 22 | extern unsigned long alloc_stack(int order, int atomic); |
23 | extern void free_stack(unsigned long stack, int order); | 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 | extern void interrupt_end(void); | 27 | extern void interrupt_end(void); |
27 | extern void relay_signal(int sig, struct siginfo *si, struct uml_pt_regs *regs); | 28 | extern void relay_signal(int sig, struct siginfo *si, struct uml_pt_regs *regs); |
28 | 29 | ||
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 68b9119841cd..a6d922672b9f 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c | |||
@@ -90,12 +90,14 @@ void *__switch_to(struct task_struct *from, struct task_struct *to) | |||
90 | 90 | ||
91 | void interrupt_end(void) | 91 | void interrupt_end(void) |
92 | { | 92 | { |
93 | struct pt_regs *regs = ¤t->thread.regs; | ||
94 | |||
93 | if (need_resched()) | 95 | if (need_resched()) |
94 | schedule(); | 96 | schedule(); |
95 | if (test_thread_flag(TIF_SIGPENDING)) | 97 | if (test_thread_flag(TIF_SIGPENDING)) |
96 | do_signal(); | 98 | do_signal(regs); |
97 | if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) | 99 | if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) |
98 | tracehook_notify_resume(¤t->thread.regs); | 100 | tracehook_notify_resume(regs); |
99 | } | 101 | } |
100 | 102 | ||
101 | void exit_thread(void) | 103 | void exit_thread(void) |
diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c index 4f60e4aad790..57acbd67d85d 100644 --- a/arch/um/kernel/signal.c +++ b/arch/um/kernel/signal.c | |||
@@ -64,7 +64,7 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) | |||
64 | signal_setup_done(err, ksig, singlestep); | 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 | struct ksignal ksig; | 69 | struct ksignal ksig; |
70 | int handled_sig = 0; | 70 | int handled_sig = 0; |
@@ -110,10 +110,4 @@ static int kern_do_signal(struct pt_regs *regs) | |||
110 | */ | 110 | */ |
111 | if (!handled_sig) | 111 | if (!handled_sig) |
112 | restore_saved_sigmask(); | 112 | restore_saved_sigmask(); |
113 | return handled_sig; | ||
114 | } | ||
115 | |||
116 | int do_signal(void) | ||
117 | { | ||
118 | return kern_do_signal(¤t->thread.regs); | ||
119 | } | 113 | } |
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c index f1b3eb14b855..2077248e8a72 100644 --- a/arch/um/kernel/tlb.c +++ b/arch/um/kernel/tlb.c | |||
@@ -291,7 +291,7 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr, | |||
291 | /* We are under mmap_sem, release it such that current can terminate */ | 291 | /* We are under mmap_sem, release it such that current can terminate */ |
292 | up_write(¤t->mm->mmap_sem); | 292 | up_write(¤t->mm->mmap_sem); |
293 | force_sig(SIGKILL, current); | 293 | force_sig(SIGKILL, current); |
294 | do_signal(); | 294 | do_signal(¤t->thread.regs); |
295 | } | 295 | } |
296 | } | 296 | } |
297 | 297 | ||
diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c index 557232f758b6..d8a9fce6ee2e 100644 --- a/arch/um/kernel/trap.c +++ b/arch/um/kernel/trap.c | |||
@@ -173,7 +173,7 @@ static void bad_segv(struct faultinfo fi, unsigned long ip) | |||
173 | void fatal_sigsegv(void) | 173 | void fatal_sigsegv(void) |
174 | { | 174 | { |
175 | force_sigsegv(SIGSEGV, current); | 175 | force_sigsegv(SIGSEGV, current); |
176 | do_signal(); | 176 | do_signal(¤t->thread.regs); |
177 | /* | 177 | /* |
178 | * This is to tell gcc that we're not returning - do_signal | 178 | * This is to tell gcc that we're not returning - do_signal |
179 | * can, in general, return, but in this case, it's not, since | 179 | * can, in general, return, but in this case, it's not, since |