2012-05-25 22:04:48

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 01/20] arm: Do not call do_signal() with irqs disabled

get_signal_to_deliver() calls try_to_freeze() which might sleep.

Cc: Russell King <[email protected]>
Cc: [email protected]
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/arm/kernel/signal.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 4e5fdd9..434a1f3 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -13,6 +13,7 @@
#include <linux/freezer.h>
#include <linux/uaccess.h>
#include <linux/tracehook.h>
+#include <linux/irqflags.h>

#include <asm/elf.h>
#include <asm/cacheflush.h>
@@ -722,6 +723,8 @@ static void do_signal(struct pt_regs *regs, int syscall)
asmlinkage void
do_notify_resume(struct pt_regs *regs, unsigned int thread_flags, int syscall)
{
+ local_irq_enable();
+
if (thread_flags & _TIF_SIGPENDING)
do_signal(regs, syscall);

--
1.7.7.3


2012-05-25 22:04:50

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 02/20] c6x: Do not call do_signal() with irqs disabled

get_signal_to_deliver() calls try_to_freeze() which might sleep.

Cc: Mark Salter <[email protected]>
Cc: Aurelien Jacquiot <[email protected]>
Cc: [email protected]
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/c6x/kernel/signal.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/c6x/kernel/signal.c b/arch/c6x/kernel/signal.c
index cf37478..80e91bf 100644
--- a/arch/c6x/kernel/signal.c
+++ b/arch/c6x/kernel/signal.c
@@ -15,6 +15,7 @@
#include <linux/uaccess.h>
#include <linux/syscalls.h>
#include <linux/tracehook.h>
+#include <linux/irqflags.h>

#include <asm/ucontext.h>
#include <asm/cacheflush.h>
@@ -356,6 +357,8 @@ static void do_signal(struct pt_regs *regs, int syscall)
asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags,
int syscall)
{
+ local_irq_enable();
+
/* deal with pending signal delivery */
if (thread_info_flags & ((1 << TIF_SIGPENDING) |
(1 << TIF_RESTORE_SIGMASK)))
--
1.7.7.3

2012-05-25 22:04:53

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 04/20] h8300: Do not call do_signal() with irqs disabled

get_signal_to_deliver() calls try_to_freeze() which might sleep.

Cc: Yoshinori Sato <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/h8300/kernel/signal.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/h8300/kernel/signal.c b/arch/h8300/kernel/signal.c
index d4b0555..b3e03a7 100644
--- a/arch/h8300/kernel/signal.c
+++ b/arch/h8300/kernel/signal.c
@@ -40,6 +40,7 @@
#include <linux/binfmts.h>
#include <linux/freezer.h>
#include <linux/tracehook.h>
+#include <linux/irqflags.h>

#include <asm/setup.h>
#include <asm/uaccess.h>
@@ -507,6 +508,8 @@ statis void do_signal(struct pt_regs *regs)

asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags)
{
+ local_irq_enable();
+
if (thread_info_flags & _TIF_SIGPENDING)
do_signal(regs);

--
1.7.7.3

2012-05-25 22:05:14

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 18/20] m32r: Do not call try_to_freeze() in do_signal()

get_signal_to_deliver() already calls try_to_freeze(), there is no
need to call it directly.

Cc: Hirokazu Takata <[email protected]>
Cc: [email protected]
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/m32r/kernel/signal.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index 0521e19..00494f0 100644
--- a/arch/m32r/kernel/signal.c
+++ b/arch/m32r/kernel/signal.c
@@ -20,7 +20,6 @@
#include <linux/unistd.h>
#include <linux/stddef.h>
#include <linux/personality.h>
-#include <linux/freezer.h>
#include <linux/tracehook.h>
#include <linux/irqflags.h>
#include <asm/cacheflush.h>
@@ -323,9 +322,6 @@ static 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 = &current->saved_sigmask;
else
@@ -346,7 +342,6 @@ static void do_signal(struct pt_regs *regs)
return;
}

- no_signal:
/* Did we come from a system call? */
if (regs->syscall_nr >= 0) {
/* Restart the system call - no handlers present */
--
1.7.7.3

2012-05-25 22:05:12

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 12/20] unicore32: Do not call do_signal() with irqs disabled

get_signal_to_deliver() calls try_to_freeze() which might sleep.

