diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-11-21 17:22:21 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-11-21 17:22:21 -0800 |
| commit | 4843f6873f7c4835e62f2c73ba0fd538e57a2f22 (patch) | |
| tree | ee620501a1ffbad9a83141e3a70154e1fe641040 /arch/alpha/kernel/stacktrace.c | |
| download | linux-master.tar.gz linux-master.zip | |
Merge tag 'sysctl-7.04-fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctlgraftedHEADmaster
Pull sysctl fix from Joel Granados:
"Fix sysctl jiffy / milliseconds conversion:
- Writing a previously read value "X" shall keep the same "X" value
- Remove truncation that was causing incorrect saturation of valid
timeouts"
* tag 'sysctl-7.04-fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl:
sysctl: Do jiffy / ms conversion in ulong space
Diffstat (limited to 'arch/alpha/kernel/stacktrace.c')
| -rw-r--r-- | arch/alpha/kernel/stacktrace.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/arch/alpha/kernel/stacktrace.c b/arch/alpha/kernel/stacktrace.c new file mode 100644 index 000000000..74d95f591 --- /dev/null +++ b/arch/alpha/kernel/stacktrace.c @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-2.0 +#include <linux/sched.h> +#include <linux/sched/task_stack.h> +#include <linux/stacktrace.h> +#include <linux/kallsyms.h> + +#include <asm/thread_info.h> +#include <asm/ptrace.h> + +static __always_inline unsigned long alpha_get_current_ksp(void) +{ + unsigned long sp; + + asm volatile("mov $30, %0" : "=r"(sp)); + return sp; +} + +static void alpha_scan_kernel_stack(unsigned long ksp, + stack_trace_consume_fn consume_entry, + void *cookie) +{ + unsigned long *p = (unsigned long *)ksp; + + if (unlikely(ksp & (sizeof(unsigned long) - 1))) + return; + + while (!kstack_end(p)) { + unsigned long addr = READ_ONCE_NOCHECK(*p++); + + if (!__kernel_text_address(addr)) + continue; + + if (!consume_entry(cookie, addr)) + break; + } +} + +noinline void arch_stack_walk(stack_trace_consume_fn consume_entry, + void *cookie, + struct task_struct *task, + struct pt_regs *regs) +{ + unsigned long ksp; + + if (!task) + task = current; + + if (regs && task == current) { + /* + * pt_regs is stored on the kernel stack; regs+1 matches + * what arch/alpha/kernel/traps.c uses as the trace start. + */ + ksp = (unsigned long)(regs + 1); + } else if (task == current) { + ksp = alpha_get_current_ksp(); + } else { + ksp = task_thread_info(task)->pcb.ksp; + } + + alpha_scan_kernel_stack(ksp, consume_entry, cookie); +} |
