linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] tracing: Fix simple_ring_buffer symbol checking on parisc and sparc64
@ 2026-09-23  7:42 Vincent Donnefort
  2026-09-23  7:42 ` [PATCH 1/3] tracing: Fix empty symbol names in simple_ring_buffer undef check Vincent Donnefort
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Vincent Donnefort @ 2026-09-23  7:42 UTC (permalink / raw)
  To: rostedt, mhiramat, linux-trace-kernel
  Cc: mathieu.desnoyers, kernel-team, linux-kernel, Vincent Donnefort

Here's a series of fixes following Guenter report [1] of build
failures on parisc and sparc64 with allmodconfigs.

[1] https://lore.kernel.org/all/5574c9e6-9ed2-4ee6-a2b2-fb6ee81e83a1@roeck-us.net/

Vincent Donnefort (3):
  tracing: Fix empty symbol names in simple_ring_buffer undef check
  tracing: Fix simple_ring_buffer undef check on parisc
  tracing: Fix simple_ring_buffer undef check on sparc64

 kernel/trace/Makefile         | 5 +++--
 kernel/trace/undefsyms_base.c | 5 ++++-
 2 files changed, 7 insertions(+), 3 deletions(-)


base-commit: 93f51579e7df248780214094418f205253383cc5
-- 
2.55.0.1082.g2b9226bbc0-goog


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

* [PATCH 1/3] tracing: Fix empty symbol names in simple_ring_buffer undef check
  2026-09-23  7:42 [PATCH 0/3] tracing: Fix simple_ring_buffer symbol checking on parisc and sparc64 Vincent Donnefort
@ 2026-09-23  7:42 ` Vincent Donnefort
  2026-09-25  2:31   ` Guenter Roeck
  2026-09-23  7:42 ` [PATCH 2/3] tracing: Fix simple_ring_buffer undef check on parisc Vincent Donnefort
  2026-09-23  7:42 ` [PATCH 3/3] tracing: Fix simple_ring_buffer undef check on sparc64 Vincent Donnefort
  2 siblings, 1 reply; 7+ messages in thread
From: Vincent Donnefort @ 2026-09-23  7:42 UTC (permalink / raw)
  To: rostedt, mhiramat, linux-trace-kernel
  Cc: mathieu.desnoyers, kernel-team, linux-kernel, Vincent Donnefort,
	Guenter Roeck

Sparc64 emits empty symmbol names. Skips them when establishing the
allowlist and when extracing undefined symbols.

Fixes: 1211907ac0b5 ("tracing: Generate undef symbols allowlist for simple_ring_buffer")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/all/5574c9e6-9ed2-4ee6-a2b2-fb6ee81e83a1@roeck-us.net/
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
---
 kernel/trace/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index f934ff586bd4..0e1846f7dda3 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -146,11 +146,11 @@ KASAN_SANITIZE_undefsyms_base.o := y
 
 UNDEFINED_ALLOWLIST = __asan __gcov __kasan __kcsan __hwasan __sancov __sanitizer __tsan __ubsan __msan \
 		      __aeabi_unwind_cpp __s390_indirect_jump __x86_indirect_thunk simple_ring_buffer \
-		      $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '{print $$2}')
+		      $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '$$2 {print $$2}')
 
 quiet_cmd_check_undefined = NM      $<
       cmd_check_undefined = \
-          undefsyms=$$($(NM) -u $< | grep -v $(addprefix -e , $(UNDEFINED_ALLOWLIST)) || true); \
+          undefsyms=$$($(NM) -u $< | awk '$$2 {print $$2}' | grep -v $(addprefix -e , $(UNDEFINED_ALLOWLIST)) || true); \
           if [ -n "$$undefsyms" ]; then \
               echo "Unexpected symbols in $<:" >&2; \
               echo "$$undefsyms" >&2; \
-- 
2.55.0.1082.g2b9226bbc0-goog


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

* [PATCH 2/3] tracing: Fix simple_ring_buffer undef check on parisc
  2026-09-23  7:42 [PATCH 0/3] tracing: Fix simple_ring_buffer symbol checking on parisc and sparc64 Vincent Donnefort
  2026-09-23  7:42 ` [PATCH 1/3] tracing: Fix empty symbol names in simple_ring_buffer undef check Vincent Donnefort
