mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 16:25:34 +00:00

This change adds per-CPU shadow call stacks for the SDEI handler. Similarly to how the kernel stacks are handled, we add separate shadow stacks for normal and critical events. Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Reviewed-by: James Morse <james.morse@arm.com> Tested-by: James Morse <james.morse@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
20 lines
462 B
C
20 lines
462 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* Shadow Call Stack support.
|
|
*
|
|
* Copyright (C) 2019 Google LLC
|
|
*/
|
|
|
|
#include <linux/percpu.h>
|
|
#include <asm/scs.h>
|
|
|
|
/* Allocate a static per-CPU shadow stack */
|
|
#define DEFINE_SCS(name) \
|
|
DEFINE_PER_CPU(unsigned long [SCS_SIZE/sizeof(long)], name) \
|
|
|
|
DEFINE_SCS(irq_shadow_call_stack);
|
|
|
|
#ifdef CONFIG_ARM_SDE_INTERFACE
|
|
DEFINE_SCS(sdei_shadow_call_stack_normal);
|
|
DEFINE_SCS(sdei_shadow_call_stack_critical);
|
|
#endif
|