Cc: Guan Xuetao <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/unicore32/kernel/signal.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/unicore32/kernel/signal.c b/arch/unicore32/kernel/signal.c
index 7754df6..d25ddd8 100644
--- a/arch/unicore32/kernel/signal.c
+++ b/arch/unicore32/kernel/signal.c
@@ -17,6 +17,7 @@
#include <linux/tracehook.h>
#include <linux/elf.h>
#include <linux/unistd.h>
+#include <linux/irqflags.h>

#include <asm/cacheflush.h>
#include <asm/ucontext.h>
@@ -458,6 +459,8 @@ static void do_signal(struct pt_regs *regs, int syscall)
asmlinkage void do_notify_resume(struct pt_regs *regs,
unsigned int thread_flags, int syscall)
{
+ local_irq_enable();
+
if (thread_flags & _TIF_SIGPENDING)
do_signal(regs, syscall);

--
1.7.7.3

2012-05-25 22:05:11

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 11/20] tile: Do not call do_signal() with irqs disabled

get_signal_to_deliver() calls try_to_freeze() which might sleep.

Cc: Chris Metcalf <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/tile/kernel/process.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c
index f572c19..911cb99 100644
--- a/arch/tile/kernel/process.c
+++ b/arch/tile/kernel/process.c
@@ -27,6 +27,7 @@
#include <linux/kernel.h>
#include <linux/tracehook.h>
#include <linux/signal.h>
+#include <linux/irqflags.h>
#include <asm/stack.h>
#include <asm/switch_to.h>
#include <asm/homecache.h>
@@ -548,6 +549,8 @@ struct task_struct *__sched _switch_to(struct task_struct *prev,
*/
int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
{
+ local_irq_enable();
+
/* If we enter in kernel mode, do nothing and exit the caller loop. */
if (!user_mode(regs))
return 0;
--
1.7.7.3

2012-05-25 22:06:04

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 20/20] xtensa: Do not call try_to_freeze() in do_signal()

get_signal_to_deliver() already calls try_to_freeze(), there is no
need to call it directly.

Cc: Chris Zankel <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/xtensa/kernel/signal.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c
index c5e4ec0..f14ef4e 100644
--- a/arch/xtensa/kernel/signal.c
+++ b/arch/xtensa/kernel/signal.c
@@ -19,7 +19,6 @@
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/personality.h>
-#include <linux/freezer.h>
#include <linux/tracehook.h>

#include <asm/ucontext.h>
@@ -454,9 +453,6 @@ static void do_signal(struct pt_regs *regs)
struct k_sigaction ka;
sigset_t oldset;

- if (try_to_freeze())
- goto no_signal;
-
if (test_thread_flag(TIF_RESTORE_SIGMASK))
oldset = &current->saved_sigmask;
else
@@ -513,7 +509,6 @@ static void do_signal(struct pt_regs *regs)
return;
}

-no_signal:
/* Did we come from a system call? */
if ((signed) regs->syscall >= 0) {
/* Restart the system call - no handlers present */
--
1.7.7.3

2012-05-25 22:05:08

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 07/20] mn10300: Do not call do_signal() with irqs disabled

get_signal_to_deliver() calls try_to_freeze() which might sleep.

Cc: David Howells <[email protected]>
Cc: Koichi Yasutake <[email protected]>
Cc: [email protected]
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/mn10300/kernel/signal.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c
index 890cf91..4a6c212 100644
--- a/arch/mn10300/kernel/signal.c
+++ b/arch/mn10300/kernel/signal.c
@@ -23,6 +23,7 @@
#include <linux/personality.h>
#include <linux/suspend.h>
#include <linux/tracehook.h>
+#include <linux/irqflags.h>
#include <asm/cacheflush.h>
#include <asm/ucontext.h>
#include <asm/uaccess.h>
@@ -537,6 +538,8 @@ static void do_signal(struct pt_regs *regs)
*/
asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags)
{
+ local_irq_enable();
+
/* Pending single-step? */
if (thread_info_flags & _TIF_SINGLESTEP) {
#ifndef CONFIG_MN10300_USING_JTAG
--
1.7.7.3

2012-05-25 22:06:25

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 19/20] unicore32: Do not call try_to_freeze() in do_signal()

get_signal_to_deliver() already calls try_to_freeze(), there is no
need to call it directly.

Cc: Guan Xuetao <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/unicore32/kernel/signal.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/unicore32/kernel/signal.c b/arch/unicore32/kernel/signal.c
index d25ddd8..1ee603e 100644
--- a/arch/unicore32/kernel/signal.c
+++ b/arch/unicore32/kernel/signal.c
@@ -12,7 +12,6 @@
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/personality.h>
-#include <linux/freezer.h>
#include <linux/uaccess.h>
#include <linux/tracehook.h>
#include <linux/elf.h>
@@ -400,9 +399,6 @@ static void do_signal(struct pt_regs *regs, int syscall)
if (!user_mode(regs))
return;

- if (try_to_freeze())
- goto no_signal;
-
signr = get_signal_to_deliver(&info, &ka, regs, NULL);
if (signr > 0) {
sigset_t *oldset;
@@ -425,7 +421,6 @@ static void do_signal(struct pt_regs *regs, int syscall)
return;
}

- no_signal:
/*
* No signal to deliver to the process - restart the syscall.
*/
--
1.7.7.3

2012-05-25 22:06:43

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 17/20] hexagon: Do not call try_to_freeze() in do_signal()