@ 2026-09-23  7:42 ` Vincent Donnefort
  2026-09-25  2:31   ` Guenter Roeck
  2026-09-23  7:42 ` [PATCH 3/3] tracing: Fix simple_ring_buffer undef check on sparc64 Vincent Donnefort
  2 siblings, 1 reply; 7+ messages in thread
From: Vincent Donnefort @ 2026-09-23  7:42 UTC (permalink / raw)
  To: rostedt, mhiramat, linux-trace-kernel
  Cc: mathieu.desnoyers, kernel-team, linux-kernel, Vincent Donnefort,
	Guenter Roeck

simple_ring_buffer uses local_set() and cmpxchg() on unsigned long. Add
them to undefsyms_base.c to extend the allowlist for the parisc
architecture.

Fixes: 1211907ac0b5 ("tracing: Generate undef symbols allowlist for simple_ring_buffer")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/all/5574c9e6-9ed2-4ee6-a2b2-fb6ee81e83a1@roeck-us.net/
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
---
 kernel/trace/undefsyms_base.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/undefsyms_base.c b/kernel/trace/undefsyms_base.c
index e65baf58e6ff..37310baf706b 100644
--- a/kernel/trace/undefsyms_base.c
+++ b/kernel/trace/undefsyms_base.c
@@ -9,6 +9,7 @@
 
 #include <linux/atomic.h>
 #include <linux/string.h>
+#include <asm/local.h>
 #include <asm/page.h>
 
 void undefsyms_base(void *p, int n);
@@ -18,11 +19,13 @@ static char page[PAGE_SIZE] __aligned(PAGE_SIZE);
 void undefsyms_base(void *p, int n)
 {
 	char buffer[256] = { 0 };
-
 	u32 u = 0;
+
 	memset((char * volatile)page, 8, PAGE_SIZE);
 	memset((char * volatile)buffer, 8, sizeof(buffer));
 	memcpy((void * volatile)p, buffer, sizeof(buffer));
 	cmpxchg((u32 * volatile)&u, 0, 8);
+	cmpxchg((unsigned long *)p, 0, 8);
+	local_set((local_t *)p, 8);
 	WARN_ON(n == 0xdeadbeef);
 }
-- 
2.55.0.1082.g2b9226bbc0-goog


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

* [PATCH 3/3] tracing: Fix simple_ring_buffer undef check on sparc64
  2026-09-23  7:42 [PATCH 0/3] tracing: Fix simple_ring_buffer symbol checking on parisc and sparc64 Vincent Donnefort
  2026-09-23  7:42 ` [PATCH 1/3] tracing: Fix empty symbol names in simple_ring_buffer undef check Vincent Donnefort
  2026-09-23  7:42 ` [PATCH 2/3] tracing: Fix simple_ring_buffer undef check on parisc Vincent Donnefort
@ 2026-09-23  7:42 ` Vincent Donnefort
  2026-09-25  2:31   ` Guenter Roeck
  2 siblings, 1 reply; 7+ messages in thread
From: Vincent Donnefort @ 2026-09-23  7:42 UTC (permalink / raw)
  To: rostedt, mhiramat, linux-trace-kernel
  Cc: mathieu.desnoyers, kernel-team, linux-kernel, Vincent Donnefort,
	Guenter Roeck

simple_ring_buffer relies on headers that end up including
<asm/thread_info.h>. On sparc64, this emits the undefined symbol
current_thread_info_reg. Allow this symbol.

Fixes: 1211907ac0b5 ("tracing: Generate undef symbols allowlist for simple_ring_buffer")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/all/5574c9e6-9ed2-4ee6-a2b2-fb6ee81e83a1@roeck-us.net/
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
---
 kernel/trace/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index 0e1846f7dda3..3860bc53a4be 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -146,6 +146,7 @@ KASAN_SANITIZE_undefsyms_base.o := y
 
 UNDEFINED_ALLOWLIST = __asan __gcov __kasan __kcsan __hwasan __sancov __sanitizer __tsan __ubsan __msan \
 		      __aeabi_unwind_cpp __s390_indirect_jump __x86_indirect_thunk simple_ring_buffer \
+		      current_thread_info_reg \
 		      $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '$$2 {print $$2}')
 
 quiet_cmd_check_undefined = NM      $<
-- 
2.55.0.1082.g2b9226bbc0-goog


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

* Re: [PATCH 1/3] tracing: Fix empty symbol names in simple_ring_buffer undef check
  2026-09-23  7:42 ` [PATCH 1/3] tracing: Fix empty symbol names in simple_ring_buffer undef check Vincent Donnefort
