Re: [PATCH RESEND 1/2] tools/perf: Add arch neutral function to choose event for perf kvm record

2019-06-10 Thread Ravi Bangoria
: all warnings being treated as errors mv: cannot stat './.builtin-kvm.o.tmp': No such file or directory With the build fix: Acked-by: Ravi Bangoria

[PATCH] perf version: Fix segfault

2019-06-10 Thread Ravi Bangoria
'perf version' on powerpc segfaults when used with non-supported option: # perf version -a Segmentation fault (core dumped) Fix this. Signed-off-by: Ravi Bangoria Reviewed-by: Kamalesh babulal Tested-by: Mamatha Inamdar --- tools/perf/builtin-version.c | 1 + 1 file changed, 1 insertion

[PATCH RESEND] Powerpc/Watchpoint: Restore nvgprs while returning from exception

2019-06-10 Thread Ravi Bangoria
this instruction was emulated by emulate_step. But because handle_dabr_fault did not restore emulated register state, r29 still contains stale value in above register state. Fixes: 5aae8a5370802 ("powerpc, hw_breakpoints: Implement hw_breakpoints for 64-bit server processors"

Re: [PATCH] perf: Fix oops when kthread execs user process

2019-05-30 Thread Ravi Bangoria
t;powerpc/perf: Fix oops when kthread execs > user process") > > Reported-by: Ravi Bangoria > Reported-by: Young Xiao <92siuy...@gmail.com> > Cc: Ravi Bangoria > Cc: Naveen N. Rao > Cc: Michael Ellerman > Cc: Jiri Olsa > Cc: Frederic Weisbecker > Cc: Stepha

Re: [PATCH] perf: Fix oops when kthread execs user process

2019-05-30 Thread Ravi Bangoria
On 5/30/19 2:08 PM, Ravi Bangoria wrote: >> --- >> Subject: perf: Fix perf_sample_regs_user() >> From: Peter Zijlstra >> Date: Wed May 29 14:37:24 CEST 2019 >> >> perf_sample_regs_user() uses 'current->mm' to test for the presence of >> userspa

Re: [PATCH v2 1/3] tools/perf: Move kvm-stat header file from conditional inclusion to common include section

2019-07-18 Thread Ravi Bangoria
LGTM. For the series, Reviewed-By: Ravi Bangoria

Re: [PATCH v3 0/3] Powerpc64/Watchpoint: Few important fixes

2019-08-05 Thread Ravi Bangoria
Mikey, mpe ... Any thoughts?

[PATCH] perf c2c: Fix report with offline cpus

2019-08-22 Thread Ravi Bangoria
key") Reported-by: Nageswara R Sastry Signed-off-by: Ravi Bangoria --- tools/perf/builtin-c2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 9e6cc86..fc68a94 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/buil

Re: [PATCH v4 0/5] Powerpc/Watchpoint: Few important fixes

2019-10-07 Thread Ravi Bangoria
On 9/25/19 9:36 AM, Ravi Bangoria wrote: v3: https://lists.ozlabs.org/pipermail/linuxppc-dev/2019-July/193339.html v3->v4: - Instead of considering exception as extraneous when dar is outside of user specified range, analyse the instruction and check for overlap between u

[PATCH v6 1/7] Powerpc/Watchpoint: Introduce macros for watchpoint length

2019-10-17 Thread Ravi Bangoria
We are hadrcoding length everywhere in the watchpoint code. Introduce macros for the length and use them. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hw_breakpoint.h | 3 +++ arch/powerpc/kernel/hw_breakpoint.c | 4 ++-- arch/powerpc/kernel/ptrace.c | 6

[PATCH v6 0/7] Powerpc/Watchpoint: Few important fixes

2019-10-17 Thread Ravi Bangoria
ror=strict-aliasing] temp16 = *((__u16 *)target); ^ Fixed that. Ravi Bangoria (7): Powerpc/Watchpoint: Introduce macros for watchpoint length Powerpc/Watchpoint: Fix length calculation for unaligned target Powerpc/Watchpoint: Fix ptrace code that muck around with address/

[PATCH v6 4/7] Powerpc/Watchpoint: Don't ignore extraneous exceptions blindly

2019-10-17 Thread Ravi Bangoria
of blindly ignoring the exception, get actual address range by analysing an instruction, and ignore only if actual range does not overlap with user specified range. Note: The behavior is unchanged for 8xx. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 52

[PATCH v6 2/7] Powerpc/Watchpoint: Fix length calculation for unaligned target

2019-10-17 Thread Ravi Bangoria
including next doubleword in the length. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hw_breakpoint.h | 2 + arch/powerpc/kernel/dawr.c | 6 +-- arch/powerpc/kernel/hw_breakpoint.c | 67 +--- arch/powerpc/kernel/process.c| 3 ++ ar

[PATCH v6 7/7] Powerpc/Watchpoint: Support for 8xx in ptrace-hwbreak.c selftest

2019-10-17 Thread Ravi Bangoria
-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/ptrace-hwbreak.c | 32 +-- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c b/tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c index 916e97f5f8b1

[PATCH v6 6/7] Powerpc/Watchpoint: Add dar outside test in perf-hwbreak.c selftest

