All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: reenable interrupt when handling ptrace breakpoint
@ 2015-12-16  0:18 ` Yang Shi
  0 siblings, 0 replies; 31+ messages in thread
From: Yang Shi @ 2015-12-16  0:18 UTC (permalink / raw)
  To: Will.Deacon, Catalin.Marinas
  Cc: linux-kernel, linux-arm-kernel, linaro-kernel, yang.shi

The kernel just send out a SIGTRAP signal when handling ptrace breakpoint in
debug exception, so it sounds safe to have interrupt enabled if it is not
disabled by the parent process.

Signed-off-by: Yang Shi <yang.shi@linaro.org>
---
 arch/arm64/kernel/debug-monitors.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index 8aee3ae..90d70e4 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -239,6 +239,9 @@ static int single_step_handler(unsigned long addr, unsigned int esr,
 		return 0;
 
 	if (user_mode(regs)) {
+		if (interrupts_enabled(regs))
+			local_irq_enable();
+
 		info.si_signo = SIGTRAP;
 		info.si_errno = 0;
 		info.si_code  = TRAP_HWBKPT;
@@ -310,6 +313,9 @@ static int brk_handler(unsigned long addr, unsigned int esr,
 	siginfo_t info;
 
 	if (user_mode(regs)) {
+		if (interrupts_enabled(regs))
+			local_irq_enable();
+
 		info = (siginfo_t) {
 			.si_signo = SIGTRAP,
 			.si_errno = 0,
@@ -337,6 +343,10 @@ int aarch32_break_handler(struct pt_regs *regs)
 	if (!compat_user_mode(regs))
 		return -EFAULT;
 
+	/* COMPAT_PSR_I_BIT has the same bit mask with non-compat one */
+	if (interrupts_enabled(regs))
+		local_irq_enable();
+
 	if (compat_thumb_mode(regs)) {
 		/* get 16-bit Thumb instruction */
 		get_user(thumb_instr, (u16 __user *)pc);
-- 
2.0.2


^ permalink raw reply related	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2016-02-11 17:30 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-16  0:18 [PATCH] arm64: reenable interrupt when handling ptrace breakpoint Yang Shi
2015-12-16  0:18 ` Yang Shi
2015-12-16 11:13 ` Will Deacon
2015-12-16 11:13   ` Will Deacon
2015-12-16 20:45   ` Shi, Yang
2015-12-16 20:45     ` Shi, Yang
2015-12-21 10:48     ` Will Deacon
2015-12-21 10:48       ` Will Deacon
2015-12-21 16:51       ` Thomas Gleixner
2015-12-21 16:51         ` Thomas Gleixner
2015-12-21 17:00         ` Will Deacon
2015-12-21 17:00           ` Will Deacon
2015-12-21 17:27           ` Shi, Yang
2015-12-21 17:27             ` Shi, Yang
2016-01-12 19:59           ` Shi, Yang
2016-01-12 19:59             ` Shi, Yang
2016-01-13 10:26             ` Will Deacon
2016-01-13 10:26               ` Will Deacon
2016-01-13 10:26               ` Will Deacon
2016-01-13 17:17               ` Shi, Yang
2016-01-13 17:17                 ` Shi, Yang
2016-01-13 17:23                 ` Will Deacon
2016-01-13 17:23                   ` Will Deacon
2016-01-13 18:10                   ` Shi, Yang
2016-01-13 18:10                     ` Shi, Yang
2016-02-05 21:25                     ` Shi, Yang
2016-02-05 21:25                       ` Shi, Yang
2016-02-11 13:54                       ` Will Deacon
2016-02-11 13:54                         ` Will Deacon
2016-02-11 17:29                         ` Shi, Yang
2016-02-11 17:29                           ` Shi, Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.