[RFC PATCH 04/15] powerpc/ftrace: Use FTRACE_REGS_ADDR to identify the correct ftrace trampoline

2023-06-07 Thread Naveen N Rao
Instead of keying off DYNAMIC_FTRACE_WITH_REGS, use FTRACE_REGS_ADDR to identify the proper ftrace trampoline address to use. Signed-off-by: Naveen N Rao --- arch/powerpc/kernel/trace/ftrace.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/trace

[RFC PATCH 03/15] powerpc/ftrace: Simplify function_graph support in ftrace.c

2023-06-07 Thread Naveen N Rao
Since we now support DYNAMIC_FTRACE_WITH_ARGS across ppc32 and ppc64 ELFv2, we can simplify function_graph tracer support code in ftrace.c Signed-off-by: Naveen N Rao --- arch/powerpc/kernel/trace/ftrace.c | 64 -- 1 file changed, 7 insertions(+), 57 deletions

[RFC PATCH 02/15] powerpc64/ftrace: Move ELFv1 and -pg support code into a separate file

2023-06-07 Thread Naveen N Rao
. ftrace.c can then be refactored and enhanced with a focus on ppc32 and ppc64 ELFv2. Signed-off-by: Naveen N Rao --- arch/powerpc/kernel/trace/Makefile| 13 +- arch/powerpc/kernel/trace/ftrace.c| 10 - arch/powerpc/kernel/trace/ftrace_pg.c | 846 ++ 3 files

[RFC PATCH 15/15] powerpc/ftrace: Add support for -fpatchable-function-entry

2023-06-07 Thread Naveen N Rao
'. Signed-off-by: Naveen N Rao --- arch/powerpc/Kconfig | 14 +++--- arch/powerpc/Makefile | 5 arch/powerpc/include/asm/ftrace.h | 6 +++-- arch/powerpc/include/asm/vermagic.h | 4 ++- arch/powerpc/kernel

[RFC PATCH 14/15] powerpc/ftrace: Implement ftrace_replace_code()

2023-06-07 Thread Naveen N Rao
should no longer be called. This lays the groundwork to enable better control in patching ftrace locations, including the ability to nop-out preceding profiling instructions when ftrace is disabled. Signed-off-by: Naveen N Rao --- arch/powerpc/kernel/trace/ftrace.c | 173

[RFC PATCH 13/15] powerpc/ftrace: Replace use of ftrace_call_replace() with ftrace_create_branch_inst()

2023-06-07 Thread Naveen N Rao
ftrace_create_branch_inst() is clearer about its intent than ftrace_call_replace(). Signed-off-by: Naveen N Rao --- arch/powerpc/kernel/trace/ftrace.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel

[RFC PATCH 12/15] powerpc/ftrace: Simplify ftrace_modify_call()

2023-06-07 Thread Naveen N Rao
instruction at the ftrace location before patching it with the updated branch destination. Signed-off-by: Naveen N Rao --- arch/powerpc/kernel/trace/ftrace.c | 161 - 1 file changed, 21 insertions(+), 140 deletions(-) diff --git a/arch/powerpc/kernel/trace/ftrace.c b

[RFC PATCH 11/15] powerpc/ftrace: Simplify ftrace_make_call()

2023-06-07 Thread Naveen N Rao
patching it. Signed-off-by: Naveen N Rao --- arch/powerpc/kernel/trace/ftrace.c | 187 + 1 file changed, 31 insertions(+), 156 deletions(-) diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c index 67773cd14da71a..8d5d91b8ae85a0 100644

[RFC PATCH 00/15] powerpc/ftrace: refactoring and support for -fpatchable-function-entry

2023-06-07 Thread Naveen N Rao
This is a follow-on RFC to the patch I previously posted here: http://lore.kernel.org/20230519192600.2593506-1-nav...@kernel.org Since then, I have split up the patches, picked up a few more changes and given this more testing. More details in the individual patches. - Naveen Naveen N Rao

[PATCH] powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh

2023-05-30 Thread Naveen N Rao
Toolchains don't always default to the ELFv2 ABI. This is true with at least the kernel.org toolchains. As such, pass -mabi=elfv2 explicitly to ensure that we are testing against the correct compiler output. Signed-off-by: Naveen N Rao --- The script works fine without this change, so

Re: [PATCH] powerpc: Fail build if using recordmcount with binutils v2.37

2023-05-30 Thread Naveen N Rao
Michael Ellerman wrote: Naveen N Rao writes: binutils v2.37 drops unused section symbols, which prevents recordmcount from capturing mcount locations in sections that have no non-weak symbols. This results in a build failure with a message such as: Cannot find symbol for section 12

[PATCH v2] powerpc: Fail build if using recordmcount with binutils v2.37

2023-05-30 Thread Naveen N Rao
to recordmcount. Fail the build and print a warning if binutils v2.37 is detected and if we are using recordmcount. Cc: sta...@vger.kernel.org Suggested-by: Joel Stanley Signed-off-by: Naveen N Rao --- v2: Check directly against $CONFIG_LD_VERSION arch/powerpc/Makefile | 8 1 file changed, 8

[PATCH] powerpc: Fail build if using recordmcount with binutils v2.37

2023-05-29 Thread Naveen N Rao
to recordmcount. Fail the build and print a warning if binutils v2.37 is detected and if we are using recordmcount. Cc: sta...@vger.kernel.org Suggested-by: Joel Stanley Signed-off-by: Naveen N Rao --- arch/powerpc/Makefile | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/Makefile b

