tracing: Fix simple_ring_buffer symbol checking on parisc and sparc64
cover tracing: Fix simple_ring_buffer symbol checking on parisc and sparc64
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/[email protected]/
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
Signature · 1 line
2.55.0.1082.g2b9226bbc0-goog
PATCH 1/3 tracing: Fix empty symbol names in simple_ring_buffer undef check
Sparc64 emits empty symmbol names. Skips them when establishing the allowlist and when extracing undefined symbols.
--- kernel/trace/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/trace/Makefile +2 -2
@@ -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; \
Signature · 1 line
2.55.0.1082.g2b9226bbc0-goog
Re: [PATCH 1/3] tracing: Fix empty symbol names in simple_ring_buffer undef check
Quoted 7 lines · Vincent Donnefort
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 <[email protected]>Signed-off-by Vincent Donnefort <[email protected]>
Quoted 25 lines
--- kernel/trace/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/trace/Makefile +2
-2@@ -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; \Signature · 1 line
2.55.0.1082.g2b9226bbc0-goog
PATCH 2/3 tracing: Fix simple_ring_buffer undef check on parisc
In reply to Vincent Donnefortsimple_ring_buffer uses local_set() and cmpxchg() on unsigned long. Add them to undefsyms_base.c to extend the allowlist for the parisc architecture.
--- kernel/trace/undefsyms_base.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
kernel/trace/undefsyms_base.c +4 -1
@@ -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 ); }
Signature · 1 line
2.55.0.1082.g2b9226bbc0-goog
Re: [PATCH 2/3] tracing: Fix simple_ring_buffer undef check on parisc
Quoted 8 lines · Vincent Donnefort
simple_ring_bufferuseslocal_set()andcmpxchg()on unsigned long. Add them toundefsyms_base.cto extend the allowlist for the parisc architecture.Fixes 1211907ac0b5 ("tracing: Generate undef symbols allowlist for simple_ring_buffer")Reported-by Guenter Roeck <[email protected]>Signed-off-by Vincent Donnefort <[email protected]>
Quoted 34 lines
--- kernel/trace/undefsyms_base.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)kernel/trace/undefsyms_base.c +4
-1@@ -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 ); }Signature · 1 line
2.55.0.1082.g2b9226bbc0-goog
PATCH 3/3 tracing: Fix simple_ring_buffer undef check on sparc64
In reply to Vincent Donnefortsimple_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.
--- kernel/trace/Makefile | 1 + 1 file changed, 1 insertion(+)
kernel/trace/Makefile +1 -0
@@ -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 $<
Signature · 1 line
2.55.0.1082.g2b9226bbc0-goog
Re: [PATCH 3/3] tracing: Fix simple_ring_buffer undef check on sparc64
Quoted 8 lines · Vincent Donnefort
simple_ring_bufferrelies on headers that end up including <asm/thread_info.h>. On sparc64, this emits the undefined symbolcurrent_thread_info_reg. Allow this symbol.Fixes 1211907ac0b5 ("tracing: Generate undef symbols allowlist for simple_ring_buffer")Reported-by Guenter Roeck <[email protected]>Signed-off-by Vincent Donnefort <[email protected]>
Quoted 19 lines
--- kernel/trace/Makefile | 1 + 1 file changed, 1 insertion(+)kernel/trace/Makefile +1
-0@@ -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 $<Signature · 1 line
2.55.0.1082.g2b9226bbc0-goog