Re: [RFC PATCH v2 4/7] powerpc/ppc-opcode: consolidate powerpc instructions from bpf_jit.h

2020-04-28 Thread Naveen N. Rao
Balamuruhan S wrote: move macro definitions of powerpc instructions from bpf_jit.h to ppc-opcode.h and adopt the users of the macros accordingly. `PPC_MR()` is defined twice in bpf_jit.h, remove the duplicate one. Signed-off-by: Balamuruhan S --- arch/powerpc/include/asm/ppc-opcode.h | 139 +++

Re: [RFC PATCH v2 7/7] powerpc/selftest: reuse ppc-opcode macros to avoid redundancy

2020-04-29 Thread Naveen N. Rao
Michael Ellerman wrote: Balamuruhan S writes: Avoid redefining macros to encode ppc instructions instead reuse it from ppc-opcode.h, Makefile changes are necessary to compile memcmp_64.S with __ASSEMBLY__ defined from selftests. Signed-off-by: Balamuruhan S --- .../selftests/powerpc/stringlo

Re: [RFC PATCH v2 7/7] powerpc/selftest: reuse ppc-opcode macros to avoid redundancy

2020-04-30 Thread Naveen N. Rao
Michael Ellerman wrote: "Naveen N. Rao" writes: Michael Ellerman wrote: Balamuruhan S writes: Avoid redefining macros to encode ppc instructions instead reuse it from ppc-opcode.h, Makefile changes are necessary to compile memcmp_64.S with __ASSEMBLY__ defined from selftests. Sig

Re: [PATCH] powerpc/64s: Make unrecoverable SLB miss less confusing

2018-08-08 Thread Naveen N. Rao
Michael Ellerman wrote: Nicholas Piggin writes: On Thu, 26 Jul 2018 23:01:51 +1000 Michael Ellerman wrote: If we take an SLB miss while MSR[RI]=0 we can't recover and have to oops. Currently this is reported by faking up a 0x4100 exception, eg: Unrecoverable exception 4100 at 0 Oops: Un

Re: [PATCH] powerpc64/ftrace: Include ftrace.h needed for enable/disable calls

2018-08-17 Thread Naveen N. Rao
b/arch/powerpc/kvm/book3s_hv.c @@ -46,6 +46,7 @@ #include #include +#include #include #include #include In any case, this change itself looks alright to me. So: Acked-by: Naveen N. Rao Thanks, Naveen

Re: [PATCH] powerpc64/ftrace: Include ftrace.h needed for enable/disable calls

2018-08-17 Thread Naveen N. Rao
Luke Dashjr wrote: On Friday 17 August 2018 10:25:40 Naveen N. Rao wrote: Luke Dashjr wrote: > this_cpu_disable_ftrace and this_cpu_enable_ftrace are inlines in > ftrace.h Without it included, the build fails. I'm unable to reproduce this. Can you share your .config and the build

[RFC PATCH 0/4] Add a tracepoint for DTL entries

2018-09-19 Thread Naveen N. Rao
. This is working fine for me, so posting this out to get some early feedback. The one aspect I need to look into is in terms of updating the pcpu associativity masks on appropriate events. - Naveen Naveen N. Rao (4): powerpc/pseries: Use macros for referring to the DTL enable mask powerpc/p

[RFC PATCH 1/4] powerpc/pseries: Use macros for referring to the DTL enable mask

2018-09-19 Thread Naveen N. Rao
Introduce macros to encode the DTL enable mask fields and use those instead of hardcoding numbers. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/lppaca.h | 11 +++ arch/powerpc/platforms/pseries/dtl.c | 8 +--- arch/powerpc/platforms/pseries/lpar.c | 2 +- arch

[RFC PATCH 2/4] powerpc/pseries: Do not save the previous DTL mask value

2018-09-19 Thread Naveen N. Rao
x27;t need to save and restore the earlier mask value if CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not enabled. So, remove the field from the structure as well. Signed-off-by: Naveen N. Rao --- arch/powerpc/platforms/pseries/dtl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a

[RFC PATCH 4/4] powerpc/pseries: Introduce dtl_entry tracepoint

2018-09-19 Thread Naveen N. Rao
d 'distance' encodes this information. If distance is 0, then the vcpu was dispatched on its home node. If not, increasing values of 'distance' indicate a dispatch on a different core in the same chip, different chip in a DCM, different socket or a different drawer. Signed-

[RFC PATCH 3/4] powerpc/pseries: Introduce helpers to change the DTL enable mask

2018-09-19 Thread Naveen N. Rao
cpu, or globally for all cpus. Setting the DTL enable mask globally prevents changes to cpu-specific DTL enable mask, and vice versa. We also introduce 'dtl_mask' so that when the DTL enable mask is changed globally, new cpus also honor that. Signed-off-by: Naveen N. Rao --- arch/power

[PATCH 0/2] A few fixes to DTL buffer access over debugfs

2018-09-27 Thread Naveen N. Rao
Two trivial fixes to DTL buffer access over debugfs when CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set. - Naveen Naveen N. Rao (2): powerpc/pseries: Fix DTL buffer registration powerpc/pseries: Fix how we iterate over the DTL entries arch/powerpc/platforms/pseries/dtl.c | 4 ++-- 1 file

[PATCH 1/2] powerpc/pseries: Fix DTL buffer registration

2018-09-27 Thread Naveen N. Rao
we are not doing the conversion resulting in the below error showing up in dmesg: dtl_start: DTL registration for cpu 0 (hw 0) failed with -4 Fix this in the obvious manner. Fixes: 7c105b63bd98 ("powerpc: Add CONFIG_CPU_LITTLE_ENDIAN kernel config option.") Signed-off-by: Nav

[PATCH 2/2] powerpc/pseries: Fix how we iterate over the DTL entries

2018-09-27 Thread Naveen N. Rao
this, we do not iterate over the existing entries in the DTL buffer properly. Fixes: 7c105b63bd98 ("powerpc: Add CONFIG_CPU_LITTLE_ENDIAN kernel config option.") Signed-off-by: Naveen N. Rao --- arch/powerpc/platforms/pseries/dtl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

Re: [PATCH] powerpc/pseries: Export maximum memory value

2018-10-10 Thread Naveen N. Rao
Nathan Fontenot wrote: On 10/10/2018 05:22 AM, Aravinda Prasad wrote: This patch exports the maximum possible amount of memory configured on the system via /proc/powerpc/lparcfg. Signed-off-by: Aravinda Prasad --- arch/powerpc/platforms/pseries/lparcfg.c | 13 + 1 file changed,

[PATCH RFC] powerpc/ftrace: Handle large kernel configs

2018-10-15 Thread Naveen N. Rao
reachable. Signed-off-by: Naveen N. Rao --- The one aspect I am not entirely sure about is if the plt_branch is fine for -mprofile-kernel as it depends on r2 being properly setup. If it isn't, we will have to setup separate trampolines just for -mprofile-kernel. - Naveen arch/powerpc

[PATCH] powerpc/ftrace: Handle large kernel configs

2018-10-16 Thread Naveen N. Rao
ftrace_regs_caller, which is slightly inefficient. This can be optimized further at a later point. Signed-off-by: Naveen N. Rao --- Since RFC: - Change to patch long_branch to go to ftrace_caller, rather than patching mcount() - Stop using plt_branch since it can't be relied on for ABIv2 - Add t

[PATCH] selftests/powerpc: Relax L1d miss targets for rfi_flush test

2018-10-23 Thread Naveen N. Rao
ff-by: Naveen N. Rao --- .../selftests/powerpc/security/rfi_flush.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/powerpc/security/rfi_flush.c b/tools/testing/selftests/powerpc/security/rfi_flush.c index 564ed45bbf73..0a7d0af

[PATCH v1 0/5] Add dtl_entry tracepoint

2018-10-25 Thread Naveen N. Rao
debugfs interface is in use. - Naveen Naveen N. Rao (5): powerpc/pseries: Use macros for referring to the DTL enable mask powerpc/pseries: Do not save the previous DTL mask value powerpc/pseries: Fix stolen time accounting when dtl debugfs is used powerpc/pseries: Factor out DTL buffer

[PATCH v1 1/5] powerpc/pseries: Use macros for referring to the DTL enable mask

2018-10-25 Thread Naveen N. Rao
Introduce macros to encode the DTL enable mask fields and use those instead of hardcoding numbers. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/lppaca.h | 11 +++ arch/powerpc/platforms/pseries/dtl.c | 8 +--- arch/powerpc/platforms/pseries/lpar.c | 2 +- arch

[PATCH v1 2/5] powerpc/pseries: Do not save the previous DTL mask value

2018-10-25 Thread Naveen N. Rao
x27;t need to save and restore the earlier mask value if CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not enabled. So, remove the field from the structure as well. Signed-off-by: Naveen N. Rao --- arch/powerpc/platforms/pseries/dtl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a

[PATCH v1 3/5] powerpc/pseries: Fix stolen time accounting when dtl debugfs is used

2018-10-25 Thread Naveen N. Rao
ned-off-by: Naveen N. Rao --- arch/powerpc/kernel/time.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 40868f3ee113..923abc3e555d 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -19

[PATCH v1 4/5] powerpc/pseries: Factor out DTL buffer allocation and registration routines

2018-10-25 Thread Naveen N. Rao
Introduce new helpers for DTL buffer allocation and registration and have the existing code use those. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/plpar_wrappers.h | 2 + arch/powerpc/platforms/pseries/lpar.c | 66 --- arch/powerpc/platforms/pseries

[PATCH v1 5/5] powerpc/pseries: Introduce dtl_entry tracepoint

2018-10-25 Thread Naveen N. Rao
ensure that the new dtl_entry tracepoint usage does not interfere with the dtl debugfs interface, we introduce helpers to ensure only one of the two interfaces are used at any point in time. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/plpar_wrappers.h | 7 + arch/powerpc/include/asm/trace

Re: [PATCH v1 3/5] powerpc/pseries: Fix stolen time accounting when dtl debugfs is used

2018-10-26 Thread Naveen N. Rao
Paul Mackerras wrote: On Fri, Oct 26, 2018 at 01:55:44AM +0530, Naveen N. Rao wrote: When the dtl debugfs interface is used, we usually set the dtl_enable_mask to 0x7 (DTL_LOG_ALL). When this happens, we start seeing DTL entries for all preempt reasons, including CEDE. In scan_dispatch_log

Re: [PATCH] selftests: powerpc: Fix warning for security subdir

2018-10-31 Thread Naveen N. Rao
n lib.mk thinks it is. Set top_srcdir to set things straight. Note that the test program is still built. Signed-off-by: Joel Stanley Thanks. Tested-by: Naveen N. Rao

[PATCH] selftests/powerpc: Fix compilation issue due to asm label

2018-10-31 Thread Naveen N. Rao
ok for the offending instruction in the signal handler. Reported-by: Breno Leitao Signed-off-by: Naveen N. Rao --- tools/testing/selftests/powerpc/utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/powerpc/utils.c b/tools/testing/selftests/p

Re: [PATCH] selftests/powerpc: Fix compilation issue due to asm label

2018-10-31 Thread Naveen N. Rao
Naveen N. Rao wrote: We are using 'dscr_insn' as a label in inline asm to identify if a SIGILL was generated by the mtspr instruction at that point. However, with inline assembly, the compiler is still free to duplicate the asm statement for optimization purposes, which results in

Re: [PATCH] KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE

2018-11-07 Thread Naveen N. Rao
ions(+), 8 deletions(-) Thanks for getting to this. Apart from a small nit below, for this patch: Reviewed-by: Naveen N. Rao diff --git a/arch/powerpc/kvm/trace.h b/arch/powerpc/kvm/trace.h index 491b0f715d6b..ea1d7c808319 100644 --- a/arch/powerpc/kvm/trace.h +++ b/arch/powerpc/kvm/trace.h @@ -

Re: [PATCH -next] powerpc64/ftrace: Drop pointless static qualifier in is_b_op()

2018-11-13 Thread Naveen N. Rao
static int offset; + int offset; That seems to go all the way back to the original commit by Steven. Good catch. Reviewed-by: Naveen N. Rao - Naveen

[PATCH v1 0/2] Interface to expose VPHN information

2018-12-10 Thread Naveen N. Rao
. - Naveen Naveen N. Rao (2): powerpc/pseries: Generalize hcall_vphn() powerpc/pseries: Add debugfs interface to retrieve VPHN info arch/powerpc/mm/numa.c | 132 - 1 file changed, 118 insertions(+), 14 deletions(-) -- 2.19.2

[PATCH v1 1/2] powerpc/pseries: Generalize hcall_vphn()

2018-12-10 Thread Naveen N. Rao
: Naveen N. Rao --- arch/powerpc/mm/numa.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 87f0dd004295..6677a578f18d 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -1078,6

[PATCH v1 2/2] powerpc/pseries: Add debugfs interface to retrieve VPHN info

2018-12-10 Thread Naveen N. Rao
Add debugfs interface to retrieve associativity information for lpar vcpus (debugfs/vphn/lpar) and the hypervisor cpus (debugfs/vphn/hyp). This information is useful to derive various metrics, including the vcpu dispatch statistics in a SPLPAR environment. Signed-off-by: Naveen N. Rao --- arch

Re: [PATCH v1 2/2] powerpc/pseries: Add debugfs interface to retrieve VPHN info

2018-12-13 Thread Naveen N. Rao
Hi Michael, Naveen N. Rao wrote: Add debugfs interface to retrieve associativity information for lpar vcpus (debugfs/vphn/lpar) and the hypervisor cpus (debugfs/vphn/hyp). This information is useful to derive various metrics, including the vcpu dispatch statistics in a SPLPAR environment. Any

[PATCH v2 0/9] Provide vcpu dispatch statistics

2019-06-14 Thread Naveen N. Rao
cpu's home node, while 18 dispatches were outside its home node, on a neighbouring chip. - Naveen Naveen N. Rao (9): powerpc/pseries: Use macros for referring to the DTL enable mask powerpc/pseries: Do not save the previous DTL mask value powerpc/pseries: Factor out DTL buffer allo

[PATCH v2 1/9] powerpc/pseries: Use macros for referring to the DTL enable mask

2019-06-14 Thread Naveen N. Rao
Introduce macros to encode the DTL enable mask fields and use those instead of hardcoding numbers. Acked-by: Nathan Lynch Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/lppaca.h | 11 +++ arch/powerpc/platforms/pseries/dtl.c | 8 +--- arch/powerpc/platforms

[PATCH v2 2/9] powerpc/pseries: Do not save the previous DTL mask value

2019-06-14 Thread Naveen N. Rao
x27;t need to save and restore the earlier mask value if CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not enabled. So, remove the field from the structure as well. Acked-by: Nathan Lynch Signed-off-by: Naveen N. Rao --- arch/powerpc/platforms/pseries/dtl.c | 4 +--- 1 file changed, 1 insertion(+), 3 dele

[PATCH v2 4/9] powerpc/pseries: Introduce helpers to gatekeep DTLB usage

2019-06-14 Thread Naveen N. Rao
/accessing DTLB for all online cpus. These helpers allow any number of per-cpu users, or a single global user exclusively. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/plpar_wrappers.h | 2 ++ arch/powerpc/platforms/pseries/dtl.c | 10 +- arch/powerpc/platforms/pseries

[PATCH v2 3/9] powerpc/pseries: Factor out DTL buffer allocation and registration routines

2019-06-14 Thread Naveen N. Rao
Introduce new helpers for DTL buffer allocation and registration and have the existing code use those. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/plpar_wrappers.h | 2 + arch/powerpc/platforms/pseries/lpar.c | 66 --- arch/powerpc/platforms/pseries

[PATCH v2 5/9] powerpc/pseries: Generalize hcall_vphn()

2019-06-14 Thread Naveen N. Rao
: Naveen N. Rao --- arch/powerpc/mm/book3s64/vphn.h | 8 arch/powerpc/mm/numa.c | 27 +-- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/mm/book3s64/vphn.h b/arch/powerpc/mm/book3s64/vphn.h index f0b93c2dd578..f7ff1e0c3801

[PATCH v2 6/9] powerpc/pseries: Move mm/book3s64/vphn.c under platforms/pseries/

2019-06-14 Thread Naveen N. Rao
hcall_vphn() is specific to pseries and will be used in a subsequent patch. So, move it to a more appropriate place under arch/powerpc/platforms/pseries. Also merge vphn.h into plpar_wrappers.h Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/plpar_wrappers.h | 19

[PATCH v2 7/9] powerpc/pseries: Provide vcpu dispatch statistics

2019-06-14 Thread Naveen N. Rao
/vcpudispatch_stats_freq. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/topology.h | 6 + arch/powerpc/mm/numa.c| 16 + arch/powerpc/platforms/pseries/lpar.c | 536 +- 3 files changed, 556 insertions(+), 2 deletions(-) diff --git a/arc

[PATCH v2 9/9] powerpc/pseries: Add documentation for vcpudispatch_stats

2019-06-14 Thread Naveen N. Rao
Add a document describing the fields provided by /proc/powerpc/vcpudispatch_stats. Signed-off-by: Naveen N. Rao --- Documentation/powerpc/vcpudispatch_stats.txt | 68 1 file changed, 68 insertions(+) create mode 100644 Documentation/powerpc/vcpudispatch_stats.txt diff

[PATCH v2 8/9] powerpc/pseries: Protect against hogging the cpu while setting up the stats

2019-06-14 Thread Naveen N. Rao
d-off-by: Naveen N. Rao --- arch/powerpc/include/asm/plpar_wrappers.h | 2 +- arch/powerpc/platforms/pseries/lpar.c | 29 --- arch/powerpc/platforms/pseries/setup.c| 2 +- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/includ

[PATCH 0/7] powerpc/ftrace: Patch out -mprofile-kernel instructions

2019-06-18 Thread Naveen N. Rao
in two instructions being emitted: 'mflr r0' and 'bl _mcount'. So far, we were only nop'ing out the branch to _mcount(). This series implements an approach to also nop out the preceding mflr. - Naveen Naveen N. Rao (7): ftrace: Expose flags used for ftrace_replace

[PATCH 1/7] ftrace: Expose flags used for ftrace_replace_code()

2019-06-18 Thread Naveen N. Rao
Since ftrace_replace_code() is a __weak function and can be overridden, we need to expose the flags that can be set. So, move the flags enum to the header file. Reviewed-by: Steven Rostedt (VMware) Signed-off-by: Naveen N. Rao --- include/linux/ftrace.h | 5 + kernel/trace/ftrace.c | 5

[PATCH 2/7] x86/ftrace: Fix use of flags in ftrace_replace_code()

2019-06-18 Thread Naveen N. Rao
: a0572f687fb3c ("ftrace: Allow ftrace_replace_code() to be schedulable") Signed-off-by: Naveen N. Rao --- arch/x86/kernel/ftrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 0927bb158ffc..f34005a17051 100

[PATCH 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-18 Thread Naveen N. Rao
to _mcount(). We override ftrace_replace_code() with a powerpc64 variant for this purpose. Suggested-by: Nicholas Piggin Reviewed-by: Nicholas Piggin Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/trace/ftrace.c | 241 ++--- 1 file changed, 219 insertions(+), 22 deletions(-)

[PATCH 7/7] powerpc/kprobes: Allow probing on any ftrace address

2019-06-18 Thread Naveen N. Rao
nip to the pre and post probe handlers. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes-ftrace.c | 30 1 file changed, 30 insertions(+) diff --git a/arch/powerpc/kernel/kprobes-ftrace.c b/arch/powerpc/kernel/kprobes-ftrace.c index 972cb28174b2..6a

[PATCH 6/7] kprobes/ftrace: Use ftrace_location() when [dis]arming probes

2019-06-18 Thread Naveen N. Rao
up ftrace filter IP. This won't work if the address points to any instruction apart from the one that has a branch to _mcount(). To resolve this, have [dis]arm_kprobe_ftrace() use ftrace_function() to identify the filter IP. Signed-off-by: Naveen N. Rao --- kernel/kprobes.c | 10 +- 1

[PATCH 5/7] powerpc/ftrace: Update ftrace_location() for powerpc -mprofile-kernel

2019-06-18 Thread Naveen N. Rao
implement a custom version of ftrace_cmp_recs() which looks at the instruction preceding the branch to _mcount() and marks that instruction as belonging to ftrace if it is a 'nop' or 'mflr r0'. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/trace/ftrace.c | 31 +

[PATCH 3/7] ftrace: Expose __ftrace_replace_code()

2019-06-18 Thread Naveen N. Rao
While over-riding ftrace_replace_code(), we still want to reuse the existing __ftrace_replace_code() function. Rename the function and make it available for other kernel code. Signed-off-by: Naveen N. Rao --- include/linux/ftrace.h | 1 + kernel/trace/ftrace.c | 8 2 files changed, 5

Re: [PATCH 5/7] powerpc/ftrace: Update ftrace_location() for powerpc -mprofile-kernel

2019-06-18 Thread Naveen N. Rao
Steven Rostedt wrote: On Tue, 18 Jun 2019 20:17:04 +0530 "Naveen N. Rao" wrote: @@ -1551,7 +1551,7 @@ unsigned long ftrace_location_range(unsigned long start, unsigned long end) key.flags = end;/* overload flags, as it is unsigned long */ for (pg = ftrace_pages

Re: [PATCH 5/7] powerpc/ftrace: Update ftrace_location() for powerpc -mprofile-kernel

2019-06-18 Thread Naveen N. Rao
Naveen N. Rao wrote: Steven Rostedt wrote: On Tue, 18 Jun 2019 20:17:04 +0530 "Naveen N. Rao" wrote: @@ -1551,7 +1551,7 @@ unsigned long ftrace_location_range(unsigned long start, unsigned long end) key.flags = end;/* overload flags, as it is unsigned long */

Re: [PATCH 5/7] powerpc/ftrace: Update ftrace_location() for powerpc -mprofile-kernel

2019-06-19 Thread Naveen N. Rao
Steven Rostedt wrote: On Tue, 18 Jun 2019 23:53:11 +0530 "Naveen N. Rao" wrote: Naveen N. Rao wrote: > Steven Rostedt wrote: >> On Tue, 18 Jun 2019 20:17:04 +0530 >> "Naveen N. Rao" wrote: >> >>> @@ -1551,7 +1551,7 @@ unsigned long f

Re: [PATCH 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-19 Thread Naveen N. Rao
Nicholas Piggin wrote: Michael Ellerman's on June 19, 2019 3:14 pm: Hi Naveen, Sorry I meant to reply to this earlier .. :/ No problem. Thanks for the questions. "Naveen N. Rao" writes: With -mprofile-kernel, gcc emits 'mflr r0', followed by 'bl _mcount&#

Re: [PATCH 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-19 Thread Naveen N. Rao
Nicholas Piggin wrote: Naveen N. Rao's on June 19, 2019 7:53 pm: Nicholas Piggin wrote: Michael Ellerman's on June 19, 2019 3:14 pm: I'm also not convinced the ordering between the two patches is guaranteed by the ISA, given that there's possibly no isync on the other CPU. Will they go thro

Re: [PATCH 7/7] powerpc/kprobes: Allow probing on any ftrace address

2019-06-26 Thread Naveen N. Rao
Masami Hiramatsu wrote: On Tue, 18 Jun 2019 20:17:06 +0530 "Naveen N. Rao" wrote: With KPROBES_ON_FTRACE, kprobe is allowed to be inserted on instructions that branch to _mcount (referred to as ftrace location). With -mprofile-kernel, we now include the preceding 'mflr r0&#x

[PATCH] recordmcount: Fix spurious mcount entries on powerpc

2019-06-26 Thread Naveen N. Rao
Fixes: c7d64b560ce80 ("powerpc/ftrace: Enable C Version of recordmcount") Signed-off-by: Naveen N. Rao --- scripts/recordmcount.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h index 13c5e6c8829c..47fca2c69a73 100644 --- a/script

[PATCH] powerpc/xmon: Fix disabling tracing while in xmon

2019-06-27 Thread Naveen N. Rao
he same. Fixes: ed49f7fd6438d ("powerpc/xmon: Disable tracing when entering xmon") Signed-off-by: Naveen N. Rao --- arch/powerpc/xmon/xmon.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index d0620d762a5a..4

[PATCH v2 0/7] powerpc/ftrace: Patch out -mprofile-kernel instructions

2019-06-27 Thread Naveen N. Rao
nop out the preceding mflr. - Naveen Naveen N. Rao (7): ftrace: Expose flags used for ftrace_replace_code() x86/ftrace: Fix use of flags in ftrace_replace_code() ftrace: Expose __ftrace_replace_code() powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel ftra

[PATCH v2 1/7] ftrace: Expose flags used for ftrace_replace_code()

2019-06-27 Thread Naveen N. Rao
Since ftrace_replace_code() is a __weak function and can be overridden, we need to expose the flags that can be set. So, move the flags enum to the header file. Reviewed-by: Steven Rostedt (VMware) Signed-off-by: Naveen N. Rao --- include/linux/ftrace.h | 5 + kernel/trace/ftrace.c | 5

[PATCH v2 2/7] x86/ftrace: Fix use of flags in ftrace_replace_code()

2019-06-27 Thread Naveen N. Rao
: a0572f687fb3c ("ftrace: Allow ftrace_replace_code() to be schedulable") Signed-off-by: Naveen N. Rao --- arch/x86/kernel/ftrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 0927bb158ffc..f34005a17051 100

[PATCH v2 3/7] ftrace: Expose __ftrace_replace_code()

2019-06-27 Thread Naveen N. Rao
While over-riding ftrace_replace_code(), we still want to reuse the existing __ftrace_replace_code() function. Rename the function and make it available for other kernel code. Signed-off-by: Naveen N. Rao --- include/linux/ftrace.h | 1 + kernel/trace/ftrace.c | 8 2 files changed, 5

[PATCH v2 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-27 Thread Naveen N. Rao
then patch in the branch to _mcount(). We override ftrace_replace_code() with a powerpc64 variant for this purpose. Suggested-by: Nicholas Piggin Reviewed-by: Nicholas Piggin Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/trace/ftrace.c | 258 ++--- 1 file chang

[PATCH v2 5/7] ftrace: Update ftrace_location() for powerpc -mprofile-kernel

2019-06-27 Thread Naveen N. Rao
uction is indeed the 'mflr r0'. Earlier -mprofile-kernel ABI included a 'std r0,stack' instruction between the 'mflr r0' and the 'bl _mcount'. This is harmless as the 'std r0,stack' instruction is inconsequential and is not relied upon. Suggeste

[PATCH v2 7/7] powerpc/kprobes: Allow probing on any ftrace address

2019-06-27 Thread Naveen N. Rao
nip to the pre and post probe handlers. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes-ftrace.c | 32 +++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/kprobes-ftrace.c b/arch/powerpc/kernel/kprobes-ftrace.c index 97

[PATCH v2 6/7] kprobes/ftrace: Use ftrace_location() when [dis]arming probes

2019-06-27 Thread Naveen N. Rao
up ftrace filter IP. This won't work if the address points to any instruction apart from the one that has a branch to _mcount(). To resolve this, have [dis]arm_kprobe_ftrace() use ftrace_function() to identify the filter IP. Acked-by: Masami Hiramatsu Signed-off-by: Naveen N. Rao --- k

Re: [PATCH v2 2/7] x86/ftrace: Fix use of flags in ftrace_replace_code()

2019-06-27 Thread Naveen N. Rao
Naveen N. Rao wrote: In commit a0572f687fb3c ("ftrace: Allow ftrace_replace_code() to be schedulable), the generic ftrace_replace_code() function was modified to accept a flags argument in place of a single 'enable' flag. However, the x86 version of this function was not update

Re: [PATCH v2 2/7] x86/ftrace: Fix use of flags in ftrace_replace_code()

2019-06-27 Thread Naveen N. Rao
Steven Rostedt wrote: On Thu, 27 Jun 2019 16:53:50 +0530 "Naveen N. Rao" wrote: In commit a0572f687fb3c ("ftrace: Allow ftrace_replace_code() to be schedulable), the generic ftrace_replace_code() function was modified to accept a flags argument in place of a single 'enable

Re: [PATCH v2 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-27 Thread Naveen N. Rao
Naveen N. Rao wrote: With -mprofile-kernel, gcc emits 'mflr r0', followed by 'bl _mcount' to enable function tracing and profiling. So far, with dynamic ftrace, we used to only patch out the branch to _mcount(). However, mflr is executed by the branch unit that can only exec

Re: [PATCH v2 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-06-27 Thread Naveen N. Rao
Hi Steven, Thanks for the review! Steven Rostedt wrote: On Thu, 27 Jun 2019 16:53:52 +0530 "Naveen N. Rao" wrote: With -mprofile-kernel, gcc emits 'mflr r0', followed by 'bl _mcount' to enable function tracing and profiling. So far, with dynamic ftrace, we use

Re: [PATCH v2] powerpc/pseries: Fix maximum memory value

2019-06-28 Thread Naveen N. Rao
Nathan Lynch wrote: Aravinda Prasad writes: Calculating the maximum memory based on the number of lmbs and lmb size does not account for the RMA region. Hence use memory_hotplug_max(), which already accounts for the RMA region, to fetch the maximum memory value. Thanks to Nathan Lynch for sugge

Re: [PATCH v2 4/7] powerpc/ftrace: Additionally nop out the preceding mflr with -mprofile-kernel

2019-07-01 Thread Naveen N. Rao
Steven Rostedt wrote: On Thu, 27 Jun 2019 20:58:20 +0530 "Naveen N. Rao" wrote: > But interesting, I don't see a synchronize_rcu_tasks() call > there. We felt we don't need it in this case. We patch the branch to ftrace with a nop first. Other cpus should see t

[PATCH v3 0/9] Provide vcpu dispatch statistics

2019-07-03 Thread Naveen N. Rao
tches were on a different chip compared to its last dispatch. Also, out of the total of 6839 dispatches, we see that there have been 6821 dispatches on the vcpu's home node, while 18 dispatches were outside its home node, on a neighbouring chip. - Naveen Naveen N. Rao (9): powerpc/ps

[PATCH v3 1/9] powerpc/pseries: Use macros for referring to the DTL enable mask

2019-07-03 Thread Naveen N. Rao
Introduce macros to encode the DTL enable mask fields and use those instead of hardcoding numbers. Acked-by: Nathan Lynch Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/lppaca.h | 11 +++ arch/powerpc/platforms/pseries/dtl.c | 8 +--- arch/powerpc/platforms

[PATCH v3 2/9] powerpc/pseries: Do not save the previous DTL mask value

2019-07-03 Thread Naveen N. Rao
x27;t need to save and restore the earlier mask value if CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not enabled. So, remove the field from the structure as well. Acked-by: Nathan Lynch Signed-off-by: Naveen N. Rao --- arch/powerpc/platforms/pseries/dtl.c | 4 +--- 1 file changed, 1 insertion(+), 3 dele

[PATCH v3 3/9] powerpc/pseries: Factor out DTL buffer allocation and registration routines

2019-07-03 Thread Naveen N. Rao
Introduce new helpers for DTL buffer allocation and registration and have the existing code use those. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/lppaca.h | 3 ++ arch/powerpc/platforms/pseries/lpar.c | 66 +++--- arch/powerpc/platforms/pseries/setup.c

[PATCH v3 4/9] powerpc/pseries: Introduce rwlock to gatekeep DTLB usage

2019-07-03 Thread Naveen N. Rao
lock). Suggested-by: Michael Ellerman Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/lppaca.h | 2 ++ arch/powerpc/platforms/pseries/dtl.c | 11 ++- arch/powerpc/platforms/pseries/lpar.c | 4 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/

[PATCH v3 5/9] powerpc/pseries: Generalize hcall_vphn()

2019-07-03 Thread Naveen N. Rao
: Naveen N. Rao --- arch/powerpc/mm/book3s64/vphn.h | 8 arch/powerpc/mm/numa.c | 27 +-- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/mm/book3s64/vphn.h b/arch/powerpc/mm/book3s64/vphn.h index f0b93c2dd578..f7ff1e0c3801

[PATCH v3 6/9] powerpc/pseries: Move mm/book3s64/vphn.c under platforms/pseries/

2019-07-03 Thread Naveen N. Rao
hcall_vphn() is specific to pseries and will be used in a subsequent patch. So, move it to a more appropriate place under arch/powerpc/platforms/pseries. Also merge vphn.h into lppaca.h and update vphn selftest to use the new files. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm

[PATCH v3 7/9] powerpc/pseries: Provide vcpu dispatch statistics

2019-07-03 Thread Naveen N. Rao
/vcpudispatch_stats_freq. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/topology.h | 6 + arch/powerpc/mm/numa.c| 16 + arch/powerpc/platforms/pseries/lpar.c | 525 +- 3 files changed, 545 insertions(+), 2 deletions(-) diff --git a/arc

[PATCH v3 8/9] powerpc/pseries: Protect against hogging the cpu while setting up the stats

2019-07-03 Thread Naveen N. Rao
d-off-by: Naveen N. Rao --- arch/powerpc/include/asm/lppaca.h | 2 +- arch/powerpc/platforms/pseries/lpar.c | 29 ++ arch/powerpc/platforms/pseries/setup.c | 2 +- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/include/asm/lppaca.h b

[PATCH v3 9/9] powerpc/pseries: Add documentation for vcpudispatch_stats

2019-07-03 Thread Naveen N. Rao
Add a document describing the fields provided by /proc/powerpc/vcpudispatch_stats. Signed-off-by: Naveen N. Rao --- Documentation/powerpc/vcpudispatch_stats.txt | 68 1 file changed, 68 insertions(+) create mode 100644 Documentation/powerpc/vcpudispatch_stats.txt diff

[PATCH 0/2] ftrace: two fixes with func_probes handling

2019-07-04 Thread Naveen N. Rao
Two patches addressing bugs in ftrace function probe handling. The first patch addresses a NULL pointer dereference reported by LTP tests, while the second one is a trivial patch to address a missing check for return value, found by code inspection. - Naveen Naveen N. Rao (2): ftrace: Fix

[PATCH 1/2] ftrace: Fix NULL pointer dereference in t_probe_next()

2019-07-04 Thread Naveen N. Rao
up seeing a NULL filter_hash. Fix this by just checking for a NULL filter_hash in t_probe_next(). If the filter_hash is NULL, then this probe is just being added and we can simply return from here. Signed-off-by: Naveen N. Rao --- kernel/trace/ftrace.c | 4 1 file changed, 4 insertions(+

[PATCH 2/2] ftrace: Check for successful allocation of hash

2019-07-04 Thread Naveen N. Rao
In register_ftrace_function_probe(), we are not checking the return value of alloc_and_copy_ftrace_hash(). The subsequent call to ftrace_match_records() may end up dereferencing the same. Add a check to ensure this doesn't happen. Signed-off-by: Naveen N. Rao --- kernel/trace/ftrace.

Re: [PATCH 0/2] ftrace: two fixes with func_probes handling

2019-08-08 Thread Naveen N. Rao
Naveen N. Rao wrote: Two patches addressing bugs in ftrace function probe handling. The first patch addresses a NULL pointer dereference reported by LTP tests, while the second one is a trivial patch to address a missing check for return value, found by code inspection. Steven, Can you

[RFC PATCH] bpf: handle 32-bit zext during constant blinding

2019-08-13 Thread Naveen N. Rao
pf_jit_harden=2. Fix this by emitting BPF_ZEXT during constant blinding if prog->aux->verifier_zext is set. Fixes: a4b1d3c1ddf6cb ("bpf: verifier: insert zero extension according to analysis result") Reported-by: Michael Ellerman Signed-off-by: Naveen N. Rao --- This approach (t

[PATCH] powerpc64/module elfv1: Set opd addresses after module relocation

2018-05-28 Thread Naveen N. Rao
iptor dereference") Cc: sta...@vger.kernel.org # v4.16 Signed-off-by: Naveen N. Rao --- This can easily be seen by doing: $ sudo perf probe -L module_frob_arch_sections | grep -A5 opd 20 else if (!strcmp(secstrings + sechdrs[i].sh_name, ".opd

[PATCH 0/2] error-injection: simplify code and powerpc support

2018-05-29 Thread Naveen N. Rao
The first patch simplifies code around function error-injection by limiting the need for arch-specific helpers. The second patch adds support for powerpc. - Naveen Naveen N. Rao (2): error-injection: Simplify arch specific helpers powerpc: Add support for function error injection arch

[PATCH 1/2] error-injection: Simplify arch specific helpers

2018-05-29 Thread Naveen N. Rao
() (for instruction_pointer_set()), and ARCH_FUNC_RET to support error injection. Signed-off-by: Naveen N. Rao --- arch/x86/include/asm/error-injection.h | 6 +- arch/x86/lib/Makefile | 1 - arch/x86/lib/error-inject.c| 20 include/asm-generic

[PATCH 2/2] powerpc: Add support for function error injection

2018-05-29 Thread Naveen N. Rao
Signed-off-by: Naveen N. Rao --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/error-injection.h | 9 + arch/powerpc/include/asm/ptrace.h | 5 + 3 files changed, 15 insertions(+) create mode 100644 arch/powerpc/include/asm/error-injection.h

Re: [PATCH 1/2] error-injection: Simplify arch specific helpers

2018-05-31 Thread Naveen N. Rao
Masami Hiramatsu wrote: On Tue, 29 May 2018 18:06:02 +0530 "Naveen N. Rao" wrote: We already have an arch-independent way to set the instruction pointer with instruction_pointer_set(). Using this allows us to get rid of the need for override_function_with_return() that each archit

Re: [PATCH 2/2] powerpc: Add support for function error injection

2018-05-31 Thread Naveen N. Rao
Michael Ellerman wrote: "Naveen N. Rao" writes: ... A change log is always nice even if it's short :) I tried, but really couldn't come up with anything more to write. I'll try harder for v2 :) Signed-off-by: Naveen N. Rao --- arch/powerpc/Kconfig

Re: [PATCH 2/2] powerpc: Add support for function error injection

2018-05-31 Thread Naveen N. Rao
Michael Ellerman wrote: "Naveen N. Rao" writes: Michael Ellerman wrote: "Naveen N. Rao" writes: ... A change log is always nice even if it's short :) I tried, but really couldn't come up with anything more to write. I'll try harder for v2 :)

Re: [PATCH v7 0/5] powerpc/64: memcmp() optimization

2018-06-05 Thread Naveen N. Rao
Simon Guo wrote: Hi Michael, On Tue, Jun 05, 2018 at 12:16:22PM +1000, Michael Ellerman wrote: Hi Simon, wei.guo.si...@gmail.com writes: > From: Simon Guo > > There is some room to optimize memcmp() in powerpc 64 bits version for > following 2 cases: > (1) Even src/dst addresses are not aligne

Re: [PATCH 2/2] powerpc: Add support for function error injection

2018-06-06 Thread Naveen N. Rao
Naveen N. Rao wrote: Michael Ellerman wrote: I guess if it doesn't already apply to tip you should rebase it. You've probably missed 4.18 anyway. Oh ok. I just tried and it seems to apply just fine. I'll post v2 after giving this a quick test. I didn't post a v2

[PATCH v2] powerpc: Add support for function error injection

2018-06-06 Thread Naveen N. Rao
. Signed-off-by: Naveen N. Rao --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/error-injection.h | 13 + arch/powerpc/include/asm/ptrace.h | 5 + arch/powerpc/lib/Makefile | 2 ++ arch/powerpc/lib/error-inject.c

[PATCH v3] powerpc: Add support for function error injection

2018-06-07 Thread Naveen N. Rao
. Signed-off-by: Naveen N. Rao --- The only change is to add a comment in override_function_with_return() to clarify that we don't need to worry about 32-bit userspace while emulating 'blr'. - Naveen arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/er

<    1   2   3   4   5   6   7   8   9   10   >