arch/x86/kernel/cpu/mce/severity.c
Source file repositories/reference/linux-study-clean/arch/x86/kernel/cpu/mce/severity.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/kernel/cpu/mce/severity.c- Extension
.c- Size
- 12790 bytes
- Lines
- 490
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/seq_file.hlinux/init.hlinux/debugfs.hlinux/uaccess.hasm/mce.hasm/cpu_device_id.hasm/traps.hasm/insn.hasm/insn-eval.hinternal.h
Detected Declarations
enum contextenum serenum exceptionfunction is_copy_from_userfunction mce_severity_amdfunction mce_severity_intelfunction mce_severityfunction s_stopfunction severities_coverage_openfunction severities_coverage_writefunction severities_debugfs_init
Annotated Snippet
static const struct file_operations severities_coverage_fops = {
.open = severities_coverage_open,
.release = seq_release,
.read = seq_read,
.write = severities_coverage_write,
.llseek = seq_lseek,
};
static int __init severities_debugfs_init(void)
{
struct dentry *dmce;
dmce = mce_get_debugfs_dir();
debugfs_create_file("severities-coverage", 0444, dmce, NULL,
&severities_coverage_fops);
return 0;
}
late_initcall(severities_debugfs_init);
#endif /* CONFIG_DEBUG_FS */
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/seq_file.h`, `linux/init.h`, `linux/debugfs.h`, `linux/uaccess.h`, `asm/mce.h`, `asm/cpu_device_id.h`, `asm/traps.h`.
- Detected declarations: `enum context`, `enum ser`, `enum exception`, `function is_copy_from_user`, `function mce_severity_amd`, `function mce_severity_intel`, `function mce_severity`, `function s_stop`, `function severities_coverage_open`, `function severities_coverage_write`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: pattern 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.