Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

stacktrace: Move documentation for arch_stack_walk_reliable() to header

Currently arch_stack_walk_reliable() is documented with an identical
comment in both x86 and S/390 implementations which is a bit redundant.
Move this to the header and convert to kerneldoc while we're at it.

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lkml.kernel.org/r/20210309194125.652-1-broonie@kernel.org

authored by

Mark Brown and committed by
Borislav Petkov
b18adee4 09141ec0

+19 -12
-6
arch/s390/kernel/stacktrace.c
··· 24 24 } 25 25 } 26 26 27 - /* 28 - * This function returns an error if it detects any unreliable features of the 29 - * stack. Otherwise it guarantees that the stack trace is reliable. 30 - * 31 - * If the task is not 'current', the caller *must* ensure the task is inactive. 32 - */ 33 27 int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry, 34 28 void *cookie, struct task_struct *task) 35 29 {
-6
arch/x86/kernel/stacktrace.c
··· 29 29 } 30 30 } 31 31 32 - /* 33 - * This function returns an error if it detects any unreliable features of the 34 - * stack. Otherwise it guarantees that the stack trace is reliable. 35 - * 36 - * If the task is not 'current', the caller *must* ensure the task is inactive. 37 - */ 38 32 int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry, 39 33 void *cookie, struct task_struct *task) 40 34 {
+19
include/linux/stacktrace.h
··· 52 52 */ 53 53 void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie, 54 54 struct task_struct *task, struct pt_regs *regs); 55 + 56 + /** 57 + * arch_stack_walk_reliable - Architecture specific function to walk the 58 + * stack reliably 59 + * 60 + * @consume_entry: Callback which is invoked by the architecture code for 61 + * each entry. 62 + * @cookie: Caller supplied pointer which is handed back to 63 + * @consume_entry 64 + * @task: Pointer to a task struct, can be NULL 65 + * 66 + * This function returns an error if it detects any unreliable 67 + * features of the stack. Otherwise it guarantees that the stack 68 + * trace is reliable. 69 + * 70 + * If the task is not 'current', the caller *must* ensure the task is 71 + * inactive and its stack is pinned. 72 + */ 55 73 int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry, void *cookie, 56 74 struct task_struct *task); 75 + 57 76 void arch_stack_walk_user(stack_trace_consume_fn consume_entry, void *cookie, 58 77 const struct pt_regs *regs); 59 78