arch/s390/kernel/machine_kexec_file.c
Source file repositories/reference/linux-study-clean/arch/s390/kernel/machine_kexec_file.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/kernel/machine_kexec_file.c- Extension
.c- Size
- 9317 bytes
- Lines
- 392
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/elf.hlinux/errno.hlinux/kexec.hlinux/module_signature.hlinux/verification.hlinux/vmalloc.hasm/boot_data.hasm/ipl.hasm/setup.h
Detected Declarations
function s390_verify_sigfunction kexec_file_update_purgatoryfunction kexec_file_add_purgatoryfunction kexec_file_add_initrdfunction kexec_file_add_ipl_reportfunction intfunction arch_kexec_apply_relocations_addfunction arch_kimage_file_post_load_cleanup
Annotated Snippet
if (sym->st_shndx == SHN_UNDEF) {
pr_err("Undefined symbol: %s\n", name);
return -ENOEXEC;
}
if (sym->st_shndx == SHN_COMMON) {
pr_err("symbol '%s' in common section\n", name);
return -ENOEXEC;
}
if (sym->st_shndx >= pi->ehdr->e_shnum &&
sym->st_shndx != SHN_ABS) {
pr_err("Invalid section %d for symbol %s\n",
sym->st_shndx, name);
return -ENOEXEC;
}
loc = pi->purgatory_buf;
loc += section->sh_offset;
loc += relas[i].r_offset;
val = sym->st_value;
if (sym->st_shndx != SHN_ABS)
val += pi->sechdrs[sym->st_shndx].sh_addr;
val += relas[i].r_addend;
addr = section->sh_addr + relas[i].r_offset;
r_type = ELF64_R_TYPE(relas[i].r_info);
if (r_type == R_390_PLT32DBL)
r_type = R_390_PC32DBL;
ret = arch_kexec_do_relocs(r_type, loc, val, addr);
if (ret) {
pr_err("Unknown rela relocation: %d\n", r_type);
return -ENOEXEC;
}
}
return 0;
}
int arch_kimage_file_post_load_cleanup(struct kimage *image)
{
vfree(image->arch.ipl_buf);
image->arch.ipl_buf = NULL;
return kexec_image_post_load_cleanup_default(image);
}
Annotation
- Immediate include surface: `linux/elf.h`, `linux/errno.h`, `linux/kexec.h`, `linux/module_signature.h`, `linux/verification.h`, `linux/vmalloc.h`, `asm/boot_data.h`, `asm/ipl.h`.
- Detected declarations: `function s390_verify_sig`, `function kexec_file_update_purgatory`, `function kexec_file_add_purgatory`, `function kexec_file_add_initrd`, `function kexec_file_add_ipl_report`, `function int`, `function arch_kexec_apply_relocations_add`, `function arch_kimage_file_post_load_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.