diff mbox series

[v1] RISC-V: add a spin_shadow_stack declaration

Message ID 20230210185945.915806-1-conor@kernel.org (mailing list archive)
State Accepted
Commit eb9be8310c58c166f9fae3b71c0ad9d6741b4897
Delegated to: Palmer Dabbelt
Headers show
Series [v1] RISC-V: add a spin_shadow_stack declaration | expand

Checks

Context Check Description
conchuod/cover_letter success Single patches do not need cover letters
conchuod/tree_selection success Guessed tree name to be for-next
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 13 and now 13
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/build_rv64_clang_allmodconfig success Errors and warnings before: 2468 this patch: 2468
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 17339 this patch: 17338
conchuod/alphanumeric_selects success Out of order selects before the patch: 59 and now 59
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 2 this patch: 2
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
conchuod/source_inline success Was 0 now: 0
conchuod/build_rv64_nommu_k210_defconfig success Build OK
conchuod/verify_fixes success No Fixes tag
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Conor Dooley Feb. 10, 2023, 6:59 p.m. UTC
From: Conor Dooley <conor.dooley@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@microchip.com>
---
Applies on top of Guo Ren's generic entry series.
---
 arch/riscv/include/asm/thread_info.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Guo Ren Feb. 11, 2023, 5:04 a.m. UTC | #1
On Sat, Feb 11, 2023 at 2:59 AM Conor Dooley <conor@kernel.org> wrote:
>
> From: Conor Dooley <conor.dooley@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@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@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
>
Conor Dooley Feb. 11, 2023, 10:16 a.m. UTC | #2
On Sat, Feb 11, 2023 at 01:04:43PM +0800, Guo Ren wrote:
> On Sat, Feb 11, 2023 at 2:59 AM Conor Dooley <conor@kernel.org> wrote:
> >
> > From: Conor Dooley <conor.dooley@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@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:

I didn't mean I was "blaming" your series for it's introduction, I meant
that I created the patch using your series as a base to avoid any
potential for conflicts.

> Fixes: 7e1864332fbc ("riscv: fix race when vmap stack overflow")

Wasn't sure if this warranted one, but you're probably right to add it.

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

Thanks!
patchwork-bot+linux-riscv@kernel.org Feb. 22, 2023, 3 p.m. UTC | #3
Hello:

This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Fri, 10 Feb 2023 18:59:45 +0000 you wrote:
> From: Conor Dooley <conor.dooley@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
> 
> [...]

Here is the summary with links:
  - [v1] RISC-V: add a spin_shadow_stack declaration
    https://git.kernel.org/riscv/c/eb9be8310c58

You are awesome, thank you!
diff mbox series

Patch

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>