[PATCH v1] RISC-V: add a spin_shadow_stack declaration

Guo Ren guoren at kernel.org
Fri Feb 10 21:04:43 PST 2023


On Sat, Feb 11, 2023 at 2:59 AM Conor Dooley <conor at kernel.org> wrote:
>
> From: Conor Dooley <conor.dooley at microchip.com>
>
> The patchwork automation reported a sparse complaint that
> spin_shadow_stack was not declared and should be static:
> ../arch/riscv/kernel/traps.c:335:15: warning: symbol 'spin_shadow_stack' was not declared. Should it be static?
>
> However, this is used in entry.S and therefore shouldn't be static.
> The same applies to the shadow_stack that this pseudo spinlock is
> trying to protect, so do like its charge and add a declaration to
> thread_info.h
>
> Signed-off-by: Conor Dooley <conor.dooley at microchip.com>
> ---
> Applies on top of Guo Ren's generic entry series.
It's needn't on top of my generic entry series. It's the separate patch for:
Fixes: 7e1864332fbc ("riscv: fix race when vmap stack overflow")

Reviewed-by: Guo Ren <guoren at kernel.org>

> ---
>  arch/riscv/include/asm/thread_info.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h
> index 7de4fb96f0b5..e0d202134b44 100644
> --- a/arch/riscv/include/asm/thread_info.h
> +++ b/arch/riscv/include/asm/thread_info.h
> @@ -43,6 +43,7 @@
>  #ifndef __ASSEMBLY__
>
>  extern long shadow_stack[SHADOW_OVERFLOW_STACK_SIZE / sizeof(long)];
> +extern unsigned long spin_shadow_stack;
>
>  #include <asm/processor.h>
>  #include <asm/csr.h>
> --
> 2.39.1
>


-- 
Best Regards
 Guo Ren



More information about the linux-riscv mailing list