2019-10-17 Thread Ravi Bangoria
: No overlap TESTED: Partial overlap TESTED: Partial overlap TESTED: No overlap TESTED: Full overlap success: perf_hwbreak Signed-off-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/perf-hwbreak.c | 119 +- 1 file changed, 118 insertions(+), 1 deletion(-) diff --git

[PATCH v6 3/7] Powerpc/Watchpoint: Fix ptrace code that muck around with address/len

2019-10-17 Thread Ravi Bangoria
second doubleword. So fix that as well. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hw_breakpoint.h | 4 ++-- arch/powerpc/kernel/ptrace.c | 9 +++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch

[PATCH v6 5/7] Powerpc/Watchpoint: Rewrite ptrace-hwbreak.c selftest

2019-10-17 Thread Ravi Bangoria
success: ptrace-hwbreak Signed-off-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/ptrace-hwbreak.c | 571 +++--- 1 file changed, 361 insertions(+), 210 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c b/tools/testing/selftests/powerpc/ptrace/ptrace

Re: [PATCH v4 0/5] Powerpc/Watchpoint: Few important fixes

2019-10-09 Thread Ravi Bangoria
@Christophe, Is patch5 works for you on 8xx? Getting the following : root@vgoip:~# ./ptrace-hwbreak test: ptrace-hwbreak tags: git_version:v5.4-rc2-710-gf0082e173fe4-dirty PTRACE_SET_DEBUGREG, WO, len: 1: Ok PTRACE_SET_DEBUGREG, WO, len: 2: Ok PTRACE_SET_DEBUGREG, WO, len: 4: Ok

Re: [PATCH v4 0/5] Powerpc/Watchpoint: Few important fixes

2019-10-10 Thread Ravi Bangoria
On 10/10/19 10:14 AM, Ravi Bangoria wrote: @Christophe, Is patch5 works for you on 8xx? Getting the following : root@vgoip:~# ./ptrace-hwbreak test: ptrace-hwbreak tags: git_version:v5.4-rc2-710-gf0082e173fe4-dirty PTRACE_SET_DEBUGREG, WO, len: 1: Ok PTRACE_SET_DEBUGREG, WO, len: 2: Ok

[PATCH v4 00/16] powerpc/watchpoint: Preparation for more than one watchpoint

2020-04-29 Thread Ravi Bangoria
://lore.kernel.org/linuxppc-dev/20200414031659.58875-1-ravi.bango...@linux.ibm.com v3->v4: - Reduce the scope of local variables to increase readability at some places, suggested by Christophe. - Added Michael Neuling's Reviewed by for the series. - Rebased to powerpc/next Ravi Bangoria (16): powe

[PATCH v4 03/16] powerpc/watchpoint: Introduce function to get nr watchpoints dynamically

2020-04-29 Thread Ravi Bangoria
to HBP_NUM_MAX, which will now represent maximum number of watchpoints supported by Powerpc. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/include/asm/cputable.h | 6 +- arch/powerpc/include/asm/hw_breakpoint.h | 5 + arch/powerpc/include/asm/processor.h

[PATCH v4 02/16] powerpc/watchpoint: Add SPRN macros for second DAWR

2020-04-29 Thread Ravi Bangoria
Future Power architecture is introducing second DAWR. Add SPRN_ macros for the same. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/include/asm/reg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm

[PATCH v4 06/16] powerpc/watchpoint: Provide DAWR number to __set_breakpoint

2020-04-29 Thread Ravi Bangoria
Introduce new parameter 'nr' to __set_breakpoint() which indicates which DAWR should be programed. Also convert current_brk variable to an array. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/include/asm/debug.h | 2 +- arch/powerpc/include/asm

[PATCH v4 04/16] powerpc/watchpoint/ptrace: Return actual num of available watchpoints

2020-04-29 Thread Ravi Bangoria
User can ask for num of available watchpoints(dbginfo.num_data_bps) using ptrace(PPC_PTRACE_GETHWDBGINFO). Return actual number of available watchpoints on the machine rather than hardcoded 1. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/kernel/ptrace/ptrace

[PATCH v4 01/16] powerpc/watchpoint: Rename current DAWR macros

2020-04-29 Thread Ravi Bangoria
Future Power architecture is introducing second DAWR. Use real register names from ISA for current macros: s/SPRN_DAWR/SPRN_DAWR0/ s/SPRN_DAWRX/SPRN_DAWRX0/ Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/include/asm/reg.h | 4 ++-- arch/powerpc/kernel

[PATCH v4 09/16] powerpc/watchpoint: Convert thread_struct->hw_brk to an array

2020-04-29 Thread Ravi Bangoria
So far powerpc hw supported only one watchpoint. But Future Power architecture is introducing 2nd DAWR. Convert thread_struct->hw_brk into an array. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/include/asm/processor.h | 2 +- arch/powerpc/kernel/proces

[PATCH v4 10/16] powerpc/watchpoint: Use loop for thread_struct->ptrace_bps

2020-04-29 Thread Ravi Bangoria
it. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/kernel/hw_breakpoint.c | 7 -- arch/powerpc/kernel/process.c | 6 - arch/powerpc/kernel/ptrace/ptrace-noadv.c | 28 +-- 3 files changed, 31 insertions(+), 10 deletions

