: Michael Ellerman
Cc: "Naveen N. Rao"
Cc: linuxppc-dev@lists.ozlabs.org
---
arch/powerpc/include/asm/kprobes.h |2 -
arch/powerpc/kernel/kprobes-ftrace.c | 15 ---
arch/powerpc/kernel/kprobes.c | 54
arch/powerpc/ke
ing this function.
Signed-off-by: Masami Hiramatsu
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Michael Ellerman
Cc: "Naveen N. Rao"
Cc: linuxppc-dev@lists.ozlabs.org
---
arch/powerpc/include/asm/kprobes.h | 10 --
arch/powerpc/kernel/kprobes-ftrace.c | 16 +++-
Yu
Cc: Ralf Baechle
Cc: James Hogan
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Michael Ellerman
Cc: Martin Schwidefsky
Cc: Heiko Carstens
Cc: Yoshinori Sato
Cc: Rich Felker
Cc: "David S. Miller"
Cc: "Naveen N. Rao"
Cc: Josef Bacik
Cc: Alexei Starovoitov
Cc
Masami Hiramatsu wrote:
On Thu, 07 Jun 2018 17:07:00 +0530
"Naveen N. Rao" wrote:
Masami Hiramatsu wrote:
> Don't call the ->break_handler() from the arm kprobes code,
^^^ powerpc
> because it was only used by jprobes whic
Michael Bringmann wrote:
powerpc/cpu: Modify dlpar_cpu_add and dlpar_cpu_remove to allow the
skipping of DRC index acquire or release operations during the CPU
add or remove operations. This is intended to support subsequent
changes to provide a 'CPU readd' operation.
Signed-off-by: Michael Bri
Gautham R Shenoy wrote:
Hi Naveen,
On Thu, Dec 05, 2019 at 10:23:58PM +0530, Naveen N. Rao wrote:
>diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
>index 80a676d..42ade55 100644
>--- a/arch/powerpc/kernel/sysfs.c
>+++ b/arch/powerpc/kernel/sysfs.c
>@@ -
Gautham R Shenoy wrote:
With repect to lparstat, the read interval is user-specified and just gets
passed onto sleep().
Ok. So I guess currently you will be sending smp_call_function every
time you read a PURR and SPURR. That number will now increase by 2
times when we read idle_purr and idle
Christophe Leroy wrote:
Le 27/11/2019 à 13:01, Gautham R. Shenoy a écrit :
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
Masami, Christophe,
Apologies for pitching in late here...
Masami Hiramatsu wrote:
On Tue, 18 Feb 2020 12:04:41 +0100
Christophe Leroy wrote:
>> Nevertheless, if one symbol has been forgotten in the blacklist, I think
>> it is a problem if it generate Oopses.
>
> There is a long history also
Christophe Leroy wrote:
At the time being we have something like
if (something) {
p = get();
if (p) {
if (something_wrong)
goto out;
...
return;
Christophe Leroy wrote:
if (a) {
if (b)
do_something();
}
Is equivalent to
if (a & b)
do_something();
Signed-off-by: Christophe Leroy
---
arch/powerpc/kernel/kprobes.c | 58 +--
1
ap happened with MSR_IR cleared, return 0 immediately.
Reported-by: Larry Finger
Fixes: 6cc89bad60a6 ("powerpc/kprobes: Invoke handlers directly")
Cc: sta...@vger.kernel.org
Cc: Naveen N. Rao
Cc: Masami Hiramatsu
Signed-off-by: Christophe Leroy
---
v2: bailing out instead of converting re
Selecting CONFIG_DEBUG_INFO_BTF results in the below warning from ld:
ld: warning: orphan section `.BTF' from `.btf.vmlinux.bin.o' being placed in
section `.BTF'
Include .BTF section in vmlinux explicitly to fix the same.
Signed-off-by: Naveen N. Rao
---
arch/powerpc/kerne
Michael Ellerman wrote:
"Naveen N. Rao" writes:
Selecting CONFIG_DEBUG_INFO_BTF results in the below warning from ld:
ld: warning: orphan section `.BTF' from `.btf.vmlinux.bin.o' being placed in
section `.BTF'
Include .BTF section in vmlinux explicitly to fix th
Gautham R Shenoy wrote:
On Fri, Feb 21, 2020 at 10:50:12AM -0600, Nathan Lynch wrote:
"Gautham R. Shenoy" writes:
> diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
> index 80a676d..5b4b450 100644
> --- a/arch/powerpc/kernel/sysfs.c
> +++ b/arch/powerpc/kernel/sysfs.c
> @@
If arch_validate_hwbkpt_settings() fails, bp->ctx won't be valid and the
kernel panics. Add a check to fix this.
Reported-by: Edjunior Barbosa Machado
Signed-off-by: Naveen N. Rao
---
arch/powerpc/kernel/hw_breakpoint.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
If arch_validate_hwbkpt_settings() fails, bp->ctx won't be valid and the
kernel panics. Add a check to fix this.
Reported-by: Edjunior Barbosa Machado
Signed-off-by: Naveen N. Rao
---
arch/powerpc/kernel/hw_breakpoint.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
Naveen N. Rao wrote:
Since BPF constant blinding is performed after the verifier pass, there
are certain ALU32 instructions inserted which don't have a corresponding
zext instruction inserted after. This is causing a kernel oops on
powerpc and can be reproduced by running 'test_cgro
Jiong Wang wrote:
Michael Ellerman writes:
"Naveen N. Rao" writes:
Since BPF constant blinding is performed after the verifier pass, there
are certain ALU32 instructions inserted which don't have a corresponding
zext instruction inserted after. This is causing a kernel oops
_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
---
Changes since RFC:
It will be a nop for
ABIv2, which would be nice, but not really a major deal.
In either case:
Reviewed-by: Naveen N. Rao
- Naveen
Jiong Wang wrote:
Naveen N. Rao writes:
Since BPF constant blinding is performed after the verifier pass, the
ALU32 instructions inserted for doubleword immediate loads don't have a
corresponding zext instruction. This is causing a kernel oops on powerpc
and can be reproduced by ru
cccd0 ("y2038: rename old time and utime syscalls")
commit 00bf25d693e7 ("y2038: use time32 syscall names on 32-bit")
commit 8dabe7245bbc ("y2038: syscalls: rename y2038 compat syscalls")
commit 0d6040d46817 ("arch: add split IPC system calls where needed"
Steven Rostedt wrote:
On Thu, 4 Jul 2019 20:04:41 +0530
"Naveen N. Rao" wrote:
kernel/trace/ftrace.c | 4
1 file changed, 4 insertions(+)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 7b037295a1f1..0791eafb693d 100644
--- a/kernel/trace/ftrace.c
+++ b/ke
Ravi Bangoria wrote:
On Powerpc64, watchpoint match range is double-word granular. On
a watchpoint hit, DAR is set to the first byte of overlap between
actual access and watched range. And thus it's quite possible that
DAR does not point inside user specified range. Ex, say user creates
a watchpo
Michael Ellerman wrote:
"Naveen N. Rao" writes:
Michael Ellerman wrote:
Currently if we oops or warn while function_graph is active the stack
trace looks like:
.trace_graph_return+0xac/0x100
.ftrace_return_to_handler+0x98/0x140
.return_to_handler+0x20/0x40
.return_to_handle
Enable HAVE_FUNCTION_GRAPH_RET_ADDR_PTR for more robust stack unwinding
when function graph tracer is in use. Convert powerpc show_stack() to
use ftrace_graph_ret_addr() for better stack unwinding.
- Naveen
Naveen N. Rao (3):
ftrace: Look up the address of return_to_handler() using helpers
This ensures that we use the right address on architectures that use
function descriptors.
Signed-off-by: Naveen N. Rao
---
kernel/trace/fgraph.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
index 8dfd5021b933
This associates entries in the ftrace_ret_stack with corresponding stack
frames, enabling more robust stack unwinding. Also update the only user
of ftrace_graph_ret_addr() to pass the stack pointer.
Signed-off-by: Naveen N. Rao
---
arch/powerpc/include/asm/asm-prototypes.h | 3 ++-
arch
] return_to_handler+0x0/0x40
(vfs_read+0xb8/0x1b0)
[c000d1e33dd0] [c006ab58] return_to_handler+0x0/0x40
(ksys_read+0x7c/0x140)
[c000d1e33e20] [c006ab58] return_to_handler+0x0/0x40
(system_call+0x5c/0x68)
Signed-off-by: Naveen N. Rao
---
arch/powerpc/kernel/process.c
telimited("Breakpoint hit on instruction that can't be emulated.
"
"Breakpoint at 0x%lx will be disabled.\n",
addr);
Otherwise:
Acked-by: Naveen N. Rao
- Naveen
+ goto disable;
+ }
/* Do not emulate user-space instructions, instead single-step them */
Michael Ellerman wrote:
"Gautham R. Shenoy" writes:
From: "Gautham R. Shenoy"
Currently on Pseries Linux Guests, the offlined CPU can be put to one
of the following two states:
- Long term processor cede (also called extended cede)
- Returned to the Hypervisor via RTAS "stop-self" call.
Michael Ellerman wrote:
"Naveen N. Rao" writes:
Michael Ellerman wrote:
"Gautham R. Shenoy" writes:
From: "Gautham R. Shenoy"
Currently on Pseries Linux Guests, the offlined CPU can be put to one
of the following two states:
- Long term processor c
ction-entry")
Reported-by: Michael Ellerman
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 54b9387c3691..3aaadfd2c8eb 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/power
On Fri, Nov 17, 2023 at 12:36:01PM -0600, Gustavo A. R. Silva wrote:
> Hi all,
>
> I'm trying to fix the following -Wstringop-overflow warnings, and I'd like
> to get your feedback on this, please:
>
> In function 'do_byte_reverse',
> inlined from 'do_vec_store' at
> /home/gus/linux/arch/pow
On Mon, Nov 20, 2023 at 08:33:45AM -0600, Gustavo A. R. Silva wrote:
>
>
> On 11/20/23 08:25, Naveen N Rao wrote:
> > On Fri, Nov 17, 2023 at 12:36:01PM -0600, Gustavo A. R. Silva wrote:
> > > Hi all,
> > >
> > > I'm trying to fix the follo
On Tue, Nov 21, 2023 at 10:54:36AM +1100, Michael Ellerman wrote:
> Building with GCC 13 (which has -array-bounds enabled) there are several
Thanks, gcc13 indeed helps reproduce the warnings.
> warnings in sstep.c along the lines of:
>
> In function ‘do_byte_reverse’,
> inlined from ‘do_
bench/breakpoint.c | 24 +---
> 1 file changed, 21 insertions(+), 3 deletions(-)
Thanks for fixing this to not report an error. A minor nit below, but
otherwise:
Acked-by: Naveen N Rao
>
> diff --git a/tools/perf/bench/breakpoint.c b/tools/perf/bench/breakpoint.c
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 avoid
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
--
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
support.
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
-1-npig...@gmail.com/
- 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 |
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
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
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] ftrac
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
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
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
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 th
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
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
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
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
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
reasons apply for
ppc32 so we only patch in a 'mflr r0'.
Signed-off-by: Naveen N Rao
---
arch/powerpc/Kconfig | 14 +++---
arch/powerpc/Makefile | 5
arch/powerpc/include/asm/ftrace.h | 6 +++--
arch/power
_pg.c.
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
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
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
r the stub from 64 bytes to 32
bytes since the different stub variants are all less than 8
instructions.
To reduce use of #ifdef, a stub implementation is provided for
kernel_toc_address() and -SZ_2G is cast to 'long long' to prevent
errors on ppc32.
Signed-off-by: Naveen N Rao
---
: Naveen N Rao
---
arch/powerpc/kernel/trace/Makefile| 17 +++--
arch/powerpc/kernel/trace/ftrace_64_pg.S | 67 ---
.../trace/{ftrace_pg.c => ftrace_64_pg.c} | 0
.../{ftrace_low.S => ftrace_64_pg_entry.S}| 58 +++-
.../{ftrace_mpro
Split up ftrace_modify_code() into a few helpers for future use. Also
update error messages accordingly.
Signed-off-by: Naveen N Rao
---
arch/powerpc/kernel/trace/ftrace.c | 51 +-
1 file changed, 29 insertions(+), 22 deletions(-)
diff --git a/arch/powerpc/kernel
.
Stop re-purposing the linker-generated long branches for ftrace to
simplify the code. If there are good reasons to support ftrace on
kernels beyond 64MB, we can consider adding support by using
-fpatchable-function-entry.
Signed-off-by: Naveen N Rao
---
arch/powerpc/kernel/trace/ftra
.
Signed-off-by: Naveen N Rao
---
arch/powerpc/include/asm/ftrace.h | 6 +++
arch/powerpc/kernel/trace/ftrace.c | 71 ++
2 files changed, 77 insertions(+)
diff --git a/arch/powerpc/include/asm/ftrace.h
b/arch/powerpc/include/asm/ftrace.h
index 1a5d365523e160
ftrace location before nop-ing it out.
Signed-off-by: Naveen N Rao
---
arch/powerpc/kernel/trace/ftrace.c | 220 +
1 file changed, 32 insertions(+), 188 deletions(-)
diff --git a/arch/powerpc/kernel/trace/ftrace.c
b/arch/powerpc/kernel/trace/ftrace.c
index c0d185742c23ca
.ftrace.tramp section is not used for any purpose. This code was added
all the way back in the original commit introducing support for dynamic
ftrace on ppc64 modules. Remove it.
Signed-off-by: Naveen N Rao
---
arch/powerpc/include/asm/module.h | 4
1 file changed, 4 deletions(-)
diff
Christophe Leroy wrote:
Le 23/05/2023 à 11:31, Naveen N Rao a écrit :
Christophe Leroy wrote:
Ok, I simplified this further, and this is as close to the previous
fast path as we can get (applies atop the original RFC). The only
difference left is the ftrace_rec iterator.
That'
, similar to the pre
-mprofile-kernel ABI on ppc64. This is not supported.
Disable ftrace on ppc32 if using clang for now. This can be re-enabled
later if clang picks up support for -fpatchable-function-entry on ppc32.
Signed-off-by: Naveen N Rao
---
arch/powerpc/Kconfig | 2 +-
1 file changed, 1
When creating a kprobe on function entry through tracefs, enable
arguments to be recorded to be specified using $argN syntax.
Signed-off-by: Naveen N Rao
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/include/asm/ptrace.h | 17 +
2 files changed, 18 insertions
Fixes: 7af82ff90a2b06 ("powerpc/ftrace: Ignore weak functions")
Signed-off-by: Naveen N Rao
---
arch/powerpc/include/asm/ftrace.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/ftrace.h
b/arch/powerpc/include/asm/ftrace.h
index 91c0
lts in two additional stores in the ftrace entry code, but
produces reliable backtraces. Note that this change now aligns with
other architectures (arm64, s390, x86).
Signed-off-by: Naveen N Rao
---
This applies atop the below RFC patchset:
http://lore.kernel.org/cover.1686151854.git.
[Cc linuxppc-dev]
Dominique Martinet wrote:
Alan Maguire wrote on Thu, Jun 15, 2023 at 03:31:49PM +0100:
However the problem I suspect is this:
51 .debug_info 0a488b55 026f8d20
2**0
CONTENTS, READONLY, DEBUGGING
[...]
The debug info
Dominique Martinet wrote:
Naveen N Rao wrote on Fri, Jun 16, 2023 at 04:28:53PM +0530:
> We're not stripping anything in vmlinuz for other archs -- the linker
> script already should be including only the bare minimum to decompress
> itself (+compressed useful bits), so I guess
good to me. Christophe
mentioned that this results in a slowdown with ftrace [de-]activation on
ppc32, but that isn't performance critical and we can address that
separately.
(*) http://lore.kernel.org/cover.1686151854.git.nav...@kernel.org
- Naveen
Naveen N Rao (17):
powerpc/ftrace
.ftrace.tramp section is not used for any purpose. This code was added
all the way back in the original commit introducing support for dynamic
ftrace on ppc64 modules. Remove it.
Signed-off-by: Naveen N Rao
---
arch/powerpc/include/asm/module.h | 4
1 file changed, 4 deletions(-)
diff
_pg.c.
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
Fixes: 7af82ff90a2b06 ("powerpc/ftrace: Ignore weak functions")
Signed-off-by: Naveen N Rao
---
arch/powerpc/include/asm/ftrace.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/ftrace.h
b/arch/powerpc/include/asm/ftrace.h
index 91c0
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
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
reasons apply for
ppc32 so we only patch in a 'mflr r0'.
Signed-off-by: Naveen N Rao
---
arch/powerpc/Kconfig | 14 +++---
arch/powerpc/Makefile | 5
arch/powerpc/include/asm/ftrace.h | 6 +++--
arch/power
lts in two additional stores in the ftrace entry code, but
produces reliable backtraces. Note that this change now aligns with
other architectures (arm64, s390, x86).
Signed-off-by: Naveen N Rao
---
arch/powerpc/kernel/trace/ftrace.c | 6 --
arch/powerpc/kernel/trace/ftrace_entry.S |
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
r the stub from 64 bytes to 32
bytes since the different stub variants are all less than 8
instructions.
To reduce use of #ifdef, a stub implementation is provided for
kernel_toc_address() and -SZ_2G is cast to 'long long' to prevent
errors on ppc32.
Signed-off-by: Naveen N Rao
---
: Naveen N Rao
---
arch/powerpc/kernel/trace/Makefile| 17 +++--
arch/powerpc/kernel/trace/ftrace_64_pg.S | 67 ---
.../trace/{ftrace_pg.c => ftrace_64_pg.c} | 0
.../{ftrace_low.S => ftrace_64_pg_entry.S}| 58 +++-
.../{ftrace_mpro
Split up ftrace_modify_code() into a few helpers for future use. Also
update error messages accordingly.
Signed-off-by: Naveen N Rao
---
arch/powerpc/kernel/trace/ftrace.c | 51 +-
1 file changed, 29 insertions(+), 22 deletions(-)
diff --git a/arch/powerpc/kernel
.
Stop re-purposing the linker-generated long branches for ftrace to
simplify the code. If there are good reasons to support ftrace on
kernels beyond 64MB, we can consider adding support by using
-fpatchable-function-entry.
Signed-off-by: Naveen N Rao
---
arch/powerpc/kernel/trace/ftra
.
Signed-off-by: Naveen N Rao
---
arch/powerpc/include/asm/ftrace.h | 6 +++
arch/powerpc/kernel/trace/ftrace.c | 71 ++
2 files changed, 77 insertions(+)
diff --git a/arch/powerpc/include/asm/ftrace.h
b/arch/powerpc/include/asm/ftrace.h
index 702aaf2efa966c
ftrace location before nop-ing it out.
Signed-off-by: Naveen N Rao
---
arch/powerpc/kernel/trace/ftrace.c | 220 +
1 file changed, 32 insertions(+), 188 deletions(-)
diff --git a/arch/powerpc/kernel/trace/ftrace.c
b/arch/powerpc/kernel/trace/ftrace.c
index 98bd099c428ee0
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 05153a1038fdff..6ea8b90246a540 100644
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
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
nablement, I think it might be better to disable it for now.
Acked-by: Naveen N Rao
- Naveen
Christophe Leroy wrote:
A lot of work is required in .S files in order to get them ready
for objtool checks.
For the time being, exclude them from the checks.
This is done with the script below:
#!/bin/sh
DIRS=`find arch/powerpc -name "*.S" -exec dirname {} \; | sort | uniq`
Christophe Leroy wrote:
Le 20/06/2023 à 08:04, Naveen N Rao a écrit :
Christophe Leroy wrote:
A lot of work is required in .S files in order to get them ready
for objtool checks.
For the time being, exclude them from the checks.
This is done with the script below:
#!/bin/sh
DIRS
try code, but
produces reliable backtraces.
Fixes: 153086644fd1 ("powerpc/ftrace: Add support for -mprofile-kernel ftrace
ABI")
Cc: sta...@vger.kernel.org
Signed-off-by: Naveen N Rao
---
Per Nick's suggestion, I'm posting a minimal fix separately to make this
easier to back
Hi Christophe,
Christophe Leroy wrote:
Le 19/06/2023 à 11:47, Naveen N Rao a écrit :
ftrace_low.S has just the _mcount stub and return_to_handler(). Merge
this back into ftrace_mprofile.S and ftrace_64_pg.S to keep all ftrace
code together, and to allow those to evolve independently
Christophe Leroy wrote:
Le 19/06/2023 à 11:47, Naveen N Rao a écrit :
GCC v13.1 updated support for -fpatchable-function-entry on ppc64le to
emit nops after the local entry point, rather than before it. This
allows us to use this in the kernel for ftrace purposes. A new script is
added under
Christophe Leroy wrote:
Le 19/06/2023 à 11:47, Naveen N Rao a écrit :
With ppc64 -mprofile-kernel and ppc32 -pg, profiling instructions to
call into ftrace are emitted right at function entry. The instruction
sequence used is minimal to reduce overhead. Crucially, a stackframe is
not created
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
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() with
301 - 400 of 1372 matches
Mail list logo