Re: [RFC PATCH] powerpc/ftrace: Refactoring and support for -fpatchable-function-entry

2023-05-23 Thread Naveen N Rao
Christophe Leroy wrote: That's better, but still more time than original implementation: +20% to activate function tracer (was +40% with your RFC) +21% to activate nop tracer (was +24% with your RFC) perf record (without strict kernel rwx) : 17.75% echo [kernel.kallsyms] [k]

Re: [RFC PATCH] powerpc/ftrace: Refactoring and support for -fpatchable-function-entry

2023-05-20 Thread Naveen N Rao
Christophe Leroy wrote: Le 19/05/2023 à 21:26, Naveen N Rao a écrit : [Vous ne recevez pas souvent de courriers de nav...@kernel.org. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] Refactor ftrace code and move to using ftrace_replace_code() to help

Re: [RFC PATCH] powerpc/ftrace: Refactoring and support for -fpatchable-function-entry

2023-05-20 Thread Naveen N Rao
Christophe Leroy wrote: Le 20/05/2023 à 12:34, Christophe Leroy a écrit : Le 19/05/2023 à 21:26, Naveen N Rao a écrit : [Vous ne recevez pas souvent de courriers de nav...@kernel.org. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] Refactor ftrace

[RFC PATCH] powerpc/ftrace: Refactoring and support for -fpatchable-function-entry

2023-05-19 Thread Naveen N Rao
/ - https://lore.kernel.org/all/20230506011814.8766-1-npig...@gmail.com/ This builds for me and passes a quick test, posting this as an early RFC. Signed-off-by: Naveen N Rao --- arch/powerpc/Kconfig | 10 + arch/powerpc/Makefile | 5 + arch/powerpc

Re: [PATCH] powerpc/64: Use -mprofile-kernel for big endian ELFv2 kernels

2023-05-09 Thread Naveen N. Rao
Nicholas Piggin wrote: -mprofile-kernel is an optimised calling convention for mcount that Linux has only implemented with the ELFv2 ABI, so it was disabled for big endian kernels. However it does work with ELFv2 big endian, so let's allow that if the compiler supports it. Cc: Naveen N. Rao

Re: [PATCH 0/4] powerpc/64: ELFv2 conversion

2023-05-05 Thread Naveen N. Rao
Michael Ellerman wrote: Christophe Leroy writes: Le 05/05/2023 à 09:18, Nicholas Piggin a écrit : This series has the steps to remove ELFv1 from the kernel build. Patch 1 is a build fix, 2 defaults everything to ELFv2, 3 is really a separate issue that concerns userspace. 4 removes v1

Re: [PATCH v2] powerpc/bpf: populate extable entries only during the last pass

2023-04-25 Thread Naveen N. Rao
a...@vger.kernel.org Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp.c | 2 ++ 1 file changed, 2 insertions(+) Reviewed-by: Naveen N. Rao - Naveen diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c index e93aefcfb83f..37043dfc1add 100644 --

Re: [PATCH] powerpc/bpf: populate extable entries only during the last pass

2023-04-24 Thread Naveen N. Rao
Hari Bathini wrote: Hello Christophe, Thanks for the review. On 07/04/23 11:31 am, Christophe Leroy wrote: Le 06/04/2023 à 09:35, Hari Bathini a écrit : Since commit 85e031154c7c ("powerpc/bpf: Perform complete extra passes to update addresses"), two additional passes are performed to

Re: arch/powerpc/kernel/head_85xx.o: warning: objtool: .head.text+0x1a6c: unannotated intra-function call

2023-01-24 Thread Naveen N. Rao
Sathvika Vasireddy wrote: arch/powerpc/kvm/booke.o: warning: objtool: kvmppc_fill_pt_regs+0x30: unannotated intra-function call As an attempt to fix it, I tried expanding ANNOTATE_INTRA_FUNCTION_CALL macro to indicate that the branch target is valid. It then threw another warning

Re: [PATCH v1 06/10] powerpc/bpf: Perform complete extra passes to update addresses

2023-01-10 Thread Naveen N. Rao
Christophe Leroy wrote: Le 13/12/2022 à 11:23, Naveen N. Rao a écrit : Christophe Leroy wrote: BPF core calls the jit compiler again for an extra pass in order to properly set subprog addresses. Unlike other architectures, powerpc only updates the addresses during that extra pass. It means

Re: [PATCH v2] powerpc/pseries: fix potential memory leak in init_cpu_associativity()

2023-01-10 Thread Naveen N. Rao
ms/pseries/lpar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Naveen N. Rao - Naveen

Re: [PATCH v1 06/10] powerpc/bpf: Perform complete extra passes to update addresses

2022-12-13 Thread Naveen N. Rao
Christophe Leroy wrote: BPF core calls the jit compiler again for an extra pass in order to properly set subprog addresses. Unlike other architectures, powerpc only updates the addresses during that extra pass. It means that holes must have been left in the code in order to enable the maximum

Re: [PATCH] powerpc/pseries: fix potential memory leak in init_cpu_associativity()

2022-12-12 Thread Naveen N. Rao
Wang Yufen wrote: If the vcpu_associativity alloc memory successfully but the pcpu_associativity fails to alloc memory, the vcpu_associativity memory leaks. Fixes: d62c8deeb6e6 ("powerpc/pseries: Provide vcpu dispatch statistics") Signed-off-by: Wang Yufen ---

Re: linux-next: build warnings after merge of the powerpc-objtool tree

