arch/s390/kernel/guarded_storage.c
Source file repositories/reference/linux-study-clean/arch/s390/kernel/guarded_storage.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/kernel/guarded_storage.c- Extension
.c- Size
- 2576 bytes
- Lines
- 130
- 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.
- 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/cpufeature.hlinux/kernel.hlinux/syscalls.hlinux/signal.hlinux/mm.hlinux/slab.hasm/guarded_storage.hentry.h
Detected Declarations
syscall s390_guarded_storagefunction Authorfunction gs_enablefunction gs_disablefunction gs_set_bc_cbfunction gs_clear_bc_cbfunction gs_load_bc_cbfunction gs_broadcast
Annotated Snippet
SYSCALL_DEFINE2(s390_guarded_storage, int, command,
struct gs_cb __user *, gs_cb)
{
if (!cpu_has_gs())
return -EOPNOTSUPP;
switch (command) {
case GS_ENABLE:
return gs_enable();
case GS_DISABLE:
return gs_disable();
case GS_SET_BC_CB:
return gs_set_bc_cb(gs_cb);
case GS_CLEAR_BC_CB:
return gs_clear_bc_cb();
case GS_BROADCAST:
return gs_broadcast();
default:
return -EINVAL;
}
}
Annotation
- Immediate include surface: `linux/cpufeature.h`, `linux/kernel.h`, `linux/syscalls.h`, `linux/signal.h`, `linux/mm.h`, `linux/slab.h`, `asm/guarded_storage.h`, `entry.h`.
- Detected declarations: `syscall s390_guarded_storage`, `function Author`, `function gs_enable`, `function gs_disable`, `function gs_set_bc_cb`, `function gs_clear_bc_cb`, `function gs_load_bc_cb`, `function gs_broadcast`.
- 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.
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.