arch/s390/kernel/sthyi.c
Source file repositories/reference/linux-study-clean/arch/s390/kernel/sthyi.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/kernel/sthyi.c- Extension
.c- Size
- 13055 bytes
- Lines
- 557
- Domain
- Architecture Layer
- Bucket
- arch/s390
- Inferred role
- Architecture Layer: syscall or user/kernel boundary
- Status
- core 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 participates in a user/kernel boundary; inspect argument validation, copy_from_user/copy_to_user, credentials, and dispatch target.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/export.hlinux/errno.hlinux/pagemap.hlinux/vmalloc.hlinux/syscalls.hlinux/mutex.hasm/asm-offsets.hasm/sclp.hasm/diag.hasm/sysinfo.hasm/ebcdic.hasm/facility.hasm/sthyi.hasm/asm.hentry.h
Detected Declarations
syscall s390_sthyistruct hdr_sctnstruct mac_sctnstruct par_sctnstruct sthyi_sctnsstruct cpu_infstruct lpar_cpu_infstruct sthyi_infoenum hdr_flagsenum mac_validityenum par_flagenum par_validityfunction cpu_idfunction scale_capfunction fill_hdrfunction fill_stsi_macfunction fill_stsi_parfunction fill_stsifunction fill_diag_macfunction is_diag204_cachedfunction fill_diagfunction sthyifunction fill_dstfunction sthyi_init_cachefunction sthyi_update_cachefunction sthyi_fillexport sthyi_fill
Annotated Snippet
SYSCALL_DEFINE4(s390_sthyi, unsigned long, function_code, void __user *, buffer,
u64 __user *, return_code, unsigned long, flags)
{
u64 sthyi_rc;
void *info;
int r;
if (flags)
return -EINVAL;
if (function_code != STHYI_FC_CP_IFL_CAP)
return -EOPNOTSUPP;
info = (void *)get_zeroed_page(GFP_KERNEL);
if (!info)
return -ENOMEM;
r = sthyi_fill(info, &sthyi_rc);
if (r < 0)
goto out;
if (return_code && put_user(sthyi_rc, return_code)) {
r = -EFAULT;
goto out;
}
if (copy_to_user(buffer, info, PAGE_SIZE))
r = -EFAULT;
out:
free_page((unsigned long)info);
return r;
}
Annotation
- Immediate include surface: `linux/export.h`, `linux/errno.h`, `linux/pagemap.h`, `linux/vmalloc.h`, `linux/syscalls.h`, `linux/mutex.h`, `asm/asm-offsets.h`, `asm/sclp.h`.
- Detected declarations: `syscall s390_sthyi`, `struct hdr_sctn`, `struct mac_sctn`, `struct par_sctn`, `struct sthyi_sctns`, `struct cpu_inf`, `struct lpar_cpu_inf`, `struct sthyi_info`, `enum hdr_flags`, `enum mac_validity`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: core implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.