get_signal_to_deliver() already calls try_to_freeze(), there is no
need to call it directly.

Cc: Richard Kuo <[email protected]>
Cc: [email protected]
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/hexagon/kernel/signal.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c
index 8403bfd..9783cfa 100644
--- a/arch/hexagon/kernel/signal.c
+++ b/arch/hexagon/kernel/signal.c
@@ -20,7 +20,6 @@

#include <linux/linkage.h>
#include <linux/syscalls.h>
-#include <linux/freezer.h>
#include <linux/tracehook.h>
#include <linux/irqflags.h>
#include <asm/registers.h>
@@ -210,9 +209,6 @@ static void do_signal(struct pt_regs *regs)
if (!user_mode(regs))
return;

- if (try_to_freeze())
- goto no_signal;
-
signo = get_signal_to_deliver(&info, &sigact, regs, NULL);

if (signo > 0) {
@@ -237,7 +233,6 @@ static void do_signal(struct pt_regs *regs)
return;
}

-no_signal:
/*
* If we came from a system call, handle the restart.
*/
--
1.7.7.3

2012-05-25 22:07:01

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 15/20] frv: Do not call try_to_freeze() in do_signal()

get_signal_to_deliver() already calls try_to_freeze(), there is no
need to call it directly.

Cc: David Howells <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/frv/kernel/signal.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index 8cf5dca..c85c088 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -20,7 +20,6 @@
#include <linux/ptrace.h>
#include <linux/unistd.h>
#include <linux/personality.h>
-#include <linux/freezer.h>
#include <linux/tracehook.h>
#include <asm/ucontext.h>
#include <asm/uaccess.h>
@@ -489,9 +488,6 @@ static void do_signal(void)
if (!user_mode(__frame))
return;

- if (try_to_freeze())
- goto no_signal;
-
if (test_thread_flag(TIF_RESTORE_SIGMASK))
oldset = &current->saved_sigmask;
else
@@ -514,7 +510,6 @@ static void do_signal(void)
return;
}

-no_signal:
/* Did we come from a system call? */
if (__frame->syscallno != -1) {
/* Restart the system call - no handlers present */
--
1.7.7.3

2012-05-25 22:06:59

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 16/20] h8300: Do not call try_to_freeze() in do_signal()

get_signal_to_deliver() already calls try_to_freeze(), there is no
need to call it directly.

Cc: Yoshinori Sato <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/h8300/kernel/signal.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/arch/h8300/kernel/signal.c b/arch/h8300/kernel/signal.c
index b3e03a7..35036e5 100644
--- a/arch/h8300/kernel/signal.c
+++ b/arch/h8300/kernel/signal.c
@@ -38,7 +38,6 @@
#include <linux/personality.h>
#include <linux/tty.h>
#include <linux/binfmts.h>
-#include <linux/freezer.h>
#include <linux/tracehook.h>
#include <linux/irqflags.h>

@@ -469,9 +468,6 @@ statis void do_signal(struct pt_regs *regs)
if ((regs->ccr & 0x10))
return;

- if (try_to_freeze())
- goto no_signal;
-
current->thread.esp0 = (unsigned long) regs;

if (test_thread_flag(TIF_RESTORE_SIGMASK))
@@ -485,7 +481,7 @@ statis void do_signal(struct pt_regs *regs)
handle_signal(signr, &info, &ka, oldset, regs);
return;
}
- no_signal:
+
/* Did we come from a system call? */
if (regs->orig_er0 >= 0) {
/* Restart the system call - no handlers present */
--
1.7.7.3

2012-05-25 22:07:45

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 13/20] arm: Do not call try_to_freeze() in do_signal()