2022-12-06 Thread Naveen N. Rao
Sathvika Vasireddy wrote: On 29/11/22 20:58, Christophe Leroy wrote: Le 29/11/2022 à 16:13, Sathvika Vasireddy a écrit : Hi all, On 25/11/22 09:00, Stephen Rothwell wrote: Hi all, After merging the powerpc-objtool tree, today's linux-next build (powerpc pseries_le_defconfig) produced

Re: [PATCH] powerpc/bpf: Only update ldimm64 during extra pass when it is an address

2022-11-24 Thread Naveen N. Rao
Christophe Leroy wrote: Le 24/11/2022 à 14:49, Naveen N. Rao a écrit : Christophe Leroy wrote: Le 24/11/2022 à 11:13, Naveen N. Rao a écrit : Christophe Leroy wrote: In what direction could that change in the future ? For me if they change that it becomes an API change. More

Re: [PATCH] powerpc/bpf: Only update ldimm64 during extra pass when it is an address

2022-11-24 Thread Naveen N. Rao
Christophe Leroy wrote: Le 24/11/2022 à 11:13, Naveen N. Rao a écrit : Christophe Leroy wrote: ldimm64 is not only used for loading function addresses, and That's probably true today, but I worry that that can change upstream and we may not notice at all. Not sure what you mean. Today

Re: Questions about kprobe handler

2022-11-24 Thread Naveen N. Rao
Jinyang He wrote: 在 2022/11/17 21:09, Masami Hiramatsu (Google) 写道: On Thu, 17 Nov 2022 09:07:37 +0800 Tiezhu Yang wrote: Hi KPROBES maintainers, There are some differences of kprobe handler implementations on various archs, the implementations are almost same on arm64, riscv, csky, the

Re: [PATCH v2] powerpc/bpf/32: Fix Oops on tail call tests

2022-11-24 Thread Naveen N. Rao
ved across function calls jited:1 140975 PASS test_bpf: #8 Tail call error path, NULL target jited:1 110 PASS test_bpf: #9 Tail call error path, index out of range jited:1 69 PASS test_bpf: test_tail_calls: Summary: 10 PASSED, 0 FAILED, [10/10 JIT'ed] Suggested-by: Naveen N. Rao Fixes: 51

Re: [PATCH] powerpc/bpf: Only update ldimm64 during extra pass when it is an address

2022-11-24 Thread Naveen N. Rao
Christophe Leroy wrote: ldimm64 is not only used for loading function addresses, and That's probably true today, but I worry that that can change upstream and we may not notice at all. the NOPs added for padding are impacting performance, so avoid them when not necessary. On QEMU mac99,

Re: [PATCH] powerpc/bpf/32: Fix Oops on tail call tests

2022-11-22 Thread Naveen N. Rao
Christophe Leroy wrote: Le 22/11/2022 à 08:33, Naveen N. Rao a écrit : Christophe Leroy wrote: This is a tentative to write above the stack. The problem is encoutered with tests added by commit 38608ee7b690 ("bpf, tests: Add load store test case for tail call") This happens be

Re: [PATCH] powerpc/bpf/32: Fix Oops on tail call tests

2022-11-21 Thread Naveen N. Rao
Christophe Leroy wrote: test_bpf tail call tests end up as: test_bpf: #0 Tail call leaf jited:1 85 PASS test_bpf: #1 Tail call 2 jited:1 111 PASS test_bpf: #2 Tail call 3 jited:1 145 PASS test_bpf: #3 Tail call 4 jited:1 170 PASS test_bpf: #4 Tail call load/store leaf jited:1 190 PASS

[PATCH 2/3] selftests/powerpc: Bump up rlimit for perf-hwbreak test

2022-11-21 Thread Naveen N. Rao
The systemwide perf hardware breakpoint test tries to open a perf event on each cpu. On large systems, we run out of file descriptors and fail the test. Instead, have the test set the file descriptor limit to an arbitraty high value. Reported-by: Rohan Deshpande Signed-off-by: Naveen N. Rao

[PATCH 3/3] selftests/powerpc: Account for offline cpus in perf-hwbreak test

2022-11-21 Thread Naveen N. Rao
For systemwide tests, use online cpu mask to only open events on online cpus. This enables this test to work on systems in lower SMT modes. Signed-off-by: Naveen N. Rao --- .../selftests/powerpc/ptrace/perf-hwbreak.c | 45 --- 1 file changed, 39 insertions(+), 6 deletions

[PATCH 1/3] selftests/powerpc: Move perror closer to its use

2022-11-21 Thread Naveen N. Rao
Right now, if perf_event_open() fails for the systemwide tests, error report is printed too late, sometimes after subsequent system calls. Move use of perror() to the main function, just after the syscall. Signed-off-by: Naveen N. Rao --- .../selftests/powerpc/ptrace/perf-hwbreak.c | 21

[PATCH 0/3] selftests/powerpc: ptrace/perf_hwbreak test fixes

2022-11-21 Thread Naveen N. Rao
issues. The first patch is a small cleanup to aid subsequent fixes. - Naveen Naveen N. Rao (3): selftests/powerpc: Move perror closer to its use selftests/powerpc: Bump up rlimit for perf-hwbreak test selftests/powerpc: Account for offline cpus in perf-hwbreak test .../selftests/powerpc

[PATCH] perf test: Skip watchpoint tests if no watchpoints available

