Skip to contentSkip to conversation

Trivial fixes for build failures

PATCH New SeongJae Park 1 participant 4 messages Mar 31, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Trivial fixes for build failures

This commit fixes trivial build failures of -mm queue, which is also available at
https://github.com/hnaz/linux-mm/tree/v5.17-mmots-2022-03-30-13-04.

SeongJae Park (3):
arch/arm64/Kconfig: Fix a typo
arch/arm64/kernel/irq: Include missed header file arch/arm64: Set HAVE_SHADOW_STACKTRACE depends on SHADOW_CALL_STACK

 arch/arm64/Kconfig             | 4 ++--
 arch/arm64/kernel/irq.c        | 1 +
 arch/arm64/kernel/stacktrace.c | 4 ++++
 3 files changed, 7 insertions(+), 2 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/3 arch/arm64/Kconfig: Fix a typo

There is a typo in 'linux-next-rejects.patch' of linux-mm patches, which causes build warning below:

arch/arm64/Kconfig:199:warning: ignoring unsupported character '+'

This commit fixes it.

Fixes d93aa6fbfc68 ("linux-next-rejects") of -mm
---
 arch/arm64/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/Kconfig +1 -1
index b53bb0bfbde8..d9325dd95eba 100644
@@ -196,7 +196,7 @@ config ARM64
 	select HAVE_PERF_USER_STACK_DUMP
 	select HAVE_PREEMPT_DYNAMIC_KEY
 	select HAVE_REGS_AND_STACK_ACCESS_API
-+	select HAVE_RUST
+	select HAVE_RUST
 	select HAVE_POSIX_CPU_TIMERS_TASK_WORK
 	select HAVE_FUNCTION_ARG_ACCESS_API
 	select MMU_GATHER_RCU_TABLE_FREE
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/3 arch/arm64/kernel/irq: Include missed header file

In reply to SeongJae Park

Commit da4561bd9c6b ("arm64, scs: save scs_sp values per-cpu when switching stacks") of -mm is moving declaration of irq_shadow_call_stack_ptr to scs.h of arm64 for !SHADOW_CALL_STACK, but didn't include it in irq.c of arm64. As a result, we show below build error when SHADOW_CALL_STACK is unset.

linux/arch/arm64/kernel/irq.c: In function 'init_irq_scs':
linux/arch/arm64/kernel/irq.c:44:11: error: 'irq_shadow_call_stack_ptr' undeclared (first use in this function)
44 | per_cpu(irq_shadow_call_stack_ptr, cpu) =
| ^~~~~~~~~~~~~~~~~~~~~~~~~

This commit fixes the build error by including the header file.

[1] https://lore.kernel.org/all/f75c58b17bfaa419f84286cd174e3a08f971b779.1648049113.git.andreyknvl@google.com/

Fixes da4561bd9c6b ("arm64, scs: save scs_sp values per-cpu when switching stacks") of -mm
---
 arch/arm64/kernel/irq.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/kernel/irq.c +1 -0
index 4199f900714a..9f7de9d5ee9b 100644
@@ -20,6 +20,7 @@
 #include <linux/scs.h>
 #include <linux/seq_file.h>
 #include <linux/vmalloc.h>
+#include <asm/scs.h>
 #include <asm/daifflags.h>
 #include <asm/vmap_stack.h>
 
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/3 arch/arm64: Set HAVE_SHADOW_STACKTRACE depends on SHADOW_CALL_STACK

In reply to SeongJae Park

The arm64 implementation of arch_stack_walk_shadow(), which is introduced by commit 8cdc580c5ca2 ("arm64: implement stack_trace_save_shadow") of -mm, uses task_scs(), which depends on SHADOW_CALL_STACK, but arm64 Kconfig unconditionally sets HAVE_SHADOW_STACKTRACE. As a result, below build error happens when SHADOW_CALL_STACK is unset.

/linux/arch/arm64/kernel/stacktrace.c: In function 'arch_stack_walk_shadow':
/linux/arch/arm64/kernel/stacktrace.c:289:13: error: implicit declaration of function 'task_scs'; did you mean 'task_lock'? [-Werror=implicit-function-declaration]
289 | scs_base = task_scs(current);
| ^~~~~~~~
| task_lock

This commit fixes the error by making HAVE_SHADOW_STACKTRACE depends on SHADOW_CALL_STACK and impelmentation of arch_stack_walk_shadow() depends on HAVE_SHADOW_STACKTRACE.

Fixes 8cdc580c5ca2 ("arm64: implement stack_trace_save_shadow") of -mm
---
 arch/arm64/Kconfig             | 2 +-
 arch/arm64/kernel/stacktrace.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
arch/arm64/Kconfig +1 -1
index d9325dd95eba..67358860d51e 100644
@@ -201,7 +201,7 @@ config ARM64
 	select HAVE_FUNCTION_ARG_ACCESS_API
 	select MMU_GATHER_RCU_TABLE_FREE
 	select HAVE_RSEQ
-	select HAVE_SHADOW_STACKTRACE
+	select HAVE_SHADOW_STACKTRACE if CONFIG_SHADOW_CALL_STACK
 	select HAVE_STACKPROTECTOR
 	select HAVE_SYSCALL_TRACEPOINTS
 	select HAVE_KPROBES
arch/arm64/kernel/stacktrace.c +4 -0
index 89daa710d91b..7e824aeb06f9 100644
@@ -213,6 +213,8 @@ noinline notrace void arch_stack_walk(stack_trace_consume_fn consume_entry,
 	walk_stackframe(task, &frame, consume_entry, cookie);
 }
 
+#ifdef CONFIG_HAVE_SHADOW_STACKTRACE
+
 static const struct {
 	unsigned long ** __percpu saved;
 	unsigned long ** __percpu base;
@@ -293,3 +295,5 @@ noinline notrace int arch_stack_walk_shadow(unsigned long *store,
 	preempt_enable();
 	return len;
 }
+
+#endif /* CONFIG_HAVE_SHADOW_STACKTRACE */
Signature · 1 line
2.17.1