get_signal_to_deliver() already calls try_to_freeze(), there is no
need to call it directly.

Cc: Russell King <[email protected]>
Cc: [email protected]
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/arm/kernel/signal.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 434a1f3..aeebb46 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -10,7 +10,6 @@
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/personality.h>
-#include <linux/freezer.h>
#include <linux/uaccess.h>
#include <linux/tracehook.h>
#include <linux/irqflags.h>
@@ -636,9 +635,6 @@ static void do_signal(struct pt_regs *regs, int syscall)
}
}

- if (try_to_freeze())
- goto no_signal;
-
/*
* Get the signal to deliver. When running under ptrace, at this
* point the debugger may change all our registers ...
@@ -678,7 +674,6 @@ static void do_signal(struct pt_regs *regs, int syscall)
return;
}

- no_signal:
if (syscall) {
/*
* Handle restarting a different system call. As above,
--
1.7.7.3

2012-05-25 22:07:43

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 14/20] blackfin: Do not call try_to_freeze() in do_signal()

get_signal_to_deliver() already calls try_to_freeze(), there is no
need to call it directly.

Cc: Mike Frysinger <[email protected]>
Cc: [email protected]
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/blackfin/kernel/signal.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c
index e5bbc1a..cea3873 100644
--- a/arch/blackfin/kernel/signal.c
+++ b/arch/blackfin/kernel/signal.c
@@ -10,7 +10,6 @@
#include <linux/tty.h>
#include <linux/personality.h>
#include <linux/binfmts.h>
-#include <linux/freezer.h>
#include <linux/uaccess.h>
#include <linux/tracehook.h>

@@ -285,9 +284,6 @@ asmlinkage void do_signal(struct pt_regs *regs)

current->thread.esp0 = (unsigned long)regs;

- if (try_to_freeze())
- goto no_signal;
-
if (test_thread_flag(TIF_RESTORE_SIGMASK))
oldset = &current->saved_sigmask;
else
@@ -311,7 +307,6 @@ asmlinkage void do_signal(struct pt_regs *regs)
return;
}

- no_signal:
/* Did we come from a system call? */
if (regs->orig_p0 >= 0)
/* Restart the system call - no handlers present */
--
1.7.7.3

2012-05-25 22:05:02

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 08/20] openrisc: Do not call do_signal() with irqs disabled

get_signal_to_deliver() calls try_to_freeze() which might sleep.

Cc: Jonas Bonn <[email protected]>
Cc: [email protected]
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/openrisc/kernel/signal.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/openrisc/kernel/signal.c b/arch/openrisc/kernel/signal.c
index e970743..f2ae7ac 100644
--- a/arch/openrisc/kernel/signal.c
+++ b/arch/openrisc/kernel/signal.c
@@ -26,6 +26,7 @@
#include <linux/unistd.h>
#include <linux/stddef.h>
#include <linux/tracehook.h>
+#include <linux/irqflags.h>

#include <asm/processor.h>
#include <asm/ucontext.h>
@@ -370,6 +371,8 @@ void do_signal(struct pt_regs *regs)

asmlinkage void do_notify_resume(struct pt_regs *regs)
{
+ local_irq_enable();
+
if (current_thread_info()->flags & _TIF_SIGPENDING)
do_signal(regs);

--
1.7.7.3

2012-05-25 22:08:41

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 10/20] sh: Do not call do_signal() with irqs disabled

get_signal_to_deliver() calls try_to_freeze() which might sleep.

