diff options
author | Kalesh Singh <kaleshsingh@google.com> | 2022-07-26 00:37:35 -0700 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2022-07-26 10:48:09 +0100 |
commit | 15a59f19a015185bff90a68f601caec151dea4b4 (patch) | |
tree | 47b3fb4636182b9573dedd063d5db2ed6907998f /arch/arm64/include/asm/stacktrace/common.h | |
parent | arm64: stacktrace: Add shared header for common stack unwinding code (diff) | |
download | linux-dev-15a59f19a015185bff90a68f601caec151dea4b4.tar.xz linux-dev-15a59f19a015185bff90a68f601caec151dea4b4.zip |
arm64: stacktrace: Factor out on_accessible_stack_common()
Move common on_accessible_stack checks to stacktrace/common.h. This is
used in the implementation of the nVHE hypervisor unwinder later in
this series.
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Tested-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220726073750.3219117-3-kaleshsingh@google.com
Diffstat (limited to 'arch/arm64/include/asm/stacktrace/common.h')
-rw-r--r-- | arch/arm64/include/asm/stacktrace/common.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/stacktrace/common.h b/arch/arm64/include/asm/stacktrace/common.h index 64ae4f6b06fe..f58b786460d3 100644 --- a/arch/arm64/include/asm/stacktrace/common.h +++ b/arch/arm64/include/asm/stacktrace/common.h @@ -62,6 +62,9 @@ struct unwind_state { struct task_struct *task; }; +static inline bool on_overflow_stack(unsigned long sp, unsigned long size, + struct stack_info *info); + static inline bool on_stack(unsigned long sp, unsigned long size, unsigned long low, unsigned long high, enum stack_type type, struct stack_info *info) @@ -80,6 +83,21 @@ static inline bool on_stack(unsigned long sp, unsigned long size, return true; } +static inline bool on_accessible_stack_common(const struct task_struct *tsk, + unsigned long sp, + unsigned long size, + struct stack_info *info) +{ + if (info) + info->type = STACK_TYPE_UNKNOWN; + + /* + * Both the kernel and nvhe hypervisor make use of + * an overflow_stack + */ + return on_overflow_stack(sp, size, info); +} + static inline void unwind_init_common(struct unwind_state *state, struct task_struct *task) { |