@ 2026-09-25  2:31   ` Guenter Roeck
  0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2026-09-25  2:31 UTC (permalink / raw)
  To: Vincent Donnefort
  Cc: rostedt, mhiramat, linux-trace-kernel, mathieu.desnoyers,
	kernel-team, linux-kernel

On Wed, Sep 23, 2026 at 08:42:11AM +0100, Vincent Donnefort wrote:
> Sparc64 emits empty symmbol names. Skips them when establishing the
> allowlist and when extracing undefined symbols.
> 
> Fixes: 1211907ac0b5 ("tracing: Generate undef symbols allowlist for simple_ring_buffer")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Closes: https://lore.kernel.org/all/5574c9e6-9ed2-4ee6-a2b2-fb6ee81e83a1@roeck-us.net/
> Signed-off-by: Vincent Donnefort <vdonnefort@google.com>

Tested-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  kernel/trace/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
> index f934ff586bd4..0e1846f7dda3 100644
> --- a/kernel/trace/Makefile
> +++ b/kernel/trace/Makefile
> @@ -146,11 +146,11 @@ KASAN_SANITIZE_undefsyms_base.o := y
>  
>  UNDEFINED_ALLOWLIST = __asan __gcov __kasan __kcsan __hwasan __sancov __sanitizer __tsan __ubsan __msan \
>  		      __aeabi_unwind_cpp __s390_indirect_jump __x86_indirect_thunk simple_ring_buffer \
> -		      $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '{print $$2}')
> +		      $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '$$2 {print $$2}')
>  
>  quiet_cmd_check_undefined = NM      $<
>        cmd_check_undefined = \
> -          undefsyms=$$($(NM) -u $< | grep -v $(addprefix -e , $(UNDEFINED_ALLOWLIST)) || true); \
> +          undefsyms=$$($(NM) -u $< | awk '$$2 {print $$2}' | grep -v $(addprefix -e , $(UNDEFINED_ALLOWLIST)) || true); \
>            if [ -n "$$undefsyms" ]; then \
>                echo "Unexpected symbols in $<:" >&2; \
>                echo "$$undefsyms" >&2; \
> -- 
> 2.55.0.1082.g2b9226bbc0-goog
> 

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

* Re: [PATCH 2/3] tracing: Fix simple_ring_buffer undef check on parisc
  2026-09-23  7:42 ` [PATCH 2/3] tracing: Fix simple_ring_buffer undef check on parisc Vincent Donnefort