[PATCH v4 14/16] powerpc/watchpoint: Don't allow concurrent perf and ptrace events

2020-04-29 Thread Ravi Bangoria
range overlaps. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/include/asm/hw_breakpoint.h | 2 + arch/powerpc/kernel/hw_breakpoint.c | 221 +++ kernel/events/hw_breakpoint.c| 16 ++ 3 files changed, 239 insertions(+) diff

[PATCH v4 15/16] powerpc/watchpoint/xmon: Don't allow breakpoint overwriting

2020-04-29 Thread Ravi Bangoria
Xmon allows overwriting breakpoints because it's supported by only one dawr. But with multiple dawrs, overwriting becomes ambiguous or unnecessary complicated. So let's not allow it. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/xmon/xmon.c | 4 1 file changed

[PATCH v4 16/16] powerpc/watchpoint/xmon: Support 2nd dawr

2020-04-29 Thread Ravi Bangoria
Add support for 2nd DAWR in xmon. With this, we can have two simultaneous breakpoints from xmon. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/xmon/xmon.c | 101 ++- 1 file changed, 69 insertions(+), 32 deletions(-) diff --git

[PATCH v4 12/16] powerpc/watchpoint: Use builtin ALIGN*() macros

2020-04-29 Thread Ravi Bangoria
Currently we calculate hw aligned start and end addresses manually. Replace them with builtin ALIGN_DOWN() and ALIGN() macros. So far end_addr was inclusive but this patch makes it exclusive (by avoiding -1) for better readability. Suggested-by: Christophe Leroy Signed-off-by: Ravi Bangoria

[PATCH v4 11/16] powerpc/watchpoint: Introduce is_ptrace_bp() function

2020-04-29 Thread Ravi Bangoria
Introduce is_ptrace_bp() function and move the check inside the function. We will utilize it more in later set of patches. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/kernel/hw_breakpoint.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git

[PATCH v4 13/16] powerpc/watchpoint: Prepare handler to handle more than one watcnhpoint

2020-04-29 Thread Ravi Bangoria
is configured for readonly watchpoint and the instruction is store, this DAWR must not have caused exception. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/include/asm/processor.h | 2 +- arch/powerpc/include/asm/sstep.h | 2 + arch/powerpc/kernel/hw_breakpoint.c

[PATCH v4 08/16] powerpc/watchpoint: Disable all available watchpoints when !dawr_force_enable

2020-04-29 Thread Ravi Bangoria
-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/kernel/dawr.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/dawr.c b/arch/powerpc/kernel/dawr.c index 8114ad3a8574..500f52fa4711 100644 --- a/arch/powerpc/kernel/dawr.c +++ b

[PATCH v4 07/16] powerpc/watchpoint: Get watchpoint count dynamically while disabling them

2020-04-29 Thread Ravi Bangoria
Instead of disabling only one watchpoint, get num of available watchpoints dynamically and disable all of them. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/include/asm/hw_breakpoint.h | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff

[PATCH v4 05/16] powerpc/watchpoint: Provide DAWR number to set_dawr

2020-04-29 Thread Ravi Bangoria
Introduce new parameter 'nr' to set_dawr() which indicates which DAWR should be programed. Signed-off-by: Ravi Bangoria Reviewed-by: Michael Neuling --- arch/powerpc/include/asm/hw_breakpoint.h | 4 ++-- arch/powerpc/kernel/dawr.c | 15 ++- arch/powerpc/kernel

Re: [PATCH v4 0/5] Powerpc/Watchpoint: Few important fixes

2019-10-13 Thread Ravi Bangoria
On 10/12/19 1:01 PM, Christophe Leroy wrote: Le 10/10/2019 à 08:25, Ravi Bangoria a écrit : On 10/10/19 10:14 AM, Ravi Bangoria wrote: @Christophe, Is patch5 works for you on 8xx? Getting the following : root@vgoip:~# ./ptrace-hwbreak test: ptrace-hwbreak tags: git_version:v5.4

Re: [PATCH v4 0/5] Powerpc/Watchpoint: Few important fixes

2019-10-13 Thread Ravi Bangoria
On 10/12/19 2:21 PM, Christophe Leroy wrote: Le 10/10/2019 à 06:44, Ravi Bangoria a écrit : @Christophe, Is patch5 works for you on 8xx? Getting the following : root@vgoip:~# ./ptrace-hwbreak test: ptrace-hwbreak tags: git_version:v5.4-rc2-710-gf0082e173fe4-dirty PTRACE_SET_DEBUGREG

[PATCH v5 1/7] Powerpc/Watchpoint: Introduce macros for watchpoint length

2019-10-14 Thread Ravi Bangoria
We are hadrcoding length everywhere in the watchpoint code. Introduce macros for the length and use them. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hw_breakpoint.h | 3 +++ arch/powerpc/kernel/hw_breakpoint.c | 4 ++-- arch/powerpc/kernel/ptrace.c | 6

[PATCH v5 2/7] Powerpc/Watchpoint: Fix length calculation for unaligned target