Cc: Paul Mundt <[email protected]>
Cc: [email protected]
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/sh/kernel/signal_32.c | 3 +++
arch/sh/kernel/signal_64.c | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c
index cb4172c..4f1db5e 100644
--- a/arch/sh/kernel/signal_32.c
+++ b/arch/sh/kernel/signal_32.c
@@ -25,6 +25,7 @@
#include <linux/freezer.h>
#include <linux/io.h>
#include <linux/tracehook.h>
+#include <linux/irqflags.h>
#include <asm/ucontext.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
@@ -619,6 +620,8 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0,
unsigned long thread_info_flags)
{
+ local_irq_enable();
+
/* deal with pending signal delivery */
if (thread_info_flags & _TIF_SIGPENDING)
do_signal(regs, save_r0);
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
index b589a35..f92fdb7 100644
--- a/arch/sh/kernel/signal_64.c
+++ b/arch/sh/kernel/signal_64.c
@@ -23,6 +23,7 @@
#include <linux/unistd.h>
#include <linux/stddef.h>
#include <linux/tracehook.h>
+#include <linux/irqflags.h>
#include <asm/ucontext.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
@@ -679,6 +680,8 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,

asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
{
+ local_irq_enable();
+
if (thread_info_flags & _TIF_SIGPENDING)
do_signal(regs);

--
1.7.7.3

2012-05-25 22:08:57

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 09/20] score: Do not call do_signal() with irqs disabled

get_signal_to_deliver() calls try_to_freeze() which might sleep.

Cc: Chen Liqin <[email protected]>
Cc: Lennox Wu <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/score/kernel/signal.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/score/kernel/signal.c b/arch/score/kernel/signal.c
index d4a4901..452c1fa 100644
--- a/arch/score/kernel/signal.c
+++ b/arch/score/kernel/signal.c
@@ -29,6 +29,7 @@
#include <linux/unistd.h>
#include <linux/uaccess.h>
#include <linux/tracehook.h>
+#include <linux/irqflags.h>

#include <asm/cacheflush.h>
#include <asm/syscalls.h>
@@ -350,6 +351,8 @@ static void do_signal(struct pt_regs *regs)
asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused,
__u32 thread_info_flags)
{
+ local_irq_enable();
+
/* deal with pending signal delivery */
if (thread_info_flags & _TIF_SIGPENDING)
do_signal(regs);
--
1.7.7.3

2012-05-25 22:04:58

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 06/20] m32r: Do not call do_signal() with irqs disabled

get_signal_to_deliver() calls try_to_freeze() which might sleep.

Cc: Hirokazu Takata <[email protected]>
Cc: [email protected]
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/m32r/kernel/signal.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index f54d969..0521e19 100644
--- a/arch/m32r/kernel/signal.c
+++ b/arch/m32r/kernel/signal.c
@@ -22,6 +22,7 @@
#include <linux/personality.h>
#include <linux/freezer.h>
#include <linux/tracehook.h>
+#include <linux/irqflags.h>
#include <asm/cacheflush.h>
#include <asm/ucontext.h>
#include <asm/uaccess.h>
@@ -372,6 +373,8 @@ static void do_signal(struct pt_regs *regs)
*/
void do_notify_resume(struct pt_regs *regs, __u32 thread_info_flags)
{
+ local_irq_enable();
+
/* Pending single-step? */
if (thread_info_flags & _TIF_SINGLESTEP)
clear_thread_flag(TIF_SINGLESTEP);
--
1.7.7.3

2012-05-25 22:11:05

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 05/20] hexagon: Do not call do_signal() with irqs disabled

get_signal_to_deliver() calls try_to_freeze() which might sleep.

Cc: Richard Kuo <[email protected]>
Cc: [email protected]
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/hexagon/kernel/signal.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c
index 434866e..8403bfd 100644
--- a/arch/hexagon/kernel/signal.c
+++ b/arch/hexagon/kernel/signal.c
@@ -22,6 +22,7 @@
#include <linux/syscalls.h>
#include <linux/freezer.h>
#include <linux/tracehook.h>
+#include <linux/irqflags.h>
#include <asm/registers.h>
#include <asm/thread_info.h>
#include <asm/unistd.h>
@@ -267,6 +268,8 @@ no_restart:

