Re: [PATCH 1/2] perf/powerpc: Fix kprobe and kretprobe handling with kallsyms

2016-04-06 Thread Naveen N. Rao
On 2016/04/07 10:00AM, Ananth N wrote: > On Wed, Apr 06, 2016 at 06:02:57PM +0530, Naveen N. Rao wrote: > > > + if (!pev->uprobes && map->dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS) > > tev->point.offset += PPC64LE_LEP_OFFSET; > > u

Re: [PATCH 0/2] perf probe fixes for ppc64le

2016-04-07 Thread Naveen N. Rao
On 2016/04/07 06:19PM, Balbir Singh wrote: > > On 06/04/16 22:32, Naveen N. Rao wrote: > > This patchset fixes three issues found with perf probe on ppc64le: > > 1. 'perf test kallsyms' failure on ppc64le (reported by Michael > > Ellerman). This was due to the sy

Re: [PATCH 0/2] perf probe fixes for ppc64le

2016-04-09 Thread Naveen N. Rao
On 2016/04/08 04:57PM, Balbir Singh wrote: > On Thu, 2016-04-07 at 14:56 +0530, Naveen N. Rao wrote: > > On 2016/04/07 06:19PM, Balbir Singh wrote: > > >  > > >  > > > On 06/04/16 22:32, Naveen N. Rao wrote: > > > >  > > > > This

Re: [PATCH 0/2] perf probe fixes for ppc64le

2016-04-11 Thread Naveen N. Rao
On 2016/04/11 02:41PM, Michael Ellerman wrote: > On Sat, 2016-04-09 at 19:12 +0530, Naveen N. Rao wrote: > > > > I suppose this boils down to the quirkiness of ABIv2. Though, in > > reality, I don't think most users will notice. As I stated above, users > >

[PATCH v2 0/2] perf probe fixes for ppc64le

2016-04-12 Thread Naveen N. Rao
nn Cc: Arnaldo Carvalho de Melo Cc: Masami Hiramatsu Cc: Michael Ellerman Cc: Balbir Singh Cc: Ananth N Mavinakayanahalli Naveen N. Rao (2): perf tools: Fix kprobe and kretprobe handling with kallsyms on ppc64le perf tools: Fix kallsyms perf test on ppc64le tools/perf/arch/

[PATCH v2 2/2] perf tools: Fix kallsyms perf test on ppc64le

2016-04-12 Thread Naveen N. Rao
h-specific member of perf symbol structure, and later use this to adjust the probe trace point. Cc: Mark Wielaard Cc: Thiago Jung Bauermann Cc: Arnaldo Carvalho de Melo Cc: Masami Hiramatsu Cc: Balbir Singh Acked-by: Ananth N Mavinakayanahalli Reported-by: Michael Ellerman Signed-off-by: Nav

[PATCH v2 1/2] perf tools: Fix kprobe and kretprobe handling with kallsyms on ppc64le

2016-04-12 Thread Naveen N. Rao
: Michael Ellerman Cc: Balbir Singh Reported-by: Ananth N Mavinakayanahalli Signed-off-by: Naveen N. Rao --- v2: Removed un-necessary check for uprobes tools/perf/arch/powerpc/util/sym-handling.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/perf/arch

Re: [PATCH V11 1/4] perf/powerpc: assign an id to each powerpc register

2016-04-21 Thread Naveen N. Rao
On 2016/02/20 10:32AM, Anju T wrote: > The enum definition assigns an 'id' to each register in "struct pt_regs" > of arch/powerpc. The order of these values in the enum definition are > based on the corresponding macros in arch/powerpc/include/uapi/asm/ptrace.h. > > Signed-off-by: Anju T > --- >

Re: [PATCH V11 2/4] perf/powerpc: add support for sampling intr machine state

2016-04-21 Thread Naveen N. Rao
On 2016/02/20 10:32AM, Anju T wrote: > The perf infrastructure uses a bit mask to find out valid > registers to display. Define a register mask for supported > registers defined in asm/perf_regs.h. The bit positions also > correspond to register IDs which is used by perf infrastructure > to fetch t

Re: [PATCH v2 0/2] perf probe fixes for ppc64le

2016-04-27 Thread Naveen N. Rao
On 2016/04/12 02:40PM, Naveen N Rao wrote: > This patchset fixes three issues found with perf probe on ppc64le: > 1. 'perf test kallsyms' failure on ppc64le (reported by Michael > Ellerman). This was due to the symbols being fixed up during symbol > table load. This is fixed

Re: [PATCH] powerpc: Define and use PPC_ELF_ABI_v2

2016-04-28 Thread Naveen N. Rao
call this PPC64_ELF_ABI_V2 since this is 64-bit only, and include check for CONFIG_PPC64 as well? Apart from that: Acked-by: Naveen N. Rao - Naveen ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 0/3] Add support for perf user stack dump in powerpc

2016-04-28 Thread Naveen N. Rao
On 2016/04/28 03:01PM, Chandan Kumar wrote: > This patch set enables perf user stack dump on powerpc For this patch-set: Reviewed-by: Naveen N. Rao I suppose that implies my testing, but nonetheless: Tested-by: Naveen N. Rao > > Example with "ls" command as user prog

Re: [PATCH 0/3] Add support for perf user stack dump in powerpc

