[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200309085806.155823-8-ravi.bangoria@linux.ibm.com>
Date: Mon, 9 Mar 2020 14:27:58 +0530
From: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
To: mpe@...erman.id.au, mikey@...ling.org
Cc: apopple@...ux.ibm.com, paulus@...ba.org, npiggin@...il.com,
christophe.leroy@....fr, naveen.n.rao@...ux.vnet.ibm.com,
peterz@...radead.org, jolsa@...nel.org, oleg@...hat.com,
fweisbec@...il.com, mingo@...nel.org,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
Subject: [PATCH 07/15] powerpc/watchpoint: Get watchpoint count dynamically while disabling them
Instead of disabling only one watchpooint, get num of available
watchpoints dynamically and disable all of them.
Signed-off-by: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
---
arch/powerpc/include/asm/hw_breakpoint.h | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch/powerpc/include/asm/hw_breakpoint.h
index 980ac7d9f267..ec61e2b7195c 100644
--- a/arch/powerpc/include/asm/hw_breakpoint.h
+++ b/arch/powerpc/include/asm/hw_breakpoint.h
@@ -75,14 +75,13 @@ extern void ptrace_triggered(struct perf_event *bp,
struct perf_sample_data *data, struct pt_regs *regs);
static inline void hw_breakpoint_disable(void)
{
- struct arch_hw_breakpoint brk;
-
- brk.address = 0;
- brk.type = 0;
- brk.len = 0;
- brk.hw_len = 0;
- if (ppc_breakpoint_available())
- __set_breakpoint(&brk, 0);
+ int i;
+ struct arch_hw_breakpoint null_brk = {0};
+
+ if (ppc_breakpoint_available()) {
+ for (i = 0; i < nr_wp_slots(); i++)
+ __set_breakpoint(&null_brk, i);
+ }
}
extern void thread_change_pc(struct task_struct *tsk, struct pt_regs *regs);
int hw_breakpoint_handler(struct die_args *args);
--
2.21.1
Powered by blists - more mailing lists