arch/s390/kernel/nospec-branch.c
Source file repositories/reference/linux-study-clean/arch/s390/kernel/nospec-branch.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/kernel/nospec-branch.c- Extension
.c- Size
- 3905 bytes
- Lines
- 159
- 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.
Dependency Surface
linux/module.hlinux/device.hlinux/cpu.hasm/nospec-branch.h
Detected Declarations
function nobp_setup_earlyfunction nospec_setup_earlyfunction nospec_reportfunction nospectre_v2_setup_earlyfunction nospec_auto_detectfunction spectre_v2_setup_earlyfunction __nospec_revertfunction nospec_revertfunction nospec_init_branches
Annotated Snippet
switch (type) {
case BRCL_EXPOLINE:
/* brcl to thunk, replace with br + nop */
insnbuf[0] = br[0];
insnbuf[1] = (instr[1] & 0xf0) | (br[1] & 0x0f);
break;
case BRASL_EXPOLINE:
/* brasl to thunk, replace with basr + nop */
insnbuf[0] = 0x0d;
insnbuf[1] = (instr[1] & 0xf0) | (br[1] & 0x0f);
break;
}
s390_kernel_write(instr, insnbuf, 6);
}
}
void __init_or_module nospec_revert(s32 *start, s32 *end)
{
if (nospec_disable)
__nospec_revert(start, end);
}
extern s32 __nospec_call_start[], __nospec_call_end[];
extern s32 __nospec_return_start[], __nospec_return_end[];
void __init nospec_init_branches(void)
{
nospec_revert(__nospec_call_start, __nospec_call_end);
nospec_revert(__nospec_return_start, __nospec_return_end);
}
#endif /* CONFIG_EXPOLINE */
Annotation
- Immediate include surface: `linux/module.h`, `linux/device.h`, `linux/cpu.h`, `asm/nospec-branch.h`.
- Detected declarations: `function nobp_setup_early`, `function nospec_setup_early`, `function nospec_report`, `function nospectre_v2_setup_early`, `function nospec_auto_detect`, `function spectre_v2_setup_early`, `function __nospec_revert`, `function nospec_revert`, `function nospec_init_branches`.
- 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.