All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] tracing: s390: Fix fprobes on s390
@ 2025-01-28 15:29 Masami Hiramatsu (Google)
  2025-01-28 15:29 ` [PATCH 1/2] s390: fgraph: Fix to remove ftrace_test_recursion_trylock() Masami Hiramatsu (Google)
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Masami Hiramatsu (Google) @ 2025-01-28 15:29 UTC (permalink / raw)
  To: Steven Rostedt, Heiko Carstens, Sven Schnelle
  Cc: Jiri Olsa, Masami Hiramatsu, Mark Rutland, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Andrii Nakryiko,
	linux-kernel, linux-trace-kernel, linux-s390, bpf

Hi,

Here are fprobe and kprobe-multi fix patches for s390 which maybe broken
when we introduced fprobes on fgraph series.

Thank you,

---

Masami Hiramatsu (Google) (2):
      s390: fgraph: Fix to remove ftrace_test_recursion_trylock()
      s390: tracing: Define ftrace_get_symaddr() for s390


 arch/s390/include/asm/ftrace.h |    1 +
 arch/s390/kernel/ftrace.c      |    5 -----
 2 files changed, 1 insertion(+), 5 deletions(-)

--
Masami Hiramatsu (Google) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] s390: fgraph: Fix to remove ftrace_test_recursion_trylock()
  2025-01-28 15:29 [PATCH 0/2] tracing: s390: Fix fprobes on s390 Masami Hiramatsu (Google)
@ 2025-01-28 15:29 ` Masami Hiramatsu (Google)
  2025-01-29  0:36   ` Ihor Solodrai
  2025-01-28 15:29 ` [PATCH 2/2] s390: tracing: Define ftrace_get_symaddr() for s390 Masami Hiramatsu (Google)
  2025-01-29  9:12 ` [PATCH 0/2] tracing: s390: Fix fprobes on s390 Heiko Carstens
  2 siblings, 1 reply; 5+ messages in thread
From: Masami Hiramatsu (Google) @ 2025-01-28 15:29 UTC (permalink / raw)
  To: Steven Rostedt, Heiko Carstens, Sven Schnelle
  Cc: Jiri Olsa, Masami Hiramatsu, Mark Rutland, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Andrii Nakryiko,
	linux-kernel, linux-trace-kernel, linux-s390, bpf

From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Fix to remove ftrace_test_recursion_trylock() from ftrace_graph_func()
because commit d576aec24df9 ("fgraph: Get ftrace recursion lock in
function_graph_enter") has been moved it to function_graph_enter_regs()
already.

Reported-by: Jiri Olsa <olsajiri@gmail.com>
Closes: https://lore.kernel.org/all/Z5O0shrdgeExZ2kF@krava/
Fixes: d576aec24df9 ("fgraph: Get ftrace recursion lock in function_graph_enter")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Tested-by: Jiri Olsa <jolsa@kernel.org>
---
 arch/s390/kernel/ftrace.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c
index c0b2c97efefb..63ba6306632e 100644
--- a/arch/s390/kernel/ftrace.c
+++ b/arch/s390/kernel/ftrace.c
@@ -266,18 +266,13 @@ void ftrace_graph_func(unsigned long ip, unsigned long parent_ip,
 		       struct ftrace_ops *op, struct ftrace_regs *fregs)
 {
 	unsigned long *parent = &arch_ftrace_regs(fregs)->regs.gprs[14];
-	int bit;
 
 	if (unlikely(ftrace_graph_is_dead()))
 		return;
 	if (unlikely(atomic_read(&current->tracing_graph_pause)))
 		return;
-	bit = ftrace_test_recursion_trylock(ip, *parent);
-	if (bit < 0)
-		return;
 	if (!function_graph_enter_regs(*parent, ip, 0, parent, fregs))
 		*parent = (unsigned long)&return_to_handler;
-	ftrace_test_recursion_unlock(bit);
 }
 
 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] s390: tracing: Define ftrace_get_symaddr() for s390
  2025-01-28 15:29 [PATCH 0/2] tracing: s390: Fix fprobes on s390 Masami Hiramatsu (Google)
  2025-01-28 15:29 ` [PATCH 1/2] s390: fgraph: Fix to remove ftrace_test_recursion_trylock() Masami Hiramatsu (Google)
@ 2025-01-28 15:29 ` Masami Hiramatsu (Google)
  2025-01-29  9:12 ` [PATCH 0/2] tracing: s390: Fix fprobes on s390 Heiko Carstens
  2 siblings, 0 replies; 5+ messages in thread
From: Masami Hiramatsu (Google) @ 2025-01-28 15:29 UTC (permalink / raw)
  To: Steven Rostedt, Heiko Carstens, Sven Schnelle
  Cc: Jiri Olsa, Masami Hiramatsu, Mark Rutland, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Andrii Nakryiko,
	linux-kernel, linux-trace-kernel, linux-s390, bpf