void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
{
+ local_irq_enable();
+
if (thread_info_flags & _TIF_SIGPENDING)
do_signal(regs);

--
1.7.7.3

2012-05-25 22:11:35

by Richard Weinberger

[permalink] [raw]
Subject: [PATCH 03/20] cris: Do not call do_signal() with irqs disabled

get_signal_to_deliver() calls try_to_freeze() which might sleep.

Cc: Mikael Starvik <[email protected]>
Cc: Jesper Nilsson <[email protected]>
Cc: [email protected]
Signed-off-by: Richard Weinberger <[email protected]>
---
arch/cris/kernel/ptrace.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/cris/kernel/ptrace.c b/arch/cris/kernel/ptrace.c
index d114ad3..da1b647 100644
--- a/arch/cris/kernel/ptrace.c
+++ b/arch/cris/kernel/ptrace.c
@@ -17,6 +17,7 @@
#include <linux/ptrace.h>
#include <linux/user.h>
#include <linux/tracehook.h>
+#include <linux/irqflags.h>

#include <asm/uaccess.h>
#include <asm/page.h>
@@ -33,6 +34,8 @@ extern int do_signal(int canrestart, struct pt_regs *regs);
void do_notify_resume(int canrestart, struct pt_regs *regs,
__u32 thread_info_flags)
{
+ local_irq_enable();
+
/* deal with pending signal delivery */
if (thread_info_flags & _TIF_SIGPENDING)
do_signal(canrestart,regs);
--
1.7.7.3

2012-05-25 23:43:56

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH 13/20] arm: Do not call try_to_freeze() in do_signal()

On Sat, May 26, 2012 at 12:04:29AM +0200, Richard Weinberger wrote:
> get_signal_to_deliver() already calls try_to_freeze(), there is no
> need to call it directly.

NAK. Please check linux-next (okay, viro's patches haven't appeared
there yet) but a lot of this stuff is covered by a truckload of work
that Al's done.

Please don't work across Al.

commit d9be5ea6f9b6a51535ccdd9881ffb3be2dbd48e9
Author: Al Viro <[email protected]>
Date: Fri Apr 27 01:18:52 2012 -0400

arm: don't call try_to_freeze() from do_signal()

get_signal_to_deliver() will handle it itself

Signed-off-by: Al Viro <[email protected]>

diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index a6c4e78..3b37c14 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -642,9 +642,6 @@ static void do_signal(struct pt_regs *regs, int syscall)
}
}

- if (try_to_freeze())
- goto no_signal;
-
/*
* Get the signal to deliver. When running under ptrace, at this
* point the debugger may change all our registers ...
@@ -684,7 +681,6 @@ static void do_signal(struct pt_regs *regs, int syscall)
return;
}

- no_signal:
if (syscall) {
/*
* Handle restarting a different system call. As above,

2012-05-25 23:45:47

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH 01/20] arm: Do not call do_signal() with irqs disabled

On Sat, May 26, 2012 at 12:04:17AM +0200, Richard Weinberger wrote:
> get_signal_to_deliver() calls try_to_freeze() which might sleep.

True enough, and this problem has been around for some time, and it's
not as simple to fix as "lets just ignore everything else and enable
interrupts to shutup the warning".

There's bigger issues here with syscall restarting that should be
resolved first, and there's work in progress to do that. Again,
like I said in my previous email, Al's done a great deal of work
in this area and I get the impression that you're redoing some of
that.

2012-05-26 08:55:16

by Richard Weinberger

[permalink] [raw]
Subject: Re: [PATCH 13/20] arm: Do not call try_to_freeze() in do_signal()

Am 26.05.2012 01:43, schrieb Russell King - ARM Linux:
> On Sat, May 26, 2012 at 12:04:29AM +0200, Richard Weinberger wrote:
>> get_signal_to_deliver() already calls try_to_freeze(), there is no
>> need to call it directly.
>
> NAK. Please check linux-next (okay, viro's patches haven't appeared
> there yet) but a lot of this stuff is covered by a truckload of work
> that Al's done.
>

Okay.
I've rebased my patches to Al's signal tree to avoid further conflicts.

Thanks,
//richard


Attachments:
signature.asc (490.00 B)
OpenPGP digital signature

2012-06-01 17:55:07

by Richard Kuo

[permalink] [raw]
Subject: Re: [PATCH 05/20] hexagon: Do not call do_signal() with irqs disabled

On Sat, May 26, 2012 at 12:04:21AM +0200, Richard Weinberger wrote:
> get_signal_to_deliver() calls try_to_freeze() which might sleep.
>
> Cc: Richard Kuo <[email protected]>
> Cc: [email protected]
> Signed-off-by: Richard Weinberger <[email protected]>
> ---
> arch/hexagon/kernel/signal.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c
> index 434866e..8403bfd 100644
> --- a/arch/hexagon/kernel/signal.c
> +++ b/arch/hexagon/kernel/signal.c
> @@ -22,6 +22,7 @@
> #include <linux/syscalls.h>
> #include <linux/freezer.h>
> #include <linux/tracehook.h>
> +#include <linux/irqflags.h>
> #include <asm/registers.h>
> #include <asm/thread_info.h>
> #include <asm/unistd.h>
> @@ -267,6 +268,8 @@ no_restart:
>
> void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
> {
> + local_irq_enable();
> +
> if (thread_info_flags & _TIF_SIGPENDING)
> do_signal(regs);
>
> --
> 1.7.7.3
>

Signed-off-by: Richard Kuo <[email protected]>


--

Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

2012-06-01 17:55:35

by Richard Kuo

[permalink] [raw]
Subject: Re: [PATCH 17/20] hexagon: Do not call try_to_freeze() in do_signal()

On Sat, May 26, 2012 at 12:04:33AM +0200, Richard Weinberger wrote:
> get_signal_to_deliver() already calls try_to_freeze(), there is no
> need to call it directly.
>
> Cc: Richard Kuo <[email protected]>
> Cc: [email protected]
> Signed-off-by: Richard Weinberger <[email protected]>
> ---
> arch/hexagon/kernel/signal.c | 5 -----
> 1 files changed, 0 insertions(+), 5 deletions(-)
>
> diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c
> index 8403bfd..9783cfa 100644
> --- a/arch/hexagon/kernel/signal.c
> +++ b/arch/hexagon/kernel/signal.c
> @@ -20,7 +20,6 @@
>
> #include <linux/linkage.h>
> #include <linux/syscalls.h>
> -#include <linux/freezer.h>
> #include <linux/tracehook.h>
> #include <linux/irqflags.h>
> #include <asm/registers.h>
> @@ -210,9 +209,6 @@ static void do_signal(struct pt_regs *regs)
> if (!user_mode(regs))
> return;
>
> - if (try_to_freeze())
> - goto no_signal;
> -
> signo = get_signal_to_deliver(&info, &sigact, regs, NULL);
>
> if (signo > 0) {
> @@ -237,7 +233,6 @@ static void do_signal(struct pt_regs *regs)
> return;
> }
>
> -no_signal:
> /*
> * If we came from a system call, handle the restart.
> */
> --
> 1.7.7.3
>

