arch/s390/kernel/machine_kexec.c
Source file repositories/reference/linux-study-clean/arch/s390/kernel/machine_kexec.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/kernel/machine_kexec.c- Extension
.c- Size
- 6504 bytes
- Lines
- 275
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/mm.hlinux/kexec.hlinux/delay.hlinux/reboot.hlinux/ftrace.hlinux/debug_locks.hlinux/cpufeature.hasm/guarded_storage.hasm/machine.hasm/pfault.hasm/cio.hasm/fpu.hasm/setup.hasm/smp.hasm/ipl.hasm/diag.hasm/elf.hasm/asm-offsets.hasm/cacheflush.hasm/abs_lowcore.hasm/os_info.hasm/set_memory.hasm/stacktrace.hasm/nmi.hasm/sclp.h
Detected Declarations
function __do_machine_kdumpfunction __machine_kdumpfunction kdump_csum_validfunction crash_free_reserved_phys_rangefunction crash_protect_pagesfunction arch_kexec_protect_crashkresfunction arch_kexec_unprotect_crashkresfunction machine_kexec_prepare_kdumpfunction machine_kexec_preparefunction machine_kexec_cleanupfunction __do_machine_kexecfunction __machine_kexecfunction machine_kexec
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright IBM Corp. 2005, 2011
*
* Author(s): Rolf Adelsberger,
* Michael Holzheu <holzheu@linux.vnet.ibm.com>
*/
#include <linux/device.h>
#include <linux/mm.h>
#include <linux/kexec.h>
#include <linux/delay.h>
#include <linux/reboot.h>
#include <linux/ftrace.h>
#include <linux/debug_locks.h>
#include <linux/cpufeature.h>
#include <asm/guarded_storage.h>
#include <asm/machine.h>
#include <asm/pfault.h>
#include <asm/cio.h>
#include <asm/fpu.h>
#include <asm/setup.h>
#include <asm/smp.h>
#include <asm/ipl.h>
#include <asm/diag.h>
#include <asm/elf.h>
#include <asm/asm-offsets.h>
#include <asm/cacheflush.h>
#include <asm/abs_lowcore.h>
#include <asm/os_info.h>
#include <asm/set_memory.h>
#include <asm/stacktrace.h>
#include <asm/nmi.h>
#include <asm/sclp.h>
typedef void (*relocate_kernel_t)(unsigned long, unsigned long, unsigned long);
typedef int (*purgatory_t)(int);
extern const unsigned char relocate_kernel[];
extern const unsigned long long relocate_kernel_len;
#ifdef CONFIG_CRASH_DUMP
/*
* Reset the system, copy boot CPU registers to absolute zero,
* and jump to the kdump image
*/
static void __do_machine_kdump(void *data)
{
struct kimage *image = data;
purgatory_t purgatory;
unsigned long prefix;
purgatory = (purgatory_t)image->start;
/* store_status() saved the prefix register to lowcore */
prefix = (unsigned long)get_lowcore()->prefixreg_save_area;
/* Now do the reset */
s390_reset_system();
/*
* Copy dump CPU store status info to absolute zero.
* This need to be done *after* s390_reset_system set the
* prefix register of this CPU to zero
*/
memcpy(absolute_pointer(get_lowcore()->floating_pt_save_area),
phys_to_virt(prefix + __LC_FPREGS_SAVE_AREA), 512);
call_nodat(1, int, purgatory, int, 1);
/* Die if kdump returns */
disabled_wait();
}
/*
* Start kdump: create a LGR log entry, store status of all CPUs and
* branch to __do_machine_kdump.
*/
static noinline void __machine_kdump(void *image)
{
struct mcesa *mcesa;
union ctlreg2 cr2_old, cr2_new;
int this_cpu, cpu;
lgr_info_log();
/* Get status of the other CPUs */
this_cpu = smp_find_processor_id(stap());
for_each_online_cpu(cpu) {
if (cpu == this_cpu)
Annotation
- Immediate include surface: `linux/device.h`, `linux/mm.h`, `linux/kexec.h`, `linux/delay.h`, `linux/reboot.h`, `linux/ftrace.h`, `linux/debug_locks.h`, `linux/cpufeature.h`.
- Detected declarations: `function __do_machine_kdump`, `function __machine_kdump`, `function kdump_csum_valid`, `function crash_free_reserved_phys_range`, `function crash_protect_pages`, `function arch_kexec_protect_crashkres`, `function arch_kexec_unprotect_crashkres`, `function machine_kexec_prepare_kdump`, `function machine_kexec_prepare`, `function machine_kexec_cleanup`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: source implementation candidate.
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.