Skip to content

Commit 871e100

Browse files
committed
scs: Move DEFINE_SCS macro into core code
Defining static shadow call stacks is not architecture-specific, so move the DEFINE_SCS() macro into the core header file. Tested-by: Sami Tolvanen <[email protected]> Reviewed-by: Mark Rutland <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent aa7a65a commit 871e100

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arch/arm64/kernel/scs.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
#include <linux/percpu.h>
99
#include <linux/scs.h>
1010

11-
/* Allocate a static per-CPU shadow stack */
12-
#define DEFINE_SCS(name) \
13-
DEFINE_PER_CPU(unsigned long [SCS_SIZE/sizeof(long)], name) \
14-
1511
DEFINE_SCS(irq_shadow_call_stack);
1612

1713
#ifdef CONFIG_ARM_SDE_INTERFACE

include/linux/scs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
/* An illegal pointer value to mark the end of the shadow stack. */
2727
#define SCS_END_MAGIC (0x5f6UL + POISON_POINTER_DELTA)
2828

29+
/* Allocate a static per-CPU shadow stack */
30+
#define DEFINE_SCS(name) \
31+
DEFINE_PER_CPU(unsigned long [SCS_SIZE/sizeof(long)], name) \
32+
2933
#define task_scs(tsk) (task_thread_info(tsk)->scs_base)
3034
#define task_scs_sp(tsk) (task_thread_info(tsk)->scs_sp)
3135

0 commit comments

Comments
 (0)