2016-04-28 Thread Naveen N. Rao
On 2016/04/28 12:29PM, Arnaldo Carvalho de Melo wrote: > Em Thu, Apr 28, 2016 at 07:53:41PM +0530, Naveen N. Rao escreveu: > > On 2016/04/28 03:01PM, Chandan Kumar wrote: > > > This patch set enables perf user stack dump on powerpc > > > > For this patch-set:

Re: [PATCH] perf record: Limit --intr-regs to platforms supporting PERF_REGS

2015-09-28 Thread Naveen N. Rao
On 2015/09/24 10:15PM, Naveen N Rao wrote: > On 2015/09/24 08:32AM, Stephane Eranian wrote: > > On Thu, Sep 24, 2015 at 5:57 AM, Jiri Olsa wrote: > > > > > > On Thu, Sep 24, 2015 at 05:41:58PM +0530, Naveen N. Rao wrote: > > > > perf build currently f

Re: [PATCH] perf record: Limit --intr-regs to platforms supporting PERF_REGS

2015-09-29 Thread Naveen N. Rao
On 2015/09/29 08:53AM, Jiri Olsa wrote: > On Tue, Sep 29, 2015 at 11:06:17AM +0530, Naveen N. Rao wrote: > > On 2015/09/24 10:15PM, Naveen N Rao wrote: > > > On 2015/09/24 08:32AM, Stephane Eranian wrote: > > > > On Thu, Sep 24, 2015 at 5:57 AM, Jiri Olsa wrote: >

Re: [PATCH] perf record: Limit --intr-regs to platforms supporting PERF_REGS

2015-09-29 Thread Naveen N. Rao
On 2015/09/29 12:47PM, Jiri Olsa wrote: > On Tue, Sep 29, 2015 at 01:30:10PM +0530, Naveen N. Rao wrote: > > SNIP > > > > > Suka has also posted a fix for this with a different approach [1]. Can > > > > you please ack/pull one of these versions? Building pe

[PATCH] perf: bpf: Fix build breakage due to libbpf

2015-12-14 Thread Naveen N. Rao
. While at it, remove redundant LP64 macro definition. Signed-off-by: Naveen N. Rao --- tools/lib/bpf/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index 636e3dd..050e0e8 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib

Re: [PATCH] perf: bpf: Fix build breakage due to libbpf

2015-12-14 Thread Naveen N. Rao
On 2015/12/14 07:53PM, Wang Nan wrote: > Hi Naveen, > > On 2015/12/14 18:50, Naveen N. Rao wrote: > >perf build is currently (v4.4-rc5) broken on powerpc: > > > >bpf.c:28:4: error: #error __NR_bpf not defined. libbpf does not support > >your arch. > > #

Re: [PATCH v2] tools lib bpf: Support libbpf on PowerPC

2015-12-14 Thread Naveen N. Rao
On 2015/12/14 11:57AM, Wang Nan wrote: > Support basic PowerPC compiling. > > Checks BPF syscall number, turn off libbpf building on platform doesn't > support sys_bpf instead of blocking compiling. > > Reported-by: Naveen N. Rao > Signed-off-by: Wang Nan > Cc: A

Re: [PATCH v3 0/3] perf build: PowerPC: Fix build breakage due to libbpf

2015-12-15 Thread Naveen N. Rao
> them into 3 patches. Please help me test it on PowerPC. Hi Wang, Thanks for putting this together. Entire series: Tested-by: Naveen N. Rao > > Cc: Arnaldo Carvalho de Melo > Cc: Jiri Olsa > Cc: Naveen N. Rao > Cc: Sukadev Bhattiprolu > > Naveen N. Rao (1)

Re: [PATCH v4] perf: bpf: Fix build breakage due to libbpf

2015-12-15 Thread Naveen N. Rao
On 2015/12/15 08:51AM, Wang Nan wrote: > From: "Naveen N. Rao" > > perf build is currently (v4.4-rc5) broken on powerpc: > > bpf.c:28:4: error: #error __NR_bpf not defined. libbpf does not support > your arch. > # error __NR_bpf not defined. libbpf does not supp

Re: [PATCH v4] perf: bpf: Fix build breakage due to libbpf

2015-12-16 Thread Naveen N. Rao
On 2015/12/17 09:29AM, Wang Nan wrote: > > > On 2015/12/17 3:42, Arnaldo Carvalho de Melo wrote: > >Em Tue, Dec 15, 2015 at 05:10:46PM +0530, Naveen N. Rao escreveu: > >>On 2015/12/15 08:51AM, Wang Nan wrote: > >>>From: "Naveen N. Rao" > >

Re: [RESEND PATCH v4 2/3] tools: Move Makefile.arch from perf/config to tools/scripts

2015-12-16 Thread Naveen N. Rao
Signed-off-by: Wang Nan > Acked-by: Jiri Olsa > Tested-by: Naveen N. Rao > Cc: Arnaldo Carvalho de Melo > Cc: Naveen N. Rao > Cc: Sukadev Bhattiprolu > --- > tools/perf/config/Makefile | 2 +- > tools/perf/config/Makefile.arch | 18 -- > tools/

Re: [PATCH v4] perf: bpf: Fix build breakage due to libbpf