From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Add ftrace_get_symaddr() for s390, which returns the symbol address
from ftrace's 'ip' parameter.

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
 arch/s390/include/asm/ftrace.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/s390/include/asm/ftrace.h b/arch/s390/include/asm/ftrace.h
index a3b73a4f626e..185331e91f83 100644
--- a/arch/s390/include/asm/ftrace.h
+++ b/arch/s390/include/asm/ftrace.h
@@ -51,6 +51,7 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
 {
 	return addr;
 }
+#define ftrace_get_symaddr(fentry_ip) ((unsigned long)(fentry_ip))
 
 #include <linux/ftrace_regs.h>
 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] s390: fgraph: Fix to remove ftrace_test_recursion_trylock()
  2025-01-28 15:29 ` [PATCH 1/2] s390: fgraph: Fix to remove ftrace_test_recursion_trylock() Masami Hiramatsu (Google)
@ 2025-01-29  0:36   ` Ihor Solodrai
  0 siblings, 0 replies; 5+ messages in thread
From: Ihor Solodrai @ 2025-01-29  0:36 UTC (permalink / raw)
  To: Masami Hiramatsu (Google), Steven Rostedt, Heiko Carstens,
	Sven Schnelle
  Cc: Jiri Olsa, Masami Hiramatsu, Mark Rutland, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Andrii Nakryiko,
	linux-kernel, linux-trace-kernel, linux-s390, bpf

January 28, 2025 at 7:29 AM, "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:



> 
> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Fix to remove ftrace_test_recursion_trylock() from ftrace_graph_func()
> 
> because commit d576aec24df9 ("fgraph: Get ftrace recursion lock in
> 
> function_graph_enter") has been moved it to function_graph_enter_regs()
> 
> already.
> 
> Reported-by: Jiri Olsa <olsajiri@gmail.com>
> 
> Closes: https://lore.kernel.org/all/Z5O0shrdgeExZ2kF@krava/
> 
> Fixes: d576aec24df9 ("fgraph: Get ftrace recursion lock in function_graph_enter")
> 
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Tested-by: Jiri Olsa <jolsa@kernel.org>
> 
> [...]

Hi Masami,

Can confirm this patch fixes missed/kprobe_recursion BPF selftests on s390x:
https://github.com/kernel-patches/vmtest/actions/runs/13021621468/job/36324248903

Tested-by: Ihor Solodrai <ihor.solodrai@linux.dev>

Thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] tracing: s390: Fix fprobes on s390
  2025-01-28 15:29 [PATCH 0/2] tracing: s390: Fix fprobes on s390 Masami Hiramatsu (Google)
  2025-01-28 15:29 ` [PATCH 1/2] s390: fgraph: Fix to remove ftrace_test_recursion_trylock() Masami Hiramatsu (Google)
  2025-01-28 15:29 ` [PATCH 2/2] s390: tracing: Define ftrace_get_symaddr() for s390 Masami Hiramatsu (Google)
@ 2025-01-29  9:12 ` Heiko Carstens
  2 siblings, 0 replies; 5+ messages in thread
From: Heiko Carstens @ 2025-01-29  9:12 UTC (permalink / raw)
  To: Masami Hiramatsu (Google)
  Cc: Steven Rostedt, Sven Schnelle, Jiri Olsa, Mark Rutland,
	Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
	Andrii Nakryiko, linux-kernel, linux-trace-kernel, linux-s390,
	bpf

On Wed, Jan 29, 2025 at 12:29:25AM +0900, Masami Hiramatsu (Google) wrote:
> Hi,
> 
> Here are fprobe and kprobe-multi fix patches for s390 which maybe broken
> when we introduced fprobes on fgraph series.
> 
> Thank you,
> 
> ---
> 
> Masami Hiramatsu (Google) (2):
>       s390: fgraph: Fix to remove ftrace_test_recursion_trylock()
>       s390: tracing: Define ftrace_get_symaddr() for s390
> 
> 
>  arch/s390/include/asm/ftrace.h |    1 +
>  arch/s390/kernel/ftrace.c      |    5 -----
>  2 files changed, 1 insertion(+), 5 deletions(-)

For both patches:
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-29  9:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-28 15:29 [PATCH 0/2] tracing: s390: Fix fprobes on s390 Masami Hiramatsu (Google)
2025-01-28 15:29 ` [PATCH 1/2] s390: fgraph: Fix to remove ftrace_test_recursion_trylock() Masami Hiramatsu (Google)
2025-01-29  0:36   ` Ihor Solodrai
2025-01-28 15:29 ` [PATCH 2/2] s390: tracing: Define ftrace_get_symaddr() for s390 Masami Hiramatsu (Google)
2025-01-29  9:12 ` [PATCH 0/2] tracing: s390: Fix fprobes on s390 Heiko Carstens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.