Skip to content

Commit ccaee5f

Browse files
committed
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>
1 parent 5e99cb7 commit ccaee5f

5 files changed

Lines changed: 9 additions & 12 deletions

File tree

‎arch/um/include/shared/kern_util.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ extern int kmalloc_ok;
2222
extern unsigned long alloc_stack(int order, int atomic);
2323
extern void free_stack(unsigned long stack, int order);
2424

25-
extern int do_signal(void);
25+
struct pt_regs;
26+
extern void do_signal(struct pt_regs *regs);
2627
extern void interrupt_end(void);
2728
extern void relay_signal(int sig, struct siginfo *si, struct uml_pt_regs *regs);
2829

‎arch/um/kernel/process.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,14 @@ void *__switch_to(struct task_struct *from, struct task_struct *to)
9090

9191
void interrupt_end(void)
9292
{
93+
struct pt_regs *regs = &current->thread.regs;
94+
9395
if (need_resched())
9496
schedule();
9597
if (test_thread_flag(TIF_SIGPENDING))
96-
do_signal();
98+
do_signal(regs);
9799
if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME))
98-
tracehook_notify_resume(&current->thread.regs);
100+
tracehook_notify_resume(regs);
99101
}
100102

101103
void exit_thread(void)

‎arch/um/kernel/signal.c‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
6464
signal_setup_done(err, ksig, singlestep);
6565
}
6666

67-
static int kern_do_signal(struct pt_regs *regs)
67+
void do_signal(struct pt_regs *regs)
6868
{
6969
struct ksignal ksig;
7070
int handled_sig = 0;
@@ -110,10 +110,4 @@ static int kern_do_signal(struct pt_regs *regs)
110110
*/
111111
if (!handled_sig)
112112
restore_saved_sigmask();
113-
return handled_sig;
114-
}
115-
116-
int do_signal(void)
117-
{
118-
return kern_do_signal(&current->thread.regs);
119113
}

‎arch/um/kernel/tlb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
291291
/* We are under mmap_sem, release it such that current can terminate */
292292
up_write(&current->mm->mmap_sem);
293293
force_sig(SIGKILL, current);
294-
do_signal();
294+
do_signal(&current->thread.regs);
295295
}
296296
}
297297

‎arch/um/kernel/trap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static void bad_segv(struct faultinfo fi, unsigned long ip)
173173
void fatal_sigsegv(void)
174174
{
175175
force_sigsegv(SIGSEGV, current);
176-
do_signal();
176+
do_signal(&current->thread.regs);
177177
/*
178178
* This is to tell gcc that we're not returning - do_signal
179179
* can, in general, return, but in this case, it's not, since

0 commit comments

Comments
 (0)