2016-01-06 Thread Naveen N. Rao
On 2015/12/17 09:19AM, Arnaldo Carvalho de Melo wrote: > Em Thu, Dec 17, 2015 at 10:37:14AM +0530, Naveen N. Rao escreveu: > > On 2015/12/17 09:29AM, Wang Nan wrote: > > > The whole thread is: > > > > > > [PATCH v3 0/3] perf build: PowerPC: Fix buil

Re: [PATCH v4] perf: bpf: Fix build breakage due to libbpf

2016-01-07 Thread Naveen N. Rao
On 2016/01/07 05:39PM, Arnaldo Carvalho de Melo wrote: > Em Thu, Jan 07, 2016 at 12:28:15PM +0530, Naveen N. Rao escreveu: > > On 2015/12/17 09:19AM, Arnaldo Carvalho de Melo wrote: > > > Em Thu, Dec 17, 2015 at 10:37:14AM +0530, Naveen N. Rao escreveu: > > > > O

Re: [PATCH v4 1/9] selftests/powerpc: Test the preservation of FPU and VMX regs across syscall

2016-02-15 Thread Naveen N. Rao
On 2016/02/15 04:07PM, Cyril Bur wrote: > Test that the non volatile floating point and Altivec registers get > correctly preserved across the fork() syscall. > > fork() works nicely for this purpose, the registers should be the same for > both parent and child > > Signed-off-by: Cyril Bur > ---

Re: [PATCH v4 1/9] selftests/powerpc: Test the preservation of FPU and VMX regs across syscall

2016-02-15 Thread Naveen N. Rao
On 2016/02/16 11:06AM, Cyril Bur wrote: > On Mon, 15 Feb 2016 22:29:17 +0530 > "Naveen N. Rao" wrote: > > > On 2016/02/15 04:07PM, Cyril Bur wrote: > > > Test that the non volatile floating point and Altivec registers get > > > correctly preserved a

Re: bpf jit PPC64 (BE) test_verifier PTR_TO_STACK store/load failure

