* [PATCH] riscv: declare overflow_stack as exported from traps.c
@ 2023-11-23 13:42 Ben Dooks
2023-11-23 13:51 ` Conor Dooley
2024-02-08 1:30 ` patchwork-bot+linux-riscv
0 siblings, 2 replies; 4+ messages in thread
From: Ben Dooks @ 2023-11-23 13:42 UTC (permalink / raw)
To: linux-riscv; +Cc: linux-kernel, paul.walmsley, palmer, aou, Ben Dooks
The percpu area overflow_stacks is exported from arch/riscv/kernel/traps.c
for use in the entry code, but is not declared anywhere. Add the relevant
declaration to arch/riscv/include/asm/stacktrace.h to silence the following
sparse warning:
arch/riscv/kernel/traps.c:395:1: warning: symbol '__pcpu_scope_overflow_stack' was not declared. Should it be static?
We don't add the stackinfo_get_overflow() call as for some of the other
architectures as this doesn't seem to be used yet, so just silence the
warning.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
arch/riscv/include/asm/stacktrace.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/riscv/include/asm/stacktrace.h b/arch/riscv/include/asm/stacktrace.h
index f7e8ef2418b9..b1495a7e06ce 100644
--- a/arch/riscv/include/asm/stacktrace.h
+++ b/arch/riscv/include/asm/stacktrace.h
@@ -21,4 +21,9 @@ static inline bool on_thread_stack(void)
return !(((unsigned long)(current->stack) ^ current_stack_pointer) & ~(THREAD_SIZE - 1));
}
+
+#ifdef CONFIG_VMAP_STACK
+DECLARE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)], overflow_stack);
+#endif /* CONFIG_VMAP_STACK */
+
#endif /* _ASM_RISCV_STACKTRACE_H */
--
2.37.2.352.g3c44437643
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] riscv: declare overflow_stack as exported from traps.c
2023-11-23 13:42 [PATCH] riscv: declare overflow_stack as exported from traps.c Ben Dooks
@ 2023-11-23 13:51 ` Conor Dooley
2023-11-23 13:54 ` Ben Dooks
2024-02-08 1:30 ` patchwork-bot+linux-riscv
1 sibling, 1 reply; 4+ messages in thread
From: Conor Dooley @ 2023-11-23 13:51 UTC (permalink / raw)
To: Ben Dooks; +Cc: linux-riscv, linux-kernel, paul.walmsley, palmer, aou
[-- Attachment #1: Type: text/plain, Size: 1574 bytes --]
On Thu, Nov 23, 2023 at 01:42:14PM +0000, Ben Dooks wrote:
> The percpu area overflow_stacks is exported from arch/riscv/kernel/traps.c
> for use in the entry code, but is not declared anywhere. Add the relevant
> declaration to arch/riscv/include/asm/stacktrace.h to silence the following
> sparse warning:
>
> arch/riscv/kernel/traps.c:395:1: warning: symbol '__pcpu_scope_overflow_stack' was not declared. Should it be static?
>
> We don't add the stackinfo_get_overflow() call as for some of the other
> architectures as this doesn't seem to be used yet, so just silence the
> warning.
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
I suppose this should also be
Fixes: be97d0db5f44 ("riscv: VMAP_STACK overflow detection thread-safe")
Cheers,
Conor.
> ---
> arch/riscv/include/asm/stacktrace.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/riscv/include/asm/stacktrace.h b/arch/riscv/include/asm/stacktrace.h
> index f7e8ef2418b9..b1495a7e06ce 100644
> --- a/arch/riscv/include/asm/stacktrace.h
> +++ b/arch/riscv/include/asm/stacktrace.h
> @@ -21,4 +21,9 @@ static inline bool on_thread_stack(void)
> return !(((unsigned long)(current->stack) ^ current_stack_pointer) & ~(THREAD_SIZE - 1));
> }
>
> +
> +#ifdef CONFIG_VMAP_STACK
> +DECLARE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)], overflow_stack);
> +#endif /* CONFIG_VMAP_STACK */
> +
> #endif /* _ASM_RISCV_STACKTRACE_H */
> --
> 2.37.2.352.g3c44437643
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] riscv: declare overflow_stack as exported from traps.c
2023-11-23 13:51 ` Conor Dooley
@ 2023-11-23 13:54 ` Ben Dooks
0 siblings, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2023-11-23 13:54 UTC (permalink / raw)
To: Conor Dooley; +Cc: linux-riscv, linux-kernel, paul.walmsley, palmer, aou
On 23/11/2023 13:51, Conor Dooley wrote:
> On Thu, Nov 23, 2023 at 01:42:14PM +0000, Ben Dooks wrote:
>> The percpu area overflow_stacks is exported from arch/riscv/kernel/traps.c
>> for use in the entry code, but is not declared anywhere. Add the relevant
>> declaration to arch/riscv/include/asm/stacktrace.h to silence the following
>> sparse warning:
>>
>> arch/riscv/kernel/traps.c:395:1: warning: symbol '__pcpu_scope_overflow_stack' was not declared. Should it be static?
>>
>> We don't add the stackinfo_get_overflow() call as for some of the other
>> architectures as this doesn't seem to be used yet, so just silence the
>> warning.
>>
>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> I suppose this should also be
> Fixes: be97d0db5f44 ("riscv: VMAP_STACK overflow detection thread-safe")
Thanks, never sure if the Fixes: should be applied when it is simply a
warning fix and there's nothing actually being currently flagging an
issue with anything else using it (currently just the assembly)
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
https://www.codethink.co.uk/privacy.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] riscv: declare overflow_stack as exported from traps.c
2023-11-23 13:42 [PATCH] riscv: declare overflow_stack as exported from traps.c Ben Dooks
2023-11-23 13:51 ` Conor Dooley
@ 2024-02-08 1:30 ` patchwork-bot+linux-riscv
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+linux-riscv @ 2024-02-08 1:30 UTC (permalink / raw)
To: Ben Dooks; +Cc: linux-riscv, linux-kernel, paul.walmsley, palmer, aou
Hello:
This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:
On Thu, 23 Nov 2023 13:42:14 +0000 you wrote:
> The percpu area overflow_stacks is exported from arch/riscv/kernel/traps.c
> for use in the entry code, but is not declared anywhere. Add the relevant
> declaration to arch/riscv/include/asm/stacktrace.h to silence the following
> sparse warning:
>
> arch/riscv/kernel/traps.c:395:1: warning: symbol '__pcpu_scope_overflow_stack' was not declared. Should it be static?
>
> [...]
Here is the summary with links:
- riscv: declare overflow_stack as exported from traps.c
https://git.kernel.org/riscv/c/2cf963787529
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-08 1:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-23 13:42 [PATCH] riscv: declare overflow_stack as exported from traps.c Ben Dooks
2023-11-23 13:51 ` Conor Dooley
2023-11-23 13:54 ` Ben Dooks
2024-02-08 1:30 ` patchwork-bot+linux-riscv
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®