Skip to contentSkip to conversation

RISC-V: add a spin_shadow_stack declaration

PATCH Applied Conor Dooley 3 participants 4 messages Feb 10, 2023 – Feb 22, 2023 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RISC-V: add a spin_shadow_stack declaration

From: Conor Dooley <[email protected]>

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

---
Applies on top of Guo Ren's generic entry series.

---
 arch/riscv/include/asm/thread_info.h | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/include/asm/thread_info.h +1 -0
index 7de4fb96f0b5..e0d202134b44 100644
@@ -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>
Signature · 7 lines
2.39.1


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Conor Dooley

From: Conor Dooley <[email protected]>

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?

Quoted 8 lines

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

---
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")
Quoted 19 lines
---
 arch/riscv/include/asm/thread_info.h | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/include/asm/thread_info.h +1 -1
index 7de4fb96f0b5..e0d202134b44 100644
@@ -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

Signature · 7 lines
Best Regards
 Guo Ren

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#2 lore raw
Quoted 13 lines · Guo Ren
Quoted 12 lines · Conor Dooley

From: Conor Dooley <[email protected]>

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

Quoted 4 lines
Quoted 3 lines

---
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.

Quoted 1 line
Fixes 7e1864332fbc ("riscv: fix race when vmap stack overflow")

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

Quoted 1 line

Thanks!

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#3 lore raw
In reply to Conor Dooley
This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Hello:

This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Quoted 6 lines · On Fri, 10 Feb 2023 18:59:45 +0000 you wrote:

From: Conor Dooley <[email protected]>

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?

Quoted 6 lines

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!

Signature · 9 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv