arch/s390/kernel/stacktrace.c
Source file repositories/reference/linux-study-clean/arch/s390/kernel/stacktrace.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/kernel/stacktrace.c- Extension
.c- Size
- 3566 bytes
- Lines
- 149
- Domain
- Architecture Layer
- Bucket
- arch/s390
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/perf_event.hlinux/stacktrace.hlinux/uaccess.hasm/asm-offsets.hasm/stacktrace.hasm/unwind.hasm/kprobes.hasm/ptrace.h
Detected Declarations
function arch_stack_walkfunction unwind_for_each_framefunction arch_stack_walk_reliablefunction unwind_for_each_framefunction store_ipfunction ip_invalidfunction ip_within_vdsofunction arch_stack_walk_user_commonfunction arch_stack_walk_user
Annotated Snippet
if (!sp && ip_within_vdso(ip)) {
sf_vdso = (void __user *)sf;
if (__get_user(ip, &sf_vdso->return_address))
break;
sp = (unsigned long)sf + STACK_FRAME_VDSO_OVERHEAD;
sf = (void __user *)sp;
if (__get_user(sp, &sf->back_chain))
break;
} else {
sf = (void __user *)sp;
if (__get_user(ip, &sf->gprs[8]))
break;
}
/* Validate SP and RA (ABI requires SP to be 8 byte aligned). */
if (sp & 0x7 || ip_invalid(ip))
break;
if (!store_ip(consume_entry, cookie, entry, perf, ip))
break;
}
pagefault_enable();
}
void arch_stack_walk_user(stack_trace_consume_fn consume_entry, void *cookie,
const struct pt_regs *regs)
{
arch_stack_walk_user_common(consume_entry, cookie, NULL, regs, false);
}
Annotation
- Immediate include surface: `linux/perf_event.h`, `linux/stacktrace.h`, `linux/uaccess.h`, `asm/asm-offsets.h`, `asm/stacktrace.h`, `asm/unwind.h`, `asm/kprobes.h`, `asm/ptrace.h`.
- Detected declarations: `function arch_stack_walk`, `function unwind_for_each_frame`, `function arch_stack_walk_reliable`, `function unwind_for_each_frame`, `function store_ip`, `function ip_invalid`, `function ip_within_vdso`, `function arch_stack_walk_user_common`, `function arch_stack_walk_user`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.