2022-11-21 Thread Naveen N. Rao
On IBM Power9, perf watchpoint tests fail since no hardware breakpoints are available. Detect this by checking the error returned by perf_event_open() and skip the tests in that case. Reported-by: Disha Goel Signed-off-by: Naveen N. Rao --- tools/perf/tests/wp.c | 12 +++- 1 file

Re: [PATCH 4/5] powerpc/kprobes: Setup consistent pt_regs across kprobes, optprobes and KPROBES_ON_FTRACE

2022-11-08 Thread Naveen N. Rao
Nicholas Piggin wrote: On Fri Oct 21, 2022 at 3:29 AM AEST, Naveen N. Rao wrote: Ensure a more consistent pt_regs across kprobes, optprobes and KPROBES_ON_FTRACE: - Drop setting trap to 0x700 under optprobes. This is not accurate and is unnecessary. Instead, zero it out for both optprobes

Re: [PATCH 1/5] powerpc/kprobes: Remove preempt disable around call to get_kprobe() in arch_prepare_kprobe()

2022-11-08 Thread Naveen N. Rao
Nicholas Piggin wrote: On Fri Oct 21, 2022 at 3:28 AM AEST, Naveen N. Rao wrote: arch_prepare_kprobe() is called from register_kprobe() via prepare_kprobe(), or through register_aggr_kprobe(), both with the kprobe_mutex held. Per the comment for get_kprobe(): /* * This routine is called

Re: [PATCH 5/5] powerpc/kprobes: Remove unnecessary headers from kprobes

2022-11-08 Thread Naveen N. Rao
Christophe Leroy wrote: Le 20/10/2022 à 19:29, Naveen N. Rao a écrit : Many of these headers are not necessary since those are included indirectly, or the code using those headers has been removed. It is usually not a good idea to not include headers because they are already included

[PATCH 3/5] powerpc/kprobes: Use preempt_enable() rather than the no_resched variant

2022-10-20 Thread Naveen N. Rao
preempt_enable_no_resched() is just the same as preempt_enable() when we are in a irqs disabled context. kprobe_handler() and the post/fault handlers are all called with irqs disabled. As such, convert those to just use preempt_enable(). Reported-by: Nicholas Piggin Signed-off-by: Naveen N. Rao

[PATCH 5/5] powerpc/kprobes: Remove unnecessary headers from kprobes

2022-10-20 Thread Naveen N. Rao
Many of these headers are not necessary since those are included indirectly, or the code using those headers has been removed. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes-ftrace.c | 4 arch/powerpc/kernel/kprobes.c| 2 -- 2 files changed, 6 deletions(-) diff --git

[PATCH 4/5] powerpc/kprobes: Setup consistent pt_regs across kprobes, optprobes and KPROBES_ON_FTRACE

2022-10-20 Thread Naveen N. Rao
do in optprobes and trap-based kprobes. - Drop setting orig_gpr3 and result to zero in optprobes. These are not relevant under kprobes and should not be used by the handlers. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/optprobes_head.S| 5 + arch/powerpc/kernel/trace

[PATCH 2/5] powerpc/kprobes: Have optimized_callback() use preempt_enable()

2022-10-20 Thread Naveen N. Rao
rpc/kprobes: Do not disable interrupts for optprobes and kprobes_on_ftrace"). Reported-by: Nicholas Piggin Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/optprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kern

[PATCH 1/5] powerpc/kprobes: Remove preempt disable around call to get_kprobe() in arch_prepare_kprobe()

2022-10-20 Thread Naveen N. Rao
(). *OR *- with preemption disabled - from architecture specific code. */ As such, there is no need to disable preemption around the call to get_kprobe(). Drop the same. Reported-by: Nicholas Piggin Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 2

[PATCH 0/5] powerpc/kprobes: preempt related changes and cleanups

2022-10-20 Thread Naveen N. Rao
This series attempts to address some of the concerns raised in https://github.com/linuxppc/issues/issues/440 The last two patches are minor cleanups in related kprobes code. - Naveen Naveen N. Rao (5): powerpc/kprobes: Remove preempt disable around call to get_kprobe

Re: [PATCH v4 00/16] objtool: Enable and implement --mcount option on powerpc

2022-10-12 Thread Naveen N. Rao
Josh Poimboeuf wrote: On Tue, Oct 11, 2022 at 01:20:02PM -0700, Josh Poimboeuf wrote: On Mon, Oct 10, 2022 at 05:19:02PM +0530, Naveen N. Rao wrote: > All the above changes are down to compiler optimizations and shuffling due > to CONFIG_OBJTOOL being enabled and changing annotate_unrea

Re: [PATCH v4 11/16] objtool: Add --mnop as an option to --mcount