2019-10-14 Thread Ravi Bangoria
including next doubleword in the length. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hw_breakpoint.h | 2 + arch/powerpc/kernel/dawr.c | 6 +-- arch/powerpc/kernel/hw_breakpoint.c | 67 +--- arch/powerpc/kernel/process.c| 3 ++ ar

[PATCH v5 6/7] Powerpc/Watchpoint: Add dar outside test in perf-hwbreak.c selftest

2019-10-14 Thread Ravi Bangoria
: No overlap TESTED: Partial overlap TESTED: Partial overlap TESTED: No overlap TESTED: Full overlap success: perf_hwbreak Signed-off-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/perf-hwbreak.c | 111 +- 1 file changed, 110 insertions(+), 1 deletion(-) diff --git

[PATCH v5 5/7] Powerpc/Watchpoint: Rewrite ptrace-hwbreak.c selftest

2019-10-14 Thread Ravi Bangoria
success: ptrace-hwbreak Signed-off-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/ptrace-hwbreak.c | 571 +++--- 1 file changed, 361 insertions(+), 210 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c b/tools/testing/selftests/powerpc/ptrace/ptrace

[PATCH v5 3/7] Powerpc/Watchpoint: Fix ptrace code that muck around with address/len

2019-10-14 Thread Ravi Bangoria
second doubleword. So fix that as well. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hw_breakpoint.h | 4 ++-- arch/powerpc/kernel/ptrace.c | 9 +++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch

[PATCH v5 4/7] Powerpc/Watchpoint: Don't ignore extraneous exceptions blindly

2019-10-14 Thread Ravi Bangoria
of blindly ignoring the exception, get actual address range by analysing an instruction, and ignore only if actual range does not overlap with user specified range. Note: The behavior is unchanged for 8xx. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 52

[PATCH v5 0/7] Powerpc/Watchpoint: Few important fixes

2019-10-14 Thread Ravi Bangoria
nts are not supported with DABR. Test unaligned watchpoint only when DAWR is present. Ravi Bangoria (7): Powerpc/Watchpoint: Introduce macros for watchpoint length Powerpc/Watchpoint: Fix length calculation for unaligned target Powerpc/Watchpoint: Fix ptrace code that muck around with address/len Powe

[PATCH v5 7/7] Powerpc/Watchpoint: Support for 8xx in ptrace-hwbreak.c selftest

2019-10-14 Thread Ravi Bangoria
-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/ptrace-hwbreak.c | 32 +-- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c b/tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c index 916e97f5f8b1

[PATCH v4 0/5] Powerpc/Watchpoint: Few important fixes

2019-09-24 Thread Ravi Bangoria
ted it with ep88xc_defconfig. Ravi Bangoria (5): Powerpc/Watchpoint: Fix length calculation for unaligned target Powerpc/Watchpoint: Don't ignore extraneous exceptions blindly Powerpc/Watchpoint: Rewrite ptrace-hwbreak.c selftest Powerpc/Watchpoint: Add dar outside test in perf-hwbreak.c selftest Powe

[PATCH v4 3/5] Powerpc/Watchpoint: Rewrite ptrace-hwbreak.c selftest

2019-09-24 Thread Ravi Bangoria
success: ptrace-hwbreak Signed-off-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/ptrace-hwbreak.c | 571 +++--- 1 file changed, 361 insertions(+), 210 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c b/tools/testing/selftests/powerpc/ptrace/ptrace

[PATCH v4 1/5] Powerpc/Watchpoint: Fix length calculation for unaligned target

2019-09-24 Thread Ravi Bangoria
including next doubleword in the length. Plus, fix ptrace code which is messing up address/len. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/debug.h | 1 + arch/powerpc/include/asm/hw_breakpoint.h | 9 +++-- arch/powerpc/kernel/dawr.c | 6 ++-- arch/powe

[PATCH v4 2/5] Powerpc/Watchpoint: Don't ignore extraneous exceptions blindly

2019-09-24 Thread Ravi Bangoria
of blindly ignoring the exception, get actual address range by analysing an instruction, and ignore only if actual range does not overlap with user specified range. Note: The behaviour is unchanged for 8xx. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 52

[PATCH v4 4/5] Powerpc/Watchpoint: Add dar outside test in perf-hwbreak.c selftest

2019-09-24 Thread Ravi Bangoria
: No overlap TESTED: Partial overlap TESTED: Partial overlap TESTED: No overlap TESTED: Full overlap success: perf_hwbreak Signed-off-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/perf-hwbreak.c | 111 +- 1 file changed, 110 insertions(+), 1 deletion(-) diff --git

[PATCH v4 5/5] Powerpc/Watchpoint: Support for 8xx in ptrace-hwbreak.c selftest

2019-09-24 Thread Ravi Bangoria
On the 8xx, signals are generated after executing the instruction. So no need to manually single-step on 8xx. Signed-off-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/ptrace-hwbreak.c | 26 ++- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/tools/testing

Re: [PATCH v3 2/3] Powerpc64/Watchpoint: Don't ignore extraneous exceptions

