arch/x86/include/asm/mce.h
Source file repositories/reference/linux-study-clean/arch/x86/include/asm/mce.h
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/include/asm/mce.h- Extension
.h- Size
- 14479 bytes
- Lines
- 412
- Domain
- Architecture Layer
- Bucket
- arch/x86
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
uapi/asm/mce.hlinux/percpu.hlinux/atomic.h
Detected Declarations
struct mce_log_bufferstruct mce_hw_errstruct notifier_blockstruct cper_ia_proc_ctxstruct cper_sec_mem_errenum mce_notifier_priosenum mcp_flagsenum smca_bank_typesfunction enable_copy_mc_fragilefunction mcheck_initfunction mca_bsp_initfunction mce_intel_feature_initfunction mce_save_apei_thr_limitfunction amd_mce_is_memory_errorfunction mce_amd_feature_init
Annotated Snippet
struct mce_log_buffer {
char signature[12]; /* "MACHINECHECK" */
unsigned len; /* = elements in .mce_entry[] */
unsigned next;
unsigned flags;
unsigned recordlen; /* length of struct mce */
struct mce entry[];
};
/* Highest last */
enum mce_notifier_prios {
MCE_PRIO_LOWEST,
MCE_PRIO_MCELOG,
MCE_PRIO_EDAC,
MCE_PRIO_NFIT,
MCE_PRIO_EXTLOG,
MCE_PRIO_UC,
MCE_PRIO_EARLY,
MCE_PRIO_CEC,
MCE_PRIO_HIGHEST = MCE_PRIO_CEC
};
/**
* struct mce_hw_err - Hardware Error Record.
* @m: Machine Check record.
* @vendor: Vendor-specific error information.
*
* Vendor-specific fields should not be added to struct mce. Instead, vendors
* should export their vendor-specific data through their structure in the
* vendor union below.
*
* AMD's vendor data is parsed by error decoding tools for supplemental error
* information. Thus, current offsets of existing fields must be maintained.
* Only add new fields at the end of AMD's vendor structure.
*/
struct mce_hw_err {
struct mce m;
union vendor_info {
struct {
u64 synd1; /* MCA_SYND1 MSR */
u64 synd2; /* MCA_SYND2 MSR */
} amd;
} vendor;
};
#define to_mce_hw_err(mce) container_of(mce, struct mce_hw_err, m)
struct notifier_block;
extern void mce_register_decode_chain(struct notifier_block *nb);
extern void mce_unregister_decode_chain(struct notifier_block *nb);
#include <linux/percpu.h>
#include <linux/atomic.h>
extern int mce_p5_enabled;
#ifdef CONFIG_ARCH_HAS_COPY_MC
extern void enable_copy_mc_fragile(void);
unsigned long __must_check copy_mc_fragile(void *dst, const void *src, unsigned cnt);
#else
static inline void enable_copy_mc_fragile(void)
{
}
#endif
struct cper_ia_proc_ctx;
#ifdef CONFIG_X86_MCE
int mcheck_init(void);
void mca_bsp_init(struct cpuinfo_x86 *c);
void mcheck_cpu_init(struct cpuinfo_x86 *c);
void mcheck_cpu_clear(struct cpuinfo_x86 *c);
int apei_smca_report_x86_error(struct cper_ia_proc_ctx *ctx_info,
u64 lapic_id);
#else
static inline int mcheck_init(void) { return 0; }
static inline void mca_bsp_init(struct cpuinfo_x86 *c) {}
static inline void mcheck_cpu_init(struct cpuinfo_x86 *c) {}
static inline void mcheck_cpu_clear(struct cpuinfo_x86 *c) {}
static inline int apei_smca_report_x86_error(struct cper_ia_proc_ctx *ctx_info,
u64 lapic_id) { return -EINVAL; }
#endif
void mce_prep_record(struct mce_hw_err *err);
void mce_log(struct mce_hw_err *err);
DECLARE_PER_CPU(struct device *, mce_device);
/* Maximum number of MCA banks per CPU. */
#define MAX_NR_BANKS 64
Annotation
- Immediate include surface: `uapi/asm/mce.h`, `linux/percpu.h`, `linux/atomic.h`.
- Detected declarations: `struct mce_log_buffer`, `struct mce_hw_err`, `struct notifier_block`, `struct cper_ia_proc_ctx`, `struct cper_sec_mem_err`, `enum mce_notifier_prios`, `enum mcp_flags`, `enum smca_bank_types`, `function enable_copy_mc_fragile`, `function mcheck_init`.
- Atlas domain: Architecture Layer / arch/x86.
- 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.