2022-10-12 Thread Naveen N. Rao
Josh Poimboeuf wrote: On Mon, Oct 10, 2022 at 05:07:46PM +0530, Naveen N. Rao wrote: > +++ b/scripts/Makefile.lib > @@ -234,6 +234,7 @@ objtool_args = \ >$(if $(CONFIG_HAVE_NOINSTR_HACK), --hack

Re: [PATCH] powerpc/kprobes: Fix null pointer reference in arch_prepare_kprobe()

2022-10-12 Thread Naveen N. Rao
Li Huafei wrote:   # echo 'p cmdline_proc_show' > kprobe_events   # echo 'p cmdline_proc_show+16' >> kprobe_events I think we should extend multiple_kprobes selftest to also place contiguous probes to catch such errors. Yes. But each architecture implementation is different and it looks a

Re: [PATCH v4 00/16] objtool: Enable and implement --mcount option on powerpc

2022-10-10 Thread Naveen N. Rao
enabled and changing annotate_unreachable(). As such, for this series: Reviewed-by: Naveen N. Rao Tested-by: Naveen N. Rao Josh, Are you ok if this series is taken in through the powerpc tree? - Naveen

Re: [PATCH v4 11/16] objtool: Add --mnop as an option to --mcount

2022-10-10 Thread Naveen N. Rao
Sathvika Vasireddy wrote: Some architectures (powerpc) may not support ftrace locations being nop'ed out at build time. Introduce CONFIG_HAVE_OBJTOOL_NOP_MCOUNT for objtool, as a means for architectures to enable nop'ing of ftrace locations. Add --mnop as an option to objtool --mcount, to

Re: [PATCH v4 03/16] powerpc: Fix objtool unannotated intra-function call warnings

2022-10-10 Thread Naveen N. Rao
Sathvika Vasireddy wrote: Objtool throws unannotated intra-function call warnings in the following assembly files: arch/powerpc/kernel/vector.o: warning: objtool: .text+0x53c: unannotated intra-function call arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0x60: unannotated

Re: [PATCH] powerpc/kprobes: Fix null pointer reference in arch_prepare_kprobe()

2022-09-30 Thread Naveen N. Rao
gt;ainsn.insn))) { printk("Cannot register a kprobe on the second word of prefixed instruction\n"); ret = -EINVAL; } It's fine to keep the if condition on a single line. Other than that, thanks for the fix! Reviewed-by: Naveen N. Rao - Naveen

Re: [PATCH] scripts/faddr2line: Fix regression in name resolution on ppc64le

2022-09-30 Thread Naveen N. Rao
5100 ("scripts/faddr2line: Fix overlapping text section failures") Reference: https://lore.kernel.org/bpf/20191211160133.GB4580@calabresa/ Cc: "Naveen N. Rao" Cc: Jiri Olsa Cc: Thadeu Lima de Souza Cascardo Reviewed-by: Thadeu Lima de Souza Cascardo The other instances of

Re: [PATCH v3 11/16] objtool: Add --mnop as an option to --mcount

