Skip to contentSkip to conversation

Patch "powerpc/xmon: Fix data-breakpoint" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Mar 10, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

powerpc/xmon: Fix data-breakpoint

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
powerpc-xmon-fix-data-breakpoint.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From c21a493a2b44650707d06741601894329486f2ad Mon Sep 17 00:00:00 2001

From: Ravi Bangoria <[email protected]>
Date: Tue, 22 Nov 2016 14:55:59 +0530
Subject: powerpc/xmon: Fix data-breakpoint

From: Ravi Bangoria <[email protected]>

commit c21a493a2b44650707d06741601894329486f2ad upstream.

Currently xmon data-breakpoint feature is broken.

Whenever there is a watchpoint match occurs, hw_breakpoint_handler will be called by do_break via notifier chains mechanism. If watchpoint is registered by xmon, hw_breakpoint_handler won't find any associated perf_event and returns immediately with NOTIFY_STOP. Similarly, do_break also returns without notifying to xmon.

Solve this by returning NOTIFY_DONE when hw_breakpoint_handler does not find any perf_event associated with matched watchpoint, rather than NOTIFY_STOP, which tells the core code to continue calling the other breakpoint handlers including the xmon one.

---
 arch/powerpc/kernel/hw_breakpoint.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/kernel/hw_breakpoint.c +3 -1
@@ -227,8 +227,10 @@ int __kprobes hw_breakpoint_handler(stru
 	rcu_read_lock();
 
 	bp = __this_cpu_read(bp_per_reg);
-	if (!bp)
+	if (!bp) {
+		rc = NOTIFY_DONE;
 		goto out;
+	}
 	info = counter_arch_bp(bp);
 
 	/*

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/powerpc-xmon-fix-data-breakpoint.patch