From 048c6140c0f5d0bb1af8308c91dfa560ac65a296 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 3 Aug 2006 19:36:37 +0100 Subject: [MIPS] Don't call try_to_freeze in do_signal & co. Signed-off-by: Ralf Baechle --- arch/mips/kernel/signal.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'arch/mips/kernel/signal.c') diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 6b4d9be31615..dc8956e3a396 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c @@ -424,9 +424,6 @@ void do_signal(struct pt_regs *regs) if (!user_mode(regs)) return; - if (try_to_freeze()) - goto no_signal; - if (test_thread_flag(TIF_RESTORE_SIGMASK)) oldset = ¤t->saved_sigmask; else @@ -448,7 +445,6 @@ void do_signal(struct pt_regs *regs) } } -no_signal: /* * Who's code doesn't conform to the restartable syscall convention * dies here!!! The li instruction, a single machine instruction, -- cgit From 45887e12f21780f00b861fdaff8e9d02a42eeb0f Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 3 Aug 2006 21:54:13 +0100 Subject: [MIPS] Add missing returns in signal code. Signed-off-by: Ralf Baechle --- arch/mips/kernel/signal.c | 2 ++ arch/mips/kernel/signal32.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'arch/mips/kernel/signal.c') diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index dc8956e3a396..56bf42911336 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c @@ -443,6 +443,8 @@ void do_signal(struct pt_regs *regs) if (test_thread_flag(TIF_RESTORE_SIGMASK)) clear_thread_flag(TIF_RESTORE_SIGMASK); } + + return; } /* diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index 30980df56cd1..282e85a7bae1 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c @@ -833,6 +833,8 @@ void do_signal32(struct pt_regs *regs) if (test_thread_flag(TIF_RESTORE_SIGMASK)) clear_thread_flag(TIF_RESTORE_SIGMASK); } + + return; } /* -- cgit From 13fdd31abec5f48cf97693bd14d2e11e0779b4ca Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 8 Aug 2006 03:47:01 +0100 Subject: [MIPS] Avoid double signal restarting. In entry.S resume_userspace ... jal do_notify_resume form a loop through which the kernel will iterate as long as work is pending. If we iterate through this loop more than once with no signal pending for at least one but the last iteration we will take do the syscall restarting multiple times resulting in a syscall return prior to the the syscall instruction in userspace. This may happen when debugging a multithreaded program. Debugging and original fix by Maciej; extended to other ABIs by me. Signed-off-by: Maciej W. Rozycki Signed-off-by: Ralf Baechle --- arch/mips/kernel/irixsig.c | 1 + arch/mips/kernel/signal.c | 2 +- arch/mips/kernel/signal32.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'arch/mips/kernel/signal.c') diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c index 052ea15f1e80..719364752e77 100644 --- a/arch/mips/kernel/irixsig.c +++ b/arch/mips/kernel/irixsig.c @@ -224,6 +224,7 @@ void do_irix_signal(struct pt_regs *regs) regs->regs[7] = regs->regs[26]; regs->cp0_epc -= 4; } + regs->regs[0] = 0; /* Don't deal with this again. */ } /* diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 56bf42911336..b9d358e05214 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c @@ -429,7 +429,6 @@ void do_signal(struct pt_regs *regs) else oldset = ¤t->blocked; - signr = get_signal_to_deliver(&info, &ka, regs, NULL); if (signr > 0) { /* Whee! Actually deliver the signal. */ @@ -464,6 +463,7 @@ void do_signal(struct pt_regs *regs) regs->regs[7] = regs->regs[26]; regs->cp0_epc -= 4; } + regs->regs[0] = 0; /* Don't deal with this again. */ } /* diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index 282e85a7bae1..c86a5ddff050 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c @@ -854,6 +854,7 @@ void do_signal32(struct pt_regs *regs) regs->regs[7] = regs->regs[26]; regs->cp0_epc -= 4; } + regs->regs[0] = 0; /* Don't deal with this again. */ } /* -- cgit