2022-09-15 Thread Naveen N. Rao
kernel test robot wrote: Hi Sathvika, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/topic/ppc-kvm] [also build test ERROR on linus/master v6.0-rc5] [cannot apply to powerpc/next masahiroy-kbuild/for-next next-20220912] [If your patch is applied to the

Re: [PATCH v2 11/16] objtool: Add --mnop as an option to --mcount

2022-09-05 Thread Naveen N. Rao
Peter Zijlstra wrote: On Mon, Aug 29, 2022 at 11:22:18AM +0530, Sathvika Vasireddy wrote: Architectures can select HAVE_NOP_MCOUNT if they choose to nop out mcount call sites. If that config option is selected, then --mnop is passed as an option to objtool, along with --mcount. Also, make sure

Re: [PATCH v2 05/16] powerpc: Skip objtool from running on drivers/crypto/vmx/aesp8-ppc.o

2022-09-05 Thread Naveen N. Rao
Peter Zijlstra wrote: On Mon, Aug 29, 2022 at 11:22:12AM +0530, Sathvika Vasireddy wrote: With objtool enabled, below warnings are seen when trying to build: drivers/crypto/vmx/aesp8-ppc.o: warning: objtool: aes_p8_set_encrypt_key+0x44: unannotated intra-function call

Re: [PATCH v2 16/16] objtool/powerpc: Add --mcount specific implementation

2022-09-05 Thread Naveen N. Rao
Segher Boessenkool wrote: On Wed, Aug 31, 2022 at 12:50:07PM +, Christophe Leroy wrote: Le 29/08/2022 à 07:52, Sathvika Vasireddy a écrit : > + opcode = insn >> 26; > + > + switch (opcode) { > + case 18: /* bl */ case 18 is more than 'bl', it includes also 'b'. In both cases, the

Re: [PATCH v2 15/16] objtool/powerpc: Enable objtool to be built on ppc

2022-09-05 Thread Naveen N. Rao
Christophe Leroy wrote: Le 29/08/2022 à 07:52, Sathvika Vasireddy a écrit : diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 4c466acdc70d..dc05cd23c233 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -237,6 +237,7 @@ config PPC select

Re: [PATCH v2 01/16] powerpc: Replace unreachable() with it's builtin variant in __WARN_FLAGS()

2022-09-05 Thread Naveen N. Rao
Christophe Leroy wrote: Le 29/08/2022 à 07:52, Sathvika Vasireddy a écrit : objtool is throwing *unannotated intra-function call* warnings in .c files with a few instructions that are marked unreachable. The problem comes from the annotate_unreachable() macro that is called by unreachable().

Re: [PATCH] compiler-gcc.h: Remove ancient workaround for gcc PR 58670

2022-08-25 Thread Naveen N. Rao
Uros Bizjak wrote: The workaround for 'asm goto' miscompilation introduces a compiler barrier quirk that inhibits many useful compiler optimizations. For example, __try_cmpxchg_user compiles to: 11375: 41 8b 4d 00 mov0x0(%r13),%ecx 11379: 41 8b 02

Re: [PATCH 01/16] powerpc: Replace unreachable() with it's builtin variant in WARN_ON()

2022-08-18 Thread Naveen N. Rao
Christophe Leroy wrote: Le 18/08/2022 à 12:46, Naveen N. Rao a écrit : Christophe Leroy wrote: Le 08/08/2022 à 13:48, Sathvika Vasireddy a écrit : objtool is throwing *unannotated intra-function call* warnings with a few instructions that are marked unreachable. Replace unreachable

Re: [PATCH 01/16] powerpc: Replace unreachable() with it's builtin variant in WARN_ON()

2022-08-18 Thread Naveen N. Rao
Christophe Leroy wrote: Le 08/08/2022 à 13:48, Sathvika Vasireddy a écrit : objtool is throwing *unannotated intra-function call* warnings with a few instructions that are marked unreachable. Replace unreachable() with __builtin_unreachable() to fix these warnings, as the codegen remains same

Re: [PATCH 0/2] ftrace/recordmcount: Handle object files without section symbols

2022-08-16 Thread Naveen N. Rao
Hi Steven, Steven Rostedt wrote: On Wed, 27 Apr 2022 15:01:20 +0530 "Naveen N. Rao" wrote: This solves a build issue on powerpc with binutils v2.36 and newer [1]. Since commit d1bcae833b32f1 ("ELF: Don't generate unused section symbols") [2], binutils started drop

[PATCH] powerpc/ftrace: Ignore weak functions

2022-08-09 Thread Naveen N. Rao
: # grep __ftrace_invalid_address available_filter_functions | wc -l 79 Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/ftrace.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h index 3cee7115441b41..ade4

[PATCH] powerpc64/ftrace: Fix ftrace for clang builds

2022-08-09 Thread Naveen N. Rao
by: Ondrej Mosnacek Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/trace/ftrace.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c index cb158c32b50b99..7b85c3b460a3c0 100644 --- a/arch/powerpc/ke

Re: [PATCH v3 11/25] powerpc/ftrace: Make __ftrace_make_{nop/call}() common to PPC32 and PPC64

2022-08-09 Thread Naveen N. Rao
Nick Desaulniers wrote: Christ...that's not what I meant to send; sorry, mutt is giving me bizarro errors today so I can't insert myself into threads using the usual incantation I have in the past. What I meant to send was: Christophe, Ondrej reported a regression with ftrace when building w/

Re: [PATCH] powerpc/ppc-opcode: Fix PPC_RAW_TW()

2022-08-03 Thread Naveen N. Rao
Christophe Leroy wrote: PPC_RAW_TW() is erroneously defined with base code 0x7f08 instead of 0x7c08. That's invisible because its only user is PPC_RAW_TRAP() which is 0x7fe8, but fix it anyway to avoid any risk of future bug. Reported-by: Naveen N. Rao Fixes: d00d762daf12

Re: [PATCH 2/3] powerpc/ppc-opcode: Define and use PPC_RAW_TRAP() and PPC_RAW_TW()

2022-08-03 Thread Naveen N. Rao
Christophe Leroy wrote: Add and use PPC_RAW_TRAP() instead of opencoding. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc-opcode.h | 2 ++ arch/powerpc/include/asm/probes.h | 3 ++- arch/powerpc/xmon/xmon.c | 2 +- 3 files changed, 5 insertions(+), 2

Re: [RFC PATCH v3 11/12] powerpc: Remove unreachable() from WARN_ON()

2022-06-30 Thread Naveen N. Rao
Christophe Leroy wrote: Le 30/06/2022 à 10:05, Naveen N. Rao a écrit : Christophe Leroy wrote: The builtin variant of unreachable (__builtin_unreachable()) works. How about using that instead of unreachable() ? In fact the problem comes from the macro annotate_unreachable() which

Re: [RFC PATCH v3 11/12] powerpc: Remove unreachable() from WARN_ON()

2022-06-30 Thread Naveen N. Rao
Christophe Leroy wrote: Hi Sathvika, Adding ARM people as they seem to face the same kind of problem (see https://patchwork.kernel.org/project/linux-kbuild/patch/20220623014917.199563-33-chenzhong...@huawei.com/) Le 27/06/2022 à 17:35, Sathvika Vasireddy a écrit : On 25/06/22 12:16,

[PATCH v5.4] kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add]

2022-06-28 Thread Naveen N. Rao
/kexec.h needs linux/module.h] Link: https://lkml.kernel.org/r/20220519091237.676736-1-naveen.n@linux.vnet.ibm.com Signed-off-by: Michael Ellerman Signed-off-by: Naveen N. Rao Cc: "Eric W. Biederman" Cc: Signed-off-by: Andrew Morton --- arch/s390/include/asm/kexec.h | 10

[PATCH v4.9] kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add]

2022-06-28 Thread Naveen N. Rao
/kexec.h needs linux/module.h] Link: https://lkml.kernel.org/r/20220519091237.676736-1-naveen.n@linux.vnet.ibm.com Signed-off-by: Michael Ellerman Signed-off-by: Naveen N. Rao Cc: "Eric W. Biederman" Cc: Signed-off-by: Andrew Morton --- arch/x86/include/asm/kexec.h | 7 +++ inc

[PATCH v4.19] kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add]

2022-06-28 Thread Naveen N. Rao
/kexec.h needs linux/module.h] Link: https://lkml.kernel.org/r/20220519091237.676736-1-naveen.n@linux.vnet.ibm.com Signed-off-by: Michael Ellerman Signed-off-by: Naveen N. Rao Cc: "Eric W. Biederman" Cc: Signed-off-by: Andrew Morton --- arch/s390/include/asm/kexec.h | 10

[PATCH v4.14] kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add]

