arch/x86/kernel/process.c
Source file repositories/reference/linux-study-clean/arch/x86/kernel/process.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/kernel/process.c- Extension
.c- Size
- 27053 bytes
- Lines
- 1088
- Domain
- Architecture Layer
- Bucket
- arch/x86
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/errno.hlinux/kernel.hlinux/mm.hlinux/smp.hlinux/cpu.hlinux/prctl.hlinux/slab.hlinux/sched.hlinux/sched/idle.hlinux/sched/debug.hlinux/sched/task.hlinux/sched/task_stack.hlinux/init.hlinux/export.hlinux/pm.hlinux/tick.hlinux/random.hlinux/user-return-notifier.hlinux/dmi.hlinux/utsname.hlinux/stackprotector.hlinux/cpuidle.hlinux/acpi.hlinux/elf-randomize.hlinux/static_call.htrace/events/power.hlinux/hw_breakpoint.hlinux/entry-common.hasm/cpu.hasm/cpuid/api.hasm/apic.hlinux/uaccess.h
Detected Declarations
syscall arch_prctlsyscall ni_syscallstruct ssb_statefunction arch_dup_task_structfunction arch_release_task_structfunction exit_threadfunction set_new_tlsfunction ret_from_forkfunction copy_threadfunction pkru_flush_threadfunction flush_threadfunction disable_TSCfunction enable_TSCfunction get_tsc_modefunction set_tsc_modefunction set_cpuid_faultingfunction disable_cpuidfunction enable_cpuidfunction get_cpuid_modefunction set_cpuid_modefunction arch_setup_new_execfunction task_spec_ssb_noexecfunction switch_to_bitmapfunction tss_copy_io_bitmapfunction native_tss_update_io_bitmapfunction switch_to_bitmapfunction speculative_store_bypass_ht_initfunction amd_set_core_ssb_statefunction amd_set_core_ssb_statefunction amd_set_ssb_virt_statefunction __speculation_ctrl_updatefunction static_cpu_hasfunction static_branch_unlikelyfunction speculation_ctrl_update_tiffunction speculation_ctrl_updatefunction speculation_ctrl_update_currentfunction cr4_toggle_bits_irqsofffunction __switch_to_xtrafunction default_idlefunction x86_idle_setfunction play_deadfunction arch_cpu_idle_enterfunction arch_cpu_idle_deadfunction arch_cpu_idlefunction xen_set_default_idlefunction stop_this_cpufunction prefer_mwait_c1_over_haltfunction mwait_idle
Annotated Snippet
SYSCALL_DEFINE2(arch_prctl, int, option, unsigned long, arg2)
{
switch (option) {
case ARCH_GET_CPUID:
return get_cpuid_mode();
case ARCH_SET_CPUID:
return set_cpuid_mode(arg2);
case ARCH_GET_XCOMP_SUPP:
case ARCH_GET_XCOMP_PERM:
case ARCH_REQ_XCOMP_PERM:
case ARCH_GET_XCOMP_GUEST_PERM:
case ARCH_REQ_XCOMP_GUEST_PERM:
return fpu_xstate_prctl(option, arg2);
}
if (!in_ia32_syscall())
return do_arch_prctl_64(current, option, arg2);
return -EINVAL;
}
SYSCALL_DEFINE0(ni_syscall)
{
return -ENOSYS;
}
Annotation
- Immediate include surface: `linux/errno.h`, `linux/kernel.h`, `linux/mm.h`, `linux/smp.h`, `linux/cpu.h`, `linux/prctl.h`, `linux/slab.h`, `linux/sched.h`.
- Detected declarations: `syscall arch_prctl`, `syscall ni_syscall`, `struct ssb_state`, `function arch_dup_task_struct`, `function arch_release_task_struct`, `function exit_thread`, `function set_new_tls`, `function ret_from_fork`, `function copy_thread`, `function pkru_flush_thread`.
- Atlas domain: Architecture Layer / arch/x86.
- 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.