2019-03-13 Thread Naveen N. Rao
Hi, Yauheni Kaliuta wrote: Hi! I found a failure: ``` # ./test_verifier 722 #722/u PTR_TO_STACK store/load FAIL retval -1 != -87117812 0: (bf) r1 = r10 1: (07) r1 += -10 2: (7a) *(u64 *)(r1 +2) = -87117812 3: (79) r0 = *(u64 *)(r1 +2) 4: (95) exit processed 5 insns (limit 131072), stack dept

Re: bpf jit PPC64 (BE) test_verifier PTR_TO_STACK store/load failure

2019-03-15 Thread Naveen N. Rao
Segher Boessenkool wrote: Hi! On Wed, Mar 13, 2019 at 12:54:16PM +0200, Yauheni Kaliuta wrote: This is because of the handling of the +2 offset. The low two bits of instructions with primary opcodes 58 and 62 are part of the opcode, not the offset. These instructions can not have offsets wit

[PATCH] powerpc: bpf: Fix generation of load/store DW instructions

2019-03-15 Thread Naveen N. Rao
s of PPC_LD() and PPC_STD() to use these macros. All existing uses of these macros have been audited to ensure that TMP_REG_2 can be clobbered. Fixes: 156d0e290e96 ("powerpc/ebpf/jit: Implement JIT compiler for extended BPF") Cc: sta...@vger.kernel.org # v4.9+ Reported-by: Yauheni Ka

Re: [RFC PATCH] powerpc/64/ftrace: mprofile-kernel patch out mflr

2019-04-15 Thread Naveen N. Rao
Hi Nick, Nicholas Piggin wrote: The new mprofile-kernel mcount sequence is mflr r0 bl_mcount Dynamic ftrace patches the branch instruction with a noop, but leaves the mflr. mflr is executed by the branch unit that can only execute one per cycle on POWER9 and shared with branches, so i

eh_frame confusion

2020-03-02 Thread Naveen N. Rao
Rasmus Villemoes wrote: I'm building a ppc32 kernel, and noticed that after upgrading from gcc-7 to gcc-8 all object files now end up having .eh_frame section. For vmlinux, that's not a problem, because they all get discarded in arch/powerpc/kernel/vmlinux.lds.S . However, they stick around in mo

Re: eh_frame confusion

2020-03-02 Thread Naveen N. Rao
Segher Boessenkool wrote: On Mon, Mar 02, 2020 at 11:56:05AM +0100, Rasmus Villemoes wrote: I'm building a ppc32 kernel, and noticed that after upgrading from gcc-7 to gcc-8 all object files now end up having .eh_frame section. Since GCC 8, we enable -fasynchronous-unwind-tables by default for

eh_frame confusion

2020-03-02 Thread Naveen N. Rao
Naveen N. Rao wrote: Rasmus Villemoes wrote: I'm building a ppc32 kernel, and noticed that after upgrading from gcc-7 to gcc-8 all object files now end up having .eh_frame section. For vmlinux, that's not a problem, because they all get discarded in arch/powerpc/kernel/vmlinux.lds.S

Re: eh_frame confusion

2020-03-05 Thread Naveen N. Rao
Michael Ellerman wrote: "Naveen N. Rao" writes: Rasmus Villemoes wrote: I'm building a ppc32 kernel, and noticed that after upgrading from gcc-7 to gcc-8 all object files now end up having .eh_frame section. For vmlinux, that's not a problem, because they all get disca

eh_frame confusion

2020-03-05 Thread Naveen N. Rao
Naveen N. Rao wrote: Naveen N. Rao wrote: Rasmus Villemoes wrote: Can you check if the below patch works? I am yet to test this in more detail, but would be good to know the implications for ppc32. - Naveen --- diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index f35730548e42

[PATCH 1/2] powerpc: Drop -fno-dwarf2-cfi-asm

2020-03-05 Thread Naveen N. Rao
t for R_PPC64_REL32 relocations"). So, drop this flag from our Makefile. Signed-off-by: Naveen N. Rao --- arch/powerpc/Makefile | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index cbe5ca4f0ee5..89956c4f1ce3 100644 --- a/arch/powerp

[PATCH 2/2] powerpc: Suppress .eh_frame generation

2020-03-05 Thread Naveen N. Rao
-fno-asynchronous-unwind-tables to KBUILD_CFLAGS to suppress generation of .eh_frame section. Note that our VDSOs need .eh_frame, but are not affected by this change since our VDSO code are all in assembly. Reported-by: Rasmus Villemoes Signed-off-by: Naveen N. Rao --- arch/powerpc/Makefile | 3

Re: [PATCH v2 4/5] powerpc/sysfs: Show idle_purr and idle_spurr for every CPU

2020-03-06 Thread Naveen N. Rao
Nathan Lynch wrote: "Naveen N. Rao" writes: Gautham R Shenoy wrote: On Fri, Feb 21, 2020 at 10:50:12AM -0600, Nathan Lynch wrote: It's regrettable that we have to wake up potentially idle CPUs in order to derive correct idle statistics for them, but I suppose the main use

Re: [PATCH v2] powerpc test_emulate_step: fix DS operand in ld encoding to appropriate value

2020-03-16 Thread Naveen N. Rao
his is for selftests, we don't need to enforce that. Long term, we should also consider generalizing the macros across this and the eBPF codebase so that we can reuse these. Reviewed-by: Naveen N. Rao - Naveen

Re: [PATCH] powerpc/64: ftrace don't trace real mode

2020-03-20 Thread Naveen N. Rao
Hi Nick, Nicholas Piggin wrote: This warns and prevents tracing attempted in a real-mode context. Is this something you're seeing often? Last time we looked at this, KVM was the biggest offender and we introduced paca->ftrace_enabled as a way to disable ftrace while in KVM code. While this

Re: [PATCH] powerpc/64: ftrace don't trace real mode

2020-03-22 Thread Naveen N. Rao
Nicholas Piggin wrote: Naveen N. Rao's on March 21, 2020 4:39 am: Hi Nick, Nicholas Piggin wrote: This warns and prevents tracing attempted in a real-mode context. Is this something you're seeing often? Last time we looked at this, KVM was the biggest offender and we introduced paca->ftrace

Re: [PATCH v3] powerpc/kprobes: Ignore traps that happened in real mode

2020-03-22 Thread Naveen N. Rao
(TRACE_IRQFLAGS, KUAP DEBUG, syscall from kernel, machine check in RTAS, ...). Without this fix, all of them trigger an Oops when CONFIG_KPROBE is set. For this patch: Reviewed-by: Naveen N. Rao - Naveen

Re: [PATCH] powerpc xmon: drop the option `i` in cacheflush

2020-03-23 Thread Naveen N. Rao
Segher Boessenkool wrote: On Mon, Mar 23, 2020 at 04:55:48PM +0530, Balamuruhan S wrote: Data Cache Block Invalidate (dcbi) instruction implemented in 32-bit designs prior to PowerPC architecture version 2.01 and got obsolete from version 2.01. It was added back in 2.03. It also exists in 64-

Re: [PATCH v2 12/12] powerpc/64s: system reset do not trace

2020-03-26 Thread Naveen N. Rao
+ 1 file changed, 5 insertions(+) For the ftrace bits: Acked-by: Naveen N. Rao diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 1845fd7e161a..ed7b7a6e2dc0 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -443,6 +443,9 @@ void

Re: [PATCH] powerpc/64: Fix section mismatch warnings.

2020-03-26 Thread Naveen N. Rao
Michal Suchanek wrote: Fixes the following warnings: WARNING: vmlinux.o(.text+0x2d24): Section mismatch in reference from the variable __boot_from_prom to the function .init.text:prom_init() The function __boot_from_prom() references the function __init prom_init(). This is often because __boot

Re: [PATCH v2] powerpc/kprobes: Blacklist functions running with MMU disabled on PPC32

2020-03-27 Thread Naveen N. Rao
Christophe Leroy wrote: kprobe does not handle events happening in real mode, all functions running with MMU disabled have to be blacklisted. As already done for PPC64, do it for PPC32. Signed-off-by: Christophe Leroy --- v2: - Don't rename nonrecoverable as local, mark it noprobe instead. - A

Re: [PATCH 06/12] powerpc/32s: Make local symbols non visible in hash_low.

2020-03-30 Thread Naveen N. Rao
Christophe Leroy wrote: In hash_low.S, a lot of named local symbols are used instead of numbers to ease code lisibility. However, they don't need to be ^^ Nit.. visibility - Naveen

Re: [PATCH 10/12] powerpc/entry32: Blacklist exception entry points for kprobe.

2020-03-30 Thread Naveen N. Rao
Christophe Leroy wrote: kprobe does not handle events happening in real mode. As exception entry points are running with MMU disabled, blacklist them. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/ker

Re: [PATCH 01/12] powerpc/52xx: Blacklist functions running with MMU disabled for kprobe

2020-03-30 Thread Naveen N. Rao
comments, for this series: Acked-by: Naveen N. Rao - Naveen

Re: [PATCH 06/12] powerpc/32s: Make local symbols non visible in hash_low.

2020-03-30 Thread Naveen N. Rao
Christophe Leroy wrote: Le 30/03/2020 à 19:06, Naveen N. Rao a écrit : Christophe Leroy wrote: In hash_low.S, a lot of named local symbols are used instead of numbers to ease code lisibility. However, they don't need to be    ^^ Nit..  visibility

Re: [PATCH 10/12] powerpc/entry32: Blacklist exception entry points for kprobe.

2020-03-30 Thread Naveen N. Rao
Christophe Leroy wrote: Le 30/03/2020 à 19:08, Naveen N. Rao a écrit : Christophe Leroy wrote: kprobe does not handle events happening in real mode. As exception entry points are running with MMU disabled, blacklist them. Signed-off-by: Christophe Leroy ---  arch/powerpc/kernel/entry_32.S

Re: [PATCH 10/12] powerpc/entry32: Blacklist exception entry points for kprobe.

2020-03-30 Thread Naveen N. Rao
Christophe Leroy wrote: Le 30/03/2020 à 20:33, Christophe Leroy a écrit : Le 30/03/2020 à 19:08, Naveen N. Rao a écrit : Christophe Leroy wrote: kprobe does not handle events happening in real mode. As exception entry points are running with MMU disabled, blacklist them. Signed-off-by

Re: [PATCH 10/12] powerpc/entry32: Blacklist exception entry points for kprobe.

2020-03-30 Thread Naveen N. Rao
Christophe Leroy wrote: Le 31/03/2020 à 08:17, Naveen N. Rao a écrit : Christophe Leroy wrote: Le 30/03/2020 à 20:33, Christophe Leroy a écrit : Le 30/03/2020 à 19:08, Naveen N. Rao a écrit : Christophe Leroy wrote: kprobe does not handle events happening in real mode. As exception

Re: [PATCH v2 10/12] powerpc/entry32: Blacklist exception entry points for kprobe.

2020-03-31 Thread Naveen N. Rao
ere kprobe will be possible as the kernel will run with MMU enabled. Signed-off-by: Christophe Leroy Acked-by: Naveen N. Rao --- v2: Moved TLF_NAPPING and TLF_SLEEPING handling --- arch/powerpc/kernel/entry_32.S | 37 -- 1 file changed, 22 insertions(+), 15

Re: [PATCH v4 2/6] powerpc/idle: Add accessor function to always read latest idle PURR

2020-04-01 Thread Naveen N. Rao
Hi Gautham, Gautham R. Shenoy wrote: From: "Gautham R. Shenoy" Currently when CPU goes idle, we take a snapshot of PURR via pseries_idle_prolog() which is used at the CPU idle exit to compute the idle PURR cycles via the function pseries_idle_epilog(). Thus, the value of idle PURR cycle thus

Re: [PATCH v4 5/6] Documentation: Document sysfs interfaces purr, spurr, idle_purr, idle_spurr

2020-04-01 Thread Naveen N. Rao
the sysfs interface standpoint, for patches 1 to 5: Acked-by: Naveen N. Rao - Naveen

Re: [PATCH v4 6/6] pseries/sysfs: Minimise IPI noise while reading [idle_][s]purr

2020-04-01 Thread Naveen N. Rao
Gautham R. Shenoy wrote: From: "Gautham R. Shenoy" Currently purr, spurr, idle_purr, idle_spurr are exposed for every CPU via the sysfs interface /sys/devices/system/cpu/cpuX/[idle_][s]purr. Each sysfs read currently generates an IPI to obtain the desired value from the target CPU X. Since thes

Re: [PATCH v3 3/3] powerpc test_emulate_step: add testcases for divde[.] and divdeu[.] instructions

2020-04-01 Thread Naveen N. Rao
I think you meant to use TEST_DIVDEU here ^ and in the test before, rather than TEST_DIVDEU_DOT. Apart from them, for this series: Acked-by: Naveen N. Rao - Naveen

Re: [RFC PATCH 3/4] powerpc ppc-opcode: move ppc instuction encoding from test_emulate_step

2020-04-01 Thread Naveen N. Rao
Balamuruhan S wrote: Few ppc instructions are encoded in test_emulate_step.c, consolidate them to ppc-opcode.h, fix redefintion errors in bpf_jit caused due to this consolidation. Reuse the macros from ppc-opcode.h Signed-off-by: Balamuruhan S --- arch/powerpc/include/asm/ppc-opcode.h | 34 +

Re: [RFC PATCH 3/4] powerpc ppc-opcode: move ppc instuction encoding from test_emulate_step

2020-04-02 Thread Naveen N. Rao
Michael Ellerman wrote: "Naveen N. Rao" writes: Balamuruhan S wrote: Few ppc instructions are encoded in test_emulate_step.c, consolidate them to ppc-opcode.h, fix redefintion errors in bpf_jit caused due to this consolidation. Reuse the macros from ppc-opcode.h ... diff --

Re: [PATCH v4 6/6] pseries/sysfs: Minimise IPI noise while reading [idle_][s]purr

2020-04-02 Thread Naveen N. Rao
Gautham R Shenoy wrote: Hello Naveen, On Wed, Apr 01, 2020 at 03:28:48PM +0530, Naveen N. Rao wrote: Gautham R. Shenoy wrote: >From: "Gautham R. Shenoy" > [..snip..] >+ >+static ssize_t show_purr(struct device *dev, >+struct device_a

Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-02 Thread Naveen N. Rao
Russell Currey wrote: With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will be one W+X page at boot by default. This can be tested with CONFIG_PPC_PTDUMP=y and CONFIG_PPC_DEBUG_WX=y set, and checking the kernel log during boot. powerpc doesn't implement its own alloc() for kprobes li

Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-02 Thread Naveen N. Rao
Naveen N. Rao wrote: Russell Currey wrote: With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will be one W+X page at boot by default. This can be tested with CONFIG_PPC_PTDUMP=y and CONFIG_PPC_DEBUG_WX=y set, and checking the kernel log during boot. powerpc doesn't implement it

Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-03 Thread Naveen N. Rao
Russell Currey wrote: On Fri, 2020-04-03 at 00:18 +0530, Naveen N. Rao wrote: Naveen N. Rao wrote: > Russell Currey wrote: > > With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will > > be one > > W+X page at boot by default. This can be tested with > &

Re: [PATCH v8 2/7] powerpc/kprobes: Mark newly allocated probes as RO

2020-04-03 Thread Naveen N. Rao
Russell Currey wrote: On Fri, 2020-04-03 at 15:06 +0530, Naveen N. Rao wrote: Russell Currey wrote: > On Fri, 2020-04-03 at 00:18 +0530, Naveen N. Rao wrote: > > Naveen N. Rao wrote: > > > Russell Currey wrote: > > > > > > > > +void *alloc_insn_pag

Re: [PATCH v4 2/6] powerpc/idle: Add accessor function to always read latest idle PURR

2020-04-03 Thread Naveen N. Rao
Gautham R Shenoy wrote: On Wed, Apr 01, 2020 at 03:12:53PM +0530, Naveen N. Rao wrote: Hi Gautham, Gautham R. Shenoy wrote: >From: "Gautham R. Shenoy" > >+ >+static inline u64 read_this_idle_purr(void) >+{ >+ /* >+* If we are reading from an idle contex

Re: [PATCH 2/3] powerpc/sysfs: Show idle_purr and idle_spurr for every CPU

2019-12-05 Thread Naveen N. Rao
Gautham R. Shenoy wrote: From: "Gautham R. Shenoy" On Pseries LPARs, to calculate utilization, we need to know the [S]PURR ticks when the CPUs were busy or idle. The total PURR and SPURR ticks are already exposed via the per-cpu sysfs files /sys/devices/system/cpu/cpuX/purr and /sys/devices/sy

Re: [PATCH 0/3] pseries: Track and expose idle PURR and SPURR ticks

2019-12-05 Thread Naveen N. Rao
Hi Nathan, Nathan Lynch wrote: Hi Kamalesh, Kamalesh Babulal writes: On 12/5/19 3:54 AM, Nathan Lynch wrote: "Gautham R. Shenoy" writes: Tools such as lparstat which are used to compute the utilization need to know [S]PURR ticks when the cpu was busy or idle. The [S]PURR counters are alre

Re: [PATCH 0/3] pseries: Track and expose idle PURR and SPURR ticks

2019-12-06 Thread Naveen N. Rao
Naveen N. Rao wrote: Hi Nathan, Nathan Lynch wrote: Hi Kamalesh, Kamalesh Babulal writes: On 12/5/19 3:54 AM, Nathan Lynch wrote: "Gautham R. Shenoy" writes: Tools such as lparstat which are used to compute the utilization need to know [S]PURR ticks when the cpu was busy or id

Re: [PATCH v5 0/5] Track and expose idle PURR and SPURR ticks

2020-04-07 Thread Naveen N. Rao
ccount for SPURR ticks on idle CPUs powerpc/sysfs: Show idle_purr and idle_spurr for every CPU Documentation: Document sysfs interfaces purr, spurr, idle_purr, idle_spurr Thanks, LGTM. For the series: Acked-by: Naveen N. Rao - Naveen

Re: [PATCH v6 4/4] powerpc/vdso: Switch VDSO to generic C implementation.

2020-04-07 Thread Naveen N. Rao
Christophe Leroy wrote: powerpc is a bit special for VDSO as well as system calls in the way that it requires setting CR SO bit which cannot be done in C. Therefore, entry/exit needs to be performed in ASM. Implementing __arch_get_vdso_data() would clobbers the link register, requiring the calle

Re: POWER9 crash due to STRICT_KERNEL_RWX (WAS: Re: Linux-next POWER9 NULL pointer NIP...)

2020-04-17 Thread Naveen N. Rao
Hi Qian, Qian Cai wrote: OK, reverted the commit, c55d7b5e6426 (“powerpc: Remove STRICT_KERNEL_RWX incompatibility with RELOCATABLE”) or set STRICT_KERNEL_RWX=n fixed the crash below and also mentioned in this thread, https://lore.kernel.org/lkml/15ac5b0e-a221-4b8c-9039-fa96b8ef7...@lca.pw/

Re: POWER9 crash due to STRICT_KERNEL_RWX (WAS: Re: Linux-next POWER9 NULL pointer NIP...)

2020-04-17 Thread Naveen N. Rao
Qian Cai wrote: On Apr 17, 2020, at 3:01 AM, Naveen N. Rao wrote: Hi Qian, Qian Cai wrote: OK, reverted the commit, c55d7b5e6426 (“powerpc: Remove STRICT_KERNEL_RWX incompatibility with RELOCATABLE”) or set STRICT_KERNEL_RWX=n fixed the crash below and also mentioned in this thread

[PATCH 0/3] powerpc/module_64: Fix _mcount() stub

2020-04-21 Thread Naveen N. Rao
where a kernel is built without ftrace. - Naveen Naveen N. Rao (3): powerpc/module_64: Consolidate ftrace code powerpc/module_64: Simplify check for -mprofile-kernel ftrace relocations powerpc/module_64: Use special stub for _mcount() with -mprofile-kernel arch/powerpc/include/asm

[PATCH 1/3] powerpc/module_64: Consolidate ftrace code

2020-04-21 Thread Naveen N. Rao
module_trampoline_target() is only used by ftrace. Move the prototype within the appropriate #ifdef in the header. Also, move the function body to the end of module_64.c so as to consolidate all ftrace code in one place. No functional changes. Signed-off-by: Naveen N. Rao --- arch/powerpc

[PATCH 2/3] powerpc/module_64: Simplify check for -mprofile-kernel ftrace relocations

2020-04-21 Thread Naveen N. Rao
all() to reflect the checking being done. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/module_64.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c index 54d9d830f4a4..7f4cc53463

[PATCH 3/3] powerpc/module_64: Use special stub for _mcount() with -mprofile-kernel

2020-04-21 Thread Naveen N. Rao
Reported-by: Qian Cai Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/module_64.c | 222 +++- 1 file changed, 104 insertions(+), 118 deletions(-) diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c index 7f4cc5346387..cc7e990e8376 10

Re: [PATCH 0/3] powerpc/module_64: Fix _mcount() stub

2020-04-22 Thread Naveen N. Rao
Naveen N. Rao wrote: This series addresses the crash reported by Qian Cai on ppc64le with -mprofile-kernel here: https://lore.kernel.org/r/15ac5b0e-a221-4b8c-9039-fa96b8ef7...@lca.pw While fixing patch_instruction() should address the crash, we should still change the default stub we setup

[PATCH] powerpc/64: Have MPROFILE_KERNEL depend on FUNCTION_TRACER

2020-04-22 Thread Naveen N. Rao
nd on FUNCTION_TRACER. Signed-off-by: Naveen N. Rao --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 924c541a9260..8324d98728db 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -476,7 +

[PATCH 0/3] powerpc: Enhance error handling with patch_instruction()

2020-04-23 Thread Naveen N. Rao
validate return value from patch_instruction() and to notify errors. - Naveen Naveen N. Rao (3): powerpc: Properly return error code from do_patch_instruction() powerpc/ftrace: Simplify error checking when patching instructions powerpc/kprobes: Check return value of patch_instruction

[PATCH 3/3] powerpc/kprobes: Check return value of patch_instruction()

2020-04-23 Thread Naveen N. Rao
robes/optprobes: Use patch_instruction()") Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 10 +++- arch/powerpc/kernel/optprobes.c | 99 ++--- 2 files changed, 87 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powe

[PATCH 2/3] powerpc/ftrace: Simplify error checking when patching instructions

2020-04-23 Thread Naveen N. Rao
, which ftrace_bug() expects for proper error handling Also eliminate use of patch_branch() since most such uses already call create_branch() for error checking before patching. Instead, use the return value from create_branch() with PATCH_INSN(). Signed-off-by: Naveen N. Rao --- arch/powerpc

[PATCH 1/3] powerpc: Properly return error code from do_patch_instruction()

2020-04-23 Thread Naveen N. Rao
by: Naveen N. Rao --- arch/powerpc/lib/code-patching.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index 3345f039a876..5c713a6c0bd8 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerp

[PATCH 0/3] powerpc: Use proper printk format specifiers

2020-04-23 Thread Naveen N. Rao
.git.naveen.n@linux.vnet.ibm.com - Naveen Balamuruhan S (1): powerpc/kprobes: Use appropriate format specifier for printing kernel address Naveen N. Rao (2): powerpc/ftrace: Use appropriate format specifier for printing kernel addresses powerpc/hw_bkpt: Update printk format specifiers

[PATCH 2/3] powerpc/ftrace: Use appropriate format specifier for printing kernel addresses

2020-04-23 Thread Naveen N. Rao
-by: Naveen N. Rao --- arch/powerpc/kernel/trace/ftrace.c | 74 +- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c index 679d5249b002..29b77204f46d 100644 --- a/arch/powerpc/kernel

[PATCH 1/3] powerpc/kprobes: Use appropriate format specifier for printing kernel address

2020-04-23 Thread Naveen N. Rao
From: Balamuruhan S Change use of %p to %pK when printing address of the instruction slot so that the actual kernel address is visible for privileged users. Signed-off-by: Balamuruhan S Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/optprobes.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 3/3] powerpc/hw_bkpt: Update printk format specifiers for kernel addresses

2020-04-23 Thread Naveen N. Rao
Change prinkt format specifier from %lx to %pK to indicate kernel pointer, and to hide the addresses from unprivileged users. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/hw_breakpoint.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel

Re: [PATCH 1/3] powerpc: Properly return error code from do_patch_instruction()

2020-04-24 Thread Naveen N. Rao
Christophe Leroy wrote: Le 23/04/2020 à 17:09, Naveen N. Rao a écrit : With STRICT_KERNEL_RWX, we are currently ignoring return value from __patch_instruction() in do_patch_instruction(), resulting in the error not being propagated back. Fix the same. Good patch. Be aware that there is

Re: [PATCH 1/3] powerpc: Properly return error code from do_patch_instruction()

2020-04-24 Thread Naveen N. Rao
Hi Steve, Steven Rostedt wrote: On Thu, 23 Apr 2020 18:21:14 +0200 Christophe Leroy wrote: Le 23/04/2020 à 17:09, Naveen N. Rao a écrit : > With STRICT_KERNEL_RWX, we are currently ignoring return value from > __patch_instruction() in do_patch_instruction(), resulting in the error

Re: [PATCH 3/3] powerpc/kprobes: Check return value of patch_instruction()

2020-04-24 Thread Naveen N. Rao
Steven Rostedt wrote: On Thu, 23 Apr 2020 17:41:52 +0200 Christophe Leroy wrote: > diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c > index 024f7aad1952..046485bb0a52 100644 > --- a/arch/powerpc/kernel/optprobes.c > +++ b/arch/powerpc/kernel/optprobes.c > @@ -13

Re: [PATCH 3/3] powerpc/kprobes: Check return value of patch_instruction()

2020-04-24 Thread Naveen N. Rao
Steven Rostedt wrote: On Fri, 24 Apr 2020 23:56:25 +0530 "Naveen N. Rao" wrote: > #define PATCH_INSN(addr, instr) \ > ({ >int rc = patch_instruction((unsigned int *)(addr), instr); \ >if (rc)

Re: [PATCH 3/3] powerpc/kprobes: Check return value of patch_instruction()

2020-04-27 Thread Naveen N. Rao
Christophe Leroy wrote: On 04/24/2020 06:26 PM, Naveen N. Rao wrote: Steven Rostedt wrote: On Thu, 23 Apr 2020 17:41:52 +0200 Christophe Leroy wrote: > diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c > index 024f7aad1952..046485bb0a52 100644 > -

Re: [PATCH 3/3] powerpc/kprobes: Check return value of patch_instruction()

2020-04-27 Thread Naveen N. Rao
Steven Rostedt wrote: On Sat, 25 Apr 2020 10:11:56 + Christophe Leroy wrote: Sure it's be more explicit, but then more lines also. 3 lines for only one really usefull. With goto, I would look like: diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c index 0

Re: [PATCH 1/3] powerpc: Properly return error code from do_patch_instruction()

2020-04-27 Thread Naveen N. Rao
Christopher M. Riedl wrote: On Fri Apr 24, 2020 at 9:15 AM, Steven Rostedt wrote: On Thu, 23 Apr 2020 18:21:14 +0200 Christophe Leroy wrote: > Le 23/04/2020 à 17:09, Naveen N. Rao a écrit : > > With STRICT_KERNEL_RWX, we are currently ignoring return value from > > __patch_i

[PATCH v2 1/2] powerpc/ftrace: Simplify error checking when patching instructions

2020-04-28 Thread Naveen N. Rao
: Naveen N. Rao --- arch/powerpc/kernel/trace/ftrace.c | 96 +++--- 1 file changed, 60 insertions(+), 36 deletions(-) diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c index 7ea0ca044b65..63edbd48af42 100644 --- a/arch/powerpc/kernel/trace

[PATCH v2 0/2] powerpc: Enhance error handling with patch_instruction()

2020-04-28 Thread Naveen N. Rao
is being covered in a separate patchset. v1: http://lkml.kernel.org/r/cover.1587654213.git.naveen.n@linux.vnet.ibm.com - Naveen Naveen N. Rao (2): powerpc/ftrace: Simplify error checking when patching instructions powerpc/kprobes: Check return value of patch_instruction() arch/power

[PATCH v2 2/2] powerpc/kprobes: Check return value of patch_instruction()

2020-04-28 Thread Naveen N. Rao
robes/optprobes: Use patch_instruction()") Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 13 +++- arch/powerpc/kernel/optprobes.c | 109 +++- 2 files changed, 89 insertions(+), 33 deletions(-) diff --git a/arch/powerpc/kernel/kprobes.c b

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

2020-04-28 Thread Naveen N. Rao
Balamuruhan S wrote: 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/stringloops/Makefile| 34 ++

Re: [RFC PATCH v2 0/7] consolidate PowerPC instruction encoding macros

2020-04-28 Thread Naveen N. Rao
s/powerpc/stringloops/asm/ppc-opcode.h This LGTM. Except the last patch: Acked-by: Naveen N. Rao Tested-by: Naveen N. Rao Thanks! - Naveen

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