2022-06-28 Thread Naveen N. Rao
/kexec.h needs linux/module.h] Link: https://lkml.kernel.org/r/20220519091237.676736-1-naveen.n@linux.vnet.ibm.com Signed-off-by: Michael Ellerman Signed-off-by: Naveen N. Rao Cc: "Eric W. Biederman" Cc: Signed-off-by: Andrew Morton --- arch/x86/include/asm/kexec.h | 6 ++ inc

[PATCH powerpc v2] powerpc/bpf: Fix use of user_pt_regs in uapi

2022-06-27 Thread Naveen N. Rao
: a6460b03f945ee ("powerpc/bpf: Fix broken uapi for BPF_PROG_TYPE_PERF_EVENT") Cc: sta...@vger.kernel.org # v4.20+ Signed-off-by: Naveen N. Rao --- v2: Add arch/powerpc/include/asm/bpf_perf_event.h arch/powerpc/include/asm/bpf_perf_event.h | 9 + arch/powerpc/includ

[PATCH v5.4] powerpc/ftrace: Remove ftrace init tramp once kernel init is complete

2022-06-27 Thread Naveen N. Rao
commit 84ade0a6655bee803d176525ef457175cbf4df22 upstream. Stop using the ftrace trampoline for init section once kernel init is complete. Fixes: 67361cf8071286 ("powerpc/ftrace: Handle large kernel configs") Cc: sta...@vger.kernel.org # v4.20+ Signed-off-by: Naveen N. Rao Signed-off-b

[PATCH v5.15] powerpc/ftrace: Remove ftrace init tramp once kernel init is complete

2022-06-27 Thread Naveen N. Rao
commit 84ade0a6655bee803d176525ef457175cbf4df22 upstream. Stop using the ftrace trampoline for init section once kernel init is complete. Fixes: 67361cf8071286 ("powerpc/ftrace: Handle large kernel configs") Cc: sta...@vger.kernel.org # v4.20+ Signed-off-by: Naveen N. Rao Signed-off-b

[PATCH v5.10] powerpc/ftrace: Remove ftrace init tramp once kernel init is complete

2022-06-27 Thread Naveen N. Rao
commit 84ade0a6655bee803d176525ef457175cbf4df22 upstream. Stop using the ftrace trampoline for init section once kernel init is complete. Fixes: 67361cf8071286 ("powerpc/ftrace: Handle large kernel configs") Cc: sta...@vger.kernel.org # v4.20+ Signed-off-by: Naveen N. Rao Signed-off-b

[PATCH v5.18] powerpc/ftrace: Remove ftrace init tramp once kernel init is complete

2022-06-27 Thread Naveen N. Rao
commit 84ade0a6655bee803d176525ef457175cbf4df22 upstream. Stop using the ftrace trampoline for init section once kernel init is complete. Fixes: 67361cf8071286 ("powerpc/ftrace: Handle large kernel configs") Cc: sta...@vger.kernel.org # v4.20+ Signed-off-by: Naveen N. Rao Signed-off-b

Re: [PATCH v2 5/5] bpf ppc32: Add instructions for atomic_[cmp]xchg

2022-06-24 Thread Naveen N. Rao
Hari Bathini wrote: On 14/06/22 12:41 am, Hari Bathini wrote: On 11/06/22 11:04 pm, Christophe Leroy wrote: Le 10/06/2022 à 17:55, Hari Bathini a écrit : This adds two atomic opcodes BPF_XCHG and BPF_CMPXCHG on ppc32, both of which include the BPF_FETCH flag.  The kernel's

Re: [PATCH v2 0/5] Atomics support for eBPF on powerpc

2022-06-24 Thread Naveen N. Rao
]_[fetch_]xor * atomic[64]_xchg * atomic[64]_cmpxchg and this list of kernel operations for ppc32: * atomic_[fetch_]add * atomic_[fetch_]and * atomic_[fetch_]or * atomic_[fetch_]xor * atomic_xchg * atomic_cmpxchg Thanks for your work on this. For this series: Reviewed-by: Naveen N. Rao

[PATCH powerpc] powerpc/bpf: Fix use of user_pt_regs in uapi

2022-06-17 Thread Naveen N. Rao
0b03f945ee ("powerpc/bpf: Fix broken uapi for BPF_PROG_TYPE_PERF_EVENT") Cc: sta...@vger.kernel.org # v4.20+ Signed-off-by: Naveen N. Rao --- arch/powerpc/include/uapi/asm/bpf_perf_event.h | 9 - 1 file changed, 9 deletions(-) delete mode 100644 arch/powerpc/include/uapi/asm/bpf_perf

Re: [RFC PATCH 4/4] objtool/powerpc: Add --mcount specific implementation

2022-06-17 Thread Naveen N. Rao
Christophe Leroy wrote: Le 16/06/2022 à 15:57, Peter Zijlstra a écrit : On Thu, Jun 16, 2022 at 01:40:34PM +, Christophe Leroy wrote: sizeof(u64) is always 8 by definition. So if size is 8 we are working on a binary file for a 64 bits target, if not it means we are working for a 32 bits

Re: [RFC PATCH 4/4] objtool/powerpc: Add --mcount specific implementation