Signed-off-by: Richard Kuo <[email protected]>


--

Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

2012-06-01 18:42:37

by David Brown

[permalink] [raw]
Subject: Re: [PATCH 05/20] hexagon: Do not call do_signal() with irqs disabled

On Fri, Jun 01, 2012 at 12:54:59PM -0500, Richard Kuo wrote:
> On Sat, May 26, 2012 at 12:04:21AM +0200, Richard Weinberger wrote:
> > get_signal_to_deliver() calls try_to_freeze() which might sleep.
> >
> > Cc: Richard Kuo <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Richard Weinberger <[email protected]>
> > ---
> > arch/hexagon/kernel/signal.c | 3 +++
> > 1 files changed, 3 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c
> > index 434866e..8403bfd 100644
> > --- a/arch/hexagon/kernel/signal.c
> > +++ b/arch/hexagon/kernel/signal.c
> > @@ -22,6 +22,7 @@
> > #include <linux/syscalls.h>
> > #include <linux/freezer.h>
> > #include <linux/tracehook.h>
> > +#include <linux/irqflags.h>
> > #include <asm/registers.h>
> > #include <asm/thread_info.h>
> > #include <asm/unistd.h>
> > @@ -267,6 +268,8 @@ no_restart:
> >
> > void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
> > {
> > + local_irq_enable();
> > +
> > if (thread_info_flags & _TIF_SIGPENDING)
> > do_signal(regs);
> >
> > --
> > 1.7.7.3
>
> Signed-off-by: Richard Kuo <[email protected]>

Did you mean Acked-by? Replying to an email with a Signed-off-by
doesn't mean anything. If you're pulling the patch into your own
tree, add the SoB at that point. If you want to reply that you've
accepted a patch, just say so in English.

David

--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

2012-06-01 19:01:39

by Richard Kuo

[permalink] [raw]
Subject: Re: [PATCH 05/20] hexagon: Do not call do_signal() with irqs disabled

On Fri, Jun 01, 2012 at 11:42:12AM -0700, David Brown wrote:
> On Fri, Jun 01, 2012 at 12:54:59PM -0500, Richard Kuo wrote:
> > On Sat, May 26, 2012 at 12:04:21AM +0200, Richard Weinberger wrote:
> > > get_signal_to_deliver() calls try_to_freeze() which might sleep.
> > >
> > > Cc: Richard Kuo <[email protected]>
> > > Cc: [email protected]
> > > Signed-off-by: Richard Weinberger <[email protected]>
> > > ---
> > > arch/hexagon/kernel/signal.c | 3 +++
> > > 1 files changed, 3 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c
> > > index 434866e..8403bfd 100644
> > > --- a/arch/hexagon/kernel/signal.c
> > > +++ b/arch/hexagon/kernel/signal.c
> > > @@ -22,6 +22,7 @@
> > > #include <linux/syscalls.h>
> > > #include <linux/freezer.h>
> > > #include <linux/tracehook.h>
> > > +#include <linux/irqflags.h>
> > > #include <asm/registers.h>
> > > #include <asm/thread_info.h>
> > > #include <asm/unistd.h>
> > > @@ -267,6 +268,8 @@ no_restart:
> > >
> > > void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
> > > {
> > > + local_irq_enable();
> > > +
> > > if (thread_info_flags & _TIF_SIGPENDING)
> > > do_signal(regs);
> > >
> > > --
> > > 1.7.7.3
> >
> > Signed-off-by: Richard Kuo <[email protected]>
>
> Did you mean Acked-by? Replying to an email with a Signed-off-by
> doesn't mean anything. If you're pulling the patch into your own
> tree, add the SoB at that point. If you want to reply that you've
> accepted a patch, just say so in English.
>
> David

Doh, sorry, I really meant Acked-by. Thanks for catching that.


--

Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

2012-06-01 19:02:05

by Richard Kuo

[permalink] [raw]
Subject: Re: [PATCH 05/20] hexagon: Do not call do_signal() with irqs disabled

On Sat, May 26, 2012 at 12:04:21AM +0200, Richard Weinberger wrote:
> get_signal_to_deliver() calls try_to_freeze() which might sleep.
>
> Cc: Richard Kuo <[email protected]>
> Cc: [email protected]
> Signed-off-by: Richard Weinberger <[email protected]>
> ---
> arch/hexagon/kernel/signal.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c
> index 434866e..8403bfd 100644
> --- a/arch/hexagon/kernel/signal.c
> +++ b/arch/hexagon/kernel/signal.c
> @@ -22,6 +22,7 @@
> #include <linux/syscalls.h>
> #include <linux/freezer.h>
> #include <linux/tracehook.h>
> +#include <linux/irqflags.h>
> #include <asm/registers.h>
> #include <asm/thread_info.h>
> #include <asm/unistd.h>
> @@ -267,6 +268,8 @@ no_restart:
>
> void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
> {
> + local_irq_enable();
> +
> if (thread_info_flags & _TIF_SIGPENDING)
> do_signal(regs);
>
> --
> 1.7.7.3
>

Acked-by: Richard Kuo <[email protected]>


--

Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

2012-06-01 19:02:26

by Richard Kuo

[permalink] [raw]
Subject: Re: [PATCH 17/20] hexagon: Do not call try_to_freeze() in do_signal()

On Sat, May 26, 2012 at 12:04:33AM +0200, Richard Weinberger wrote:
> get_signal_to_deliver() already calls try_to_freeze(), there is no
> need to call it directly.
>
> Cc: Richard Kuo <[email protected]>
> Cc: [email protected]
> Signed-off-by: Richard Weinberger <[email protected]>
> ---
> arch/hexagon/kernel/signal.c | 5 -----
> 1 files changed, 0 insertions(+), 5 deletions(-)
>
> diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c
> index 8403bfd..9783cfa 100644
> --- a/arch/hexagon/kernel/signal.c
> +++ b/arch/hexagon/kernel/signal.c
> @@ -20,7 +20,6 @@
>
> #include <linux/linkage.h>
> #include <linux/syscalls.h>
> -#include <linux/freezer.h>
> #include <linux/tracehook.h>
> #include <linux/irqflags.h>
> #include <asm/registers.h>
> @@ -210,9 +209,6 @@ static void do_signal(struct pt_regs *regs)
> if (!user_mode(regs))
> return;
>
> - if (try_to_freeze())
> - goto no_signal;
> -
> signo = get_signal_to_deliver(&info, &sigact, regs, NULL);
>
> if (signo > 0) {
> @@ -237,7 +233,6 @@ static void do_signal(struct pt_regs *regs)
> return;
> }
>
> -no_signal:
> /*
> * If we came from a system call, handle the restart.
> */
> --
> 1.7.7.3
>

Acked-by: Richard Kuo <[email protected]>

--

Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.