2019-09-04 Thread Ravi Bangoria
On 9/4/19 8:12 PM, Naveen N. Rao wrote: Ravi Bangoria wrote: On Powerpc64, watchpoint match range is double-word granular. On a watchpoint hit, DAR is set to the first byte of overlap between actual access and watched range. And thus it's quite possible that DAR does not point inside user

Re: [PATCH v4 10/10] powerpc/watchpoint: Remove 512 byte boundary

2020-07-20 Thread Ravi Bangoria
Hi Jordan, On 7/20/20 12:24 PM, Jordan Niethe wrote: On Fri, Jul 17, 2020 at 2:11 PM Ravi Bangoria wrote: Power10 has removed 512 bytes boundary from match criteria. i.e. The watch range can cross 512 bytes boundary. It looks like this change is not mentioned in ISA v3.1 Book III 9.4 Data

Re: [PATCH v4 09/10] powerpc/watchpoint: Return available watchpoints dynamically

2020-07-20 Thread Ravi Bangoria
On 7/20/20 9:12 AM, Jordan Niethe wrote: On Fri, Jul 17, 2020 at 2:11 PM Ravi Bangoria wrote: So far Book3S Powerpc supported only one watchpoint. Power10 is introducing 2nd DAWR. Enable 2nd DAWR support for Power10. Availability of 2nd DAWR will depend on CPU_FTR_DAWR1. Signed-off

Re: [PATCH v4 05/10] powerpc/dt_cpu_ftrs: Add feature for 2nd DAWR

2020-07-21 Thread Ravi Bangoria
On 7/17/20 11:14 AM, Jordan Niethe wrote: On Fri, Jul 17, 2020 at 2:10 PM Ravi Bangoria wrote: Add new device-tree feature for 2nd DAWR. If this feature is present, 2nd DAWR is supported, otherwise not. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/cputable.h | 7

Re: [PATCH v4 09/10] powerpc/watchpoint: Return available watchpoints dynamically