2022-06-16 Thread Naveen N. Rao
Christophe Leroy wrote: Le 25/05/2022 à 19:27, Christophe Leroy a écrit : Le 24/05/2022 à 15:33, Christophe Leroy a écrit : Le 24/05/2022 à 13:00, Sathvika Vasireddy a écrit : +{ +    switch (elf->ehdr.e_machine) { +    case EM_X86_64: +    return R_X86_64_64; +    case

[PATCH] powerpc: Enable execve syscall exit tracepoint

2022-06-09 Thread Naveen N. Rao
[000] . 103.883225: sys_execveat -> 0x0 Cc: sta...@vger.kernel.org Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index d00b20c6596671..bb4da23ecdd7

Re: [RFC PATCH 1/4] objtool: Add --mnop as an option to --mcount

2022-05-26 Thread Naveen N. Rao
Peter Zijlstra wrote: On Tue, May 24, 2022 at 04:01:48PM +0530, Naveen N. Rao wrote: We need to know for sure either way. Nop'ing out the _mcount locations at boot allows us to discover existing long branch trampolines. If we want to avoid it, we need to note down those locations during build

Re: [PATCH] kexec_file: Drop weak attribute from arch_kexec_apply_relocations[_add]

2022-05-26 Thread Naveen N. Rao
Andrew Morton wrote: On Fri, 20 May 2022 14:25:05 -0500 "Eric W. Biederman" wrote: > I am not strongly against taking off __weak, just wondering if there's > chance to fix it in recordmcount, and the cost comparing with kernel fix; > except of this issue, any other weakness of __weak.

Re: [RFC PATCH 1/4] objtool: Add --mnop as an option to --mcount

2022-05-24 Thread Naveen N. Rao
Christophe Leroy wrote: Le 24/05/2022 à 12:15, Naveen N. Rao a écrit : Christophe Leroy wrote: Le 23/05/2022 à 19:55, Sathvika Vasireddy a écrit : Architectures can select HAVE_NOP_MCOUNT if they choose to nop out mcount call sites. If that config option is selected, then --mnop is passed

Re: [RFC PATCH 1/4] objtool: Add --mnop as an option to --mcount

2022-05-24 Thread Naveen N. Rao
Christophe Leroy wrote: Le 23/05/2022 à 19:55, Sathvika Vasireddy a écrit : Architectures can select HAVE_NOP_MCOUNT if they choose to nop out mcount call sites. If that config option is selected, then --mnop is passed as an option to objtool, along with --mcount. Is there a reason not to

Re: linux-next: changed messages in qemu boot

2022-05-24 Thread Naveen N. Rao
Michael Ellerman wrote: "Naveen N. Rao" writes: Stephen Rothwell wrote: The below diff fixes it for me: diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c index 46c002a8388804..7418da705d43ac 100644 --- a/arch/powerpc/kernel/trace/ftrace.c

Re: [RFC PATCH 3/3] objtool/mcount: Add powerpc specific functions

2022-05-22 Thread Naveen N. Rao
Peter Zijlstra wrote: On Sat, May 21, 2022 at 09:38:35AM +, Christophe Leroy wrote: I gave it a try this morning, I selected HAVE_OBJTOOL and HAVE_OBJTOOL_MCOUNT from arch/powerpc/Kconfig Seems like there are still some x86 arch specific stuff in common common code and I get the

Re: linux-next: changed messages in qemu boot

2022-05-20 Thread Naveen N. Rao
Stephen Rothwell wrote: Hi all, Today's linux-next bboot of the powerpc pseries_le_defconfig build produced these different kernel messages (diff from yesterday's tree): - ftrace: allocating 33658 entries in 13 pages - ftrace: allocated 13 pages with 3 groups + ftrace-powerpc: Address of

Re: [PATCH] powerpc/vdso: Fix incorrect CFI in gettimeofday.S

2022-05-20 Thread Naveen N. Rao
Alan Modra wrote: On Tue, May 17, 2022 at 10:32:09PM +1000, Michael Ellerman wrote: "Naveen N. Rao" writes: > Michael Ellerman wrote: >> >> diff --git a/arch/powerpc/kernel/vdso/gettimeofday.S b/arch/powerpc/kernel/vdso/gettimeofday.S >> index eb9c81e1c218..0a

Re: [PATCH] kexec_file: Drop weak attribute from arch_kexec_apply_relocations[_add]

2022-05-19 Thread Naveen N. Rao
Baoquan He wrote: Hi Eric, On 05/18/22 at 04:59pm, Eric W. Biederman wrote: "Naveen N. Rao" writes: > Since commit d1bcae833b32f1 ("ELF: Don't generate unused section > symbols") [1], binutils (v2.36+) started dropping section symbols that > it thought were

Re: [PATCH] kexec_file: Drop weak attribute from arch_kexec_apply_relocations[_add]

2022-05-19 Thread Naveen N. Rao
Andrew Morton wrote: On Wed, 18 May 2022 23:48:28 +0530 "Naveen N. Rao" wrote: Since commit d1bcae833b32f1 ("ELF: Don't generate unused section symbols") [1], binutils (v2.36+) started dropping section symbols that it thought were unused. This isn't

[PATCH v2] kexec_file: Drop weak attribute from arch_kexec_apply_relocations[_add]

2022-05-19 Thread Naveen N. Rao
ng pattern of having architectures #define the name of the function they want to override in their headers. [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d1bcae833b32f1 Signed-off-by: Michael Ellerman Signed-off-by: Naveen N. Rao --- arch/s390/include/asm/kexec.h | 8 ++

[PATCH] kexec_file: Drop weak attribute from arch_kexec_apply_relocations[_add]

2022-05-18 Thread Naveen N. Rao
tectures. [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d1bcae833b32f1 Signed-off-by: Naveen N. Rao --- include/linux/kexec.h | 28 kernel/kexec_file.c | 19 +-- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/include/linux/kex

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