@ 2026-09-25  2:31   ` Guenter Roeck
  0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2026-09-25  2:31 UTC (permalink / raw)
  To: Vincent Donnefort
  Cc: rostedt, mhiramat, linux-trace-kernel, mathieu.desnoyers,
	kernel-team, linux-kernel

On Wed, Sep 23, 2026 at 08:42:12AM +0100, Vincent Donnefort wrote:
> simple_ring_buffer uses local_set() and cmpxchg() on unsigned long. Add
> them to undefsyms_base.c to extend the allowlist for the parisc
> architecture.
> 
> Fixes: 1211907ac0b5 ("tracing: Generate undef symbols allowlist for simple_ring_buffer")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Closes: https://lore.kernel.org/all/5574c9e6-9ed2-4ee6-a2b2-fb6ee81e83a1@roeck-us.net/
> Signed-off-by: Vincent Donnefort <vdonnefort@google.com>

Tested-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  kernel/trace/undefsyms_base.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/undefsyms_base.c b/kernel/trace/undefsyms_base.c
> index e65baf58e6ff..37310baf706b 100644
> --- a/kernel/trace/undefsyms_base.c
> +++ b/kernel/trace/undefsyms_base.c
> @@ -9,6 +9,7 @@
>  
>  #include <linux/atomic.h>
>  #include <linux/string.h>
> +#include <asm/local.h>
>  #include <asm/page.h>
>  
>  void undefsyms_base(void *p, int n);
> @@ -18,11 +19,13 @@ static char page[PAGE_SIZE] __aligned(PAGE_SIZE);
>  void undefsyms_base(void *p, int n)
>  {
>  	char buffer[256] = { 0 };
> -
>  	u32 u = 0;
> +
>  	memset((char * volatile)page, 8, PAGE_SIZE);
>  	memset((char * volatile)buffer, 8, sizeof(buffer));
>  	memcpy((void * volatile)p, buffer, sizeof(buffer));
>  	cmpxchg((u32 * volatile)&u, 0, 8);
> +	cmpxchg((unsigned long *)p, 0, 8);
> +	local_set((local_t *)p, 8);
>  	WARN_ON(n == 0xdeadbeef);
>  }
> -- 
> 2.55.0.1082.g2b9226bbc0-goog
> 

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

* Re: [PATCH 3/3] tracing: Fix simple_ring_buffer undef check on sparc64
  2026-09-23  7:42 ` [PATCH 3/3] tracing: Fix simple_ring_buffer undef check on sparc64 Vincent Donnefort
@ 2026-09-25  2:31   ` Guenter Roeck
  0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2026-09-25  2:31 UTC (permalink / raw)
  To: Vincent Donnefort
  Cc: rostedt, mhiramat, linux-trace-kernel, mathieu.desnoyers,
	kernel-team, linux-kernel

On Wed, Sep 23, 2026 at 08:42:13AM +0100, Vincent Donnefort wrote:
> simple_ring_buffer relies on headers that end up including
> <asm/thread_info.h>. On sparc64, this emits the undefined symbol
> current_thread_info_reg. Allow this symbol.
> 
> Fixes: 1211907ac0b5 ("tracing: Generate undef symbols allowlist for simple_ring_buffer")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Closes: https://lore.kernel.org/all/5574c9e6-9ed2-4ee6-a2b2-fb6ee81e83a1@roeck-us.net/
> Signed-off-by: Vincent Donnefort <vdonnefort@google.com>

Tested-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  kernel/trace/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
> index 0e1846f7dda3..3860bc53a4be 100644
> --- a/kernel/trace/Makefile
> +++ b/kernel/trace/Makefile
> @@ -146,6 +146,7 @@ KASAN_SANITIZE_undefsyms_base.o := y
>  
>  UNDEFINED_ALLOWLIST = __asan __gcov __kasan __kcsan __hwasan __sancov __sanitizer __tsan __ubsan __msan \
>  		      __aeabi_unwind_cpp __s390_indirect_jump __x86_indirect_thunk simple_ring_buffer \
> +		      current_thread_info_reg \
>  		      $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '$$2 {print $$2}')
>  
>  quiet_cmd_check_undefined = NM      $<
> -- 
> 2.55.0.1082.g2b9226bbc0-goog
> 

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

end of thread, other threads:[~2026-09-25  2:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-23  7:42 [PATCH 0/3] tracing: Fix simple_ring_buffer symbol checking on parisc and sparc64 Vincent Donnefort
2026-09-23  7:42 ` [PATCH 1/3] tracing: Fix empty symbol names in simple_ring_buffer undef check Vincent Donnefort
2026-09-25  2:31   ` Guenter Roeck
2026-09-23  7:42 ` [PATCH 2/3] tracing: Fix simple_ring_buffer undef check on parisc Vincent Donnefort
2026-09-25  2:31   ` Guenter Roeck
2026-09-23  7:42 ` [PATCH 3/3] tracing: Fix simple_ring_buffer undef check on sparc64 Vincent Donnefort
2026-09-25  2:31   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).