2020-07-21 Thread Ravi Bangoria
@@ -46,7 +47,7 @@ struct arch_hw_breakpoint { static inline int nr_wp_slots(void) { - return HBP_NUM_MAX; + return cpu_has_feature(CPU_FTR_DAWR1) ? HBP_NUM_TWO : HBP_NUM_ONE; So it'd be something like: + return cpu_has_feature(CPU_FTR_DAWR1) ? HBP_NUM_MAX : 1; But

Re: [PATCH v4 09/10] powerpc/watchpoint: Return available watchpoints dynamically

2020-07-21 Thread Ravi Bangoria
On 7/21/20 5:06 PM, Michael Ellerman wrote: Ravi Bangoria writes: On 7/20/20 9:12 AM, Jordan Niethe wrote: On Fri, Jul 17, 2020 at 2:11 PM Ravi Bangoria wrote: So far Book3S Powerpc supported only one watchpoint. Power10 is introducing 2nd DAWR. Enable 2nd DAWR support for Power10

Re: [PATCH v4 05/10] powerpc/dt_cpu_ftrs: Add feature for 2nd DAWR

2020-07-21 Thread Ravi Bangoria
On 7/21/20 4:59 PM, Michael Ellerman wrote: Ravi Bangoria writes: On 7/17/20 11:14 AM, Jordan Niethe wrote: On Fri, Jul 17, 2020 at 2:10 PM Ravi Bangoria wrote: Add new device-tree feature for 2nd DAWR. If this feature is present, 2nd DAWR is supported, otherwise not. Signed-off

Re: [PATCH v4 05/10] powerpc/dt_cpu_ftrs: Add feature for 2nd DAWR

2020-07-21 Thread Ravi Bangoria
On 7/21/20 7:37 PM, Michael Ellerman wrote: Ravi Bangoria writes: On 7/21/20 4:59 PM, Michael Ellerman wrote: Ravi Bangoria writes: On 7/17/20 11:14 AM, Jordan Niethe wrote: On Fri, Jul 17, 2020 at 2:10 PM Ravi Bangoria wrote: Add new device-tree feature for 2nd DAWR. If this feature

Re: [PATCH v3 2/9] powerpc/watchpoint: Fix DAWR exception constraint

2020-07-14 Thread Ravi Bangoria
Hi Jordan, @@ -536,7 +538,12 @@ static bool check_dawrx_constraints(struct pt_regs *regs, int type, if (OP_IS_LOAD(type) && !(info->type & HW_BRK_TYPE_READ)) return false; - if (OP_IS_STORE(type) && !(info->type & HW_BRK_TYPE_WRITE)) + /* +* The

Re: [PATCH v2 2/3] powerpc/powernv/idle: save-restore DAWR0,DAWRX0 for P10

2020-07-19 Thread Ravi Bangoria
Hi Pratik, On 7/10/20 10:52 AM, Pratik Rajesh Sampat wrote: Additional registers DAWR0, DAWRX0 may be lost on Power 10 for stop levels < 4. p10 has one more pair DAWR1/DAWRX1. Please include that as well. Ravi

Re: [PATCH v2 2/3] powerpc/powernv/idle: save-restore DAWR0, DAWRX0 for P10

2020-07-19 Thread Ravi Bangoria
Hi Nick, On 7/13/20 11:22 AM, Nicholas Piggin wrote: Excerpts from Pratik Rajesh Sampat's message of July 10, 2020 3:22 pm: Additional registers DAWR0, DAWRX0 may be lost on Power 10 for stop levels < 4. Therefore save the values of these SPRs before entering a "stop" state and restore their

Re: [PATCH 1/2] libsubcmd: Fix OPT_CALLBACK_SET()

2020-07-16 Thread Ravi Bangoria
Hi Arnaldo, Can you please consider this trivial fix. Ravi On 6/19/20 7:04 PM, Ravi Bangoria wrote: Any option macro with _SET suffix should set opt->set variable which is not happening for OPT_CALLBACK_SET(). This is causing issues with perf record --switch-output-event. Fix that. Bef

[PATCH v4 01/10] powerpc/watchpoint: Fix 512 byte boundary limit

2020-07-16 Thread Ravi Bangoria
: Use builtin ALIGN*() macros") Reported-by: Milton Miller Signed-off-by: Ravi Bangoria Tested-by: Jordan Niethe --- arch/powerpc/kernel/hw_breakpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoi

[PATCH v4 00/10] powerpc/watchpoint: Enable 2nd DAWR on baremetal and powervm

2020-07-16 Thread Ravi Bangoria
->v4: - v3 patch #2 is split into two v4 patches: #2 and #3 - Few other minor neats suggested by Jordan Niethe - Rebased to powerpc/next [1]: https://lore.kernel.org/linuxppc-dev/20200514111741.97993-1-ravi.bango...@linux.ibm.com/ Ravi Bangoria (10): powerpc/watchpoint: Fix 512 byte bound

[PATCH v4 02/10] powerpc/watchpoint: Fix DAWR exception constraint

2020-07-16 Thread Ravi Bangoria
Franco de Carvalho Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 72 - 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c index 031e6defc08e..a971e22aea81 10

[PATCH v4 03/10] powerpc/watchpoint: Fix DAWR exception for CACHEOP

2020-07-16 Thread Ravi Bangoria
ot;) Fixes: 74c6881019b7 ("powerpc/watchpoint: Prepare handler to handle more than one watchpoint") Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/hw_breakpoi

[PATCH v4 07/10] powerpc/watchpoint: Rename current H_SET_MODE DAWR macro

2020-07-16 Thread Ravi Bangoria
Current H_SET_MODE hcall macro name for setting/resetting DAWR0 is H_SET_MODE_RESOURCE_SET_DAWR. Add suffix 0 to macro name as well. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hvcall.h | 2 +- arch/powerpc/include/asm/plpar_wrappers.h | 2 +- arch/powerpc/kvm/book3s_hv.c

[PATCH v4 05/10] powerpc/dt_cpu_ftrs: Add feature for 2nd DAWR

2020-07-16 Thread Ravi Bangoria
Add new device-tree feature for 2nd DAWR. If this feature is present, 2nd DAWR is supported, otherwise not. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/cputable.h | 7 +-- arch/powerpc/kernel/dt_cpu_ftrs.c | 7 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff

[PATCH v4 04/10] powerpc/watchpoint: Enable watchpoint functionality on power10 guest

2020-07-16 Thread Ravi Bangoria
CPU_FTR_DAWR to CPU_FTRS_POWER10. Note that this change does not enable 2nd DAWR support. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/cputable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h

[PATCH v4 10/10] powerpc/watchpoint: Remove 512 byte boundary

2020-07-16 Thread Ravi Bangoria
Power10 has removed 512 bytes boundary from match criteria. i.e. The watch range can cross 512 bytes boundary. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/hw_breakpoint.c b

[PATCH v4 09/10] powerpc/watchpoint: Return available watchpoints dynamically

2020-07-16 Thread Ravi Bangoria
So far Book3S Powerpc supported only one watchpoint. Power10 is introducing 2nd DAWR. Enable 2nd DAWR support for Power10. Availability of 2nd DAWR will depend on CPU_FTR_DAWR1. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/cputable.h | 4 +++- arch/powerpc/include/asm

[PATCH v4 06/10] powerpc/watchpoint: Set CPU_FTR_DAWR1 based on pa-features bit

2020-07-16 Thread Ravi Bangoria
or guests and thus this change is mostly applicable for guests only. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/prom.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 9cc49f265c86..c76c09b97bc8 100644 --- a/arch/po

[PATCH v4 08/10] powerpc/watchpoint: Guest support for 2nd DAWR hcall

2020-07-16 Thread Ravi Bangoria
2nd DAWR can be set/unset using H_SET_MODE hcall with resource value 5. Enable powervm guest support with that. This has no effect on kvm guest because kvm will return error if guest does hcall with resource value 5. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hvcall.h | 1

[PATCH v5 01/10] powerpc/watchpoint: Fix 512 byte boundary limit

2020-07-23 Thread Ravi Bangoria
: Use builtin ALIGN*() macros") Reported-by: Milton Miller Signed-off-by: Ravi Bangoria Tested-by: Jordan Niethe --- arch/powerpc/kernel/hw_breakpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoi

[PATCH v5 02/10] powerpc/watchpoint: Fix DAWR exception constraint

2020-07-23 Thread Ravi Bangoria
Franco de Carvalho Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 72 - 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c index 031e6defc08e..a971e22aea81 10

[PATCH v5 00/10] powerpc/watchpoint: Enable 2nd DAWR on baremetal and powervm

2020-07-23 Thread Ravi Bangoria
com/ Ravi Bangoria (10): powerpc/watchpoint: Fix 512 byte boundary limit powerpc/watchpoint: Fix DAWR exception constraint powerpc/watchpoint: Fix DAWR exception for CACHEOP powerpc/watchpoint: Enable watchpoint functionality on power10 guest powerpc/dt_cpu_ftrs: Add feature for 2nd D

[PATCH v5 04/10] powerpc/watchpoint: Enable watchpoint functionality on power10 guest

2020-07-23 Thread Ravi Bangoria
CPU_FTR_DAWR to CPU_FTRS_POWER10. Note that this change does not enable 2nd DAWR support. Signed-off-by: Ravi Bangoria Tested-by: Jordan Niethe --- arch/powerpc/include/asm/cputable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/cputable.h b/arch

[PATCH v5 05/10] powerpc/dt_cpu_ftrs: Add feature for 2nd DAWR

2020-07-23 Thread Ravi Bangoria
Add new device-tree feature for 2nd DAWR. If this feature is present, 2nd DAWR is supported, otherwise not. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/cputable.h | 3 ++- arch/powerpc/kernel/dt_cpu_ftrs.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch

[PATCH v5 06/10] powerpc/watchpoint: Set CPU_FTR_DAWR1 based on pa-features bit

2020-07-23 Thread Ravi Bangoria
or guests and thus this change is mostly applicable for guests only. Signed-off-by: Ravi Bangoria Tested-by: Jordan Niethe --- arch/powerpc/kernel/prom.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 033d43819ed8..01dda206

[PATCH v5 03/10] powerpc/watchpoint: Fix DAWR exception for CACHEOP

2020-07-23 Thread Ravi Bangoria
ot;) Fixes: 74c6881019b7 ("powerpc/watchpoint: Prepare handler to handle more than one watchpoint") Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/hw_breakpoi

[PATCH v5 08/10] powerpc/watchpoint: Guest support for 2nd DAWR hcall

2020-07-23 Thread Ravi Bangoria
2nd DAWR can be set/unset using H_SET_MODE hcall with resource value 5. Enable powervm guest support with that. This has no effect on kvm guest because kvm will return error if guest does hcall with resource value 5. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hvcall.h | 1

[PATCH v5 07/10] powerpc/watchpoint: Rename current H_SET_MODE DAWR macro

2020-07-23 Thread Ravi Bangoria
Current H_SET_MODE hcall macro name for setting/resetting DAWR0 is H_SET_MODE_RESOURCE_SET_DAWR. Add suffix 0 to macro name as well. Signed-off-by: Ravi Bangoria Reviewed-by: Jordan Niethe --- arch/powerpc/include/asm/hvcall.h | 2 +- arch/powerpc/include/asm/plpar_wrappers.h | 2

[PATCH v5 09/10] powerpc/watchpoint: Return available watchpoints dynamically

2020-07-23 Thread Ravi Bangoria
So far Book3S Powerpc supported only one watchpoint. Power10 is introducing 2nd DAWR. Enable 2nd DAWR support for Power10. Availability of 2nd DAWR will depend on CPU_FTR_DAWR1. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/cputable.h | 5 +++-- arch/powerpc/include/asm

[PATCH v5 10/10] powerpc/watchpoint: Remove 512 byte boundary

2020-07-23 Thread Ravi Bangoria
mentions about removal of 512B boundary: Multiple DEAW: Added a second Data Address Watchpoint. [H]DAR is set to the first byte of overlap. 512B boundary is removed. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions

[PATCH v2] powerpc/watchpoint/ptrace: Introduce PPC_DEBUG_FEATURE_DATA_BP_DAWR_ARCH_31

2020-07-23 Thread Ravi Bangoria
that availability of 2nd DAWR is independent of this flag and should be checked using ppc_debug_info->num_data_bps. Signed-off-by: Ravi Bangoria --- v1->v2: - Mention new flag in Documentaion/ as well. Documentation/powerpc/ptrace.rst | 1 + arch/powerpc/include/uapi/asm/ptrace.h

[PATCH 3/7] powerpc/watchpoint/kvm: Introduce new capability for 2nd DAWR

2020-07-23 Thread Ravi Bangoria
Introduce KVM_CAP_PPC_DAWR1 which can be used by Qemu to query whether kvm supports 2nd DAWR or not. Signed-off-by: Ravi Bangoria --- arch/powerpc/kvm/powerpc.c | 3 +++ include/uapi/linux/kvm.h | 1 + 2 files changed, 4 insertions(+) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc

[PATCH 6/7] powerpc/selftests/perf-hwbreak: Add testcases for 2nd DAWR

2020-07-23 Thread Ravi Bangoria
, one is RO, other is WO TESTED: Process specific, 512 bytes, unaligned success: perf_hwbreak Signed-off-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/perf-hwbreak.c | 568 +- 1 file changed, 567 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/powerpc

[PATCH 1/7] powerpc/watchpoint/kvm: Rename current DAWR macros and variables

2020-07-23 Thread Ravi Bangoria
Power10 is introducing second DAWR. Use real register names (with suffix 0) from ISA for current macros and variables used by kvm. Signed-off-by: Ravi Bangoria --- Documentation/virt/kvm/api.rst| 4 +-- arch/powerpc/include/asm/kvm_host.h | 4 +-- arch/powerpc/include/uapi

[PATCH 5/7] powerpc/selftests/perf-hwbreak: Coalesce event creation code

2020-07-23 Thread Ravi Bangoria
perf-hwbreak selftest opens hw-breakpoint event at multiple places for which it has same code repeated. Coalesce that code into a function. Signed-off-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/perf-hwbreak.c | 78 +-- 1 file changed, 38 insertions(+), 40 deletions

[PATCH 2/7] powerpc/watchpoint/kvm: Add infrastructure to support 2nd DAWR

2020-07-23 Thread Ravi Bangoria
kvm code assumes single DAWR everywhere. Add code to support 2nd DAWR. DAWR is a hypervisor resource and thus H_SET_MODE hcall is used to set/ unset it. Introduce new case H_SET_MODE_RESOURCE_SET_DAWR1 for 2nd DAWR. Also, kvm will support 2nd DAWR only if CPU_FTR_DAWR1 is set. Signed-off-by: Ravi

[PATCH 0/7] powerpc/watchpoint: 2nd DAWR kvm enablement + selftests

2020-07-23 Thread Ravi Bangoria
://lore.kernel.org/linuxppc-dev/20200723093330.306341-1-ravi.bango...@linux.ibm.com Patches in this series applies fine on top of powerpc/next (9a77c4a0a125) plus above dependency patches. Ravi Bangoria (7): powerpc/watchpoint/kvm: Rename current DAWR macros and variables powerpc/watchpoint/kvm: Add

[PATCH 4/7] powerpc/selftests/ptrace-hwbreak: Add testcases for 2nd DAWR

2020-07-23 Thread Ravi Bangoria
, len: 6: Ok PPC_PTRACE_SETHWDEBUG 2, MODE_RANGE, DAWR Overlap, RO, len: 6: Ok Signed-off-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/ptrace-hwbreak.c | 79 +++ 1 file changed, 79 insertions(+) diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c b/tools

[PATCH 7/7] powerpc/selftests: Add selftest to test concurrent perf/ptrace events

2020-07-23 Thread Ravi Bangoria
erlapping): Ok ptrace thread event -> perf other thread & cpu event: Ok success: ptrace-perf-hwbreak Signed-off-by: Ravi Bangoria --- .../selftests/powerpc/ptrace/.gitignore | 1 + .../testing/selftests/powerpc/ptrace/Makefile | 2 +- .../powerpc/ptrace/ptrace-perf-hwbreak.

Re: [PATCH 0/7] powerpc/watchpoint: 2nd DAWR kvm enablement + selftests

2020-07-23 Thread Ravi Bangoria
On 7/23/20 3:50 PM, Ravi Bangoria wrote: Patch #1, #2 and #3 enables p10 2nd DAWR feature for Book3S kvm guest. DAWR is a hypervisor resource and thus H_SET_MODE hcall is used to set/unset it. A new case H_SET_MODE_RESOURCE_SET_DAWR1 is introduced in H_SET_MODE hcall for setting/unsetting 2nd

Re: [PATCH v2] perf ioctl: Add check for the sample_period value

2019-06-17 Thread Ravi Bangoria
Peter / mpe, Is the v2 looks good? If so, can anyone of you please pick this up. On 6/4/19 9:59 AM, Ravi Bangoria wrote: > perf_event_open() limits the sample_period to 63 bits. See > commit 0819b2e30ccb ("perf: Limit perf_event_attr::sample_period > to 63 bits"). Make

[PATCH 2/5] Powerpc/hw-breakpoint: Refactor hw_breakpoint_arch_parse()

2019-06-17 Thread Ravi Bangoria
Move feature availability check at the start of the function. Rearrange comment to it's associated code. Use hw->address and hw->len in the 512 bytes boundary check(to write if statement in a single line). Add spacing between code blocks. Signed-off-by: Ravi Bangoria --- arch/powerpc/

[PATCH 0/5] Powerpc/hw-breakpoint: Fixes plus Code refactor

2019-06-17 Thread Ravi Bangoria
patch 1-3: Code refactor patch 4: Speedup disabling breakpoint patch 5: Fix length calculation for unaligned targets Ravi Bangoria (5): Powerpc/hw-breakpoint: Replace stale do_dabr() with do_break() Powerpc/hw-breakpoint: Refactor hw_breakpoint_arch_parse() Powerpc/hw-breakpoint: Refactor

[PATCH 4/5] Powerpc/hw-breakpoint: Optimize disable path

2019-06-17 Thread Ravi Bangoria
Directly setting dawr and dawrx with 0 should be enough to disable watchpoint. No need to reset individual bits in variable and then set in hw. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hw_breakpoint.h | 3 ++- arch/powerpc/kernel/process.c| 12 2 files

<    3   4   5   6   7   8   9   10   11   12   >