#ifndef _ASM_X86_MCE_H
#define _ASM_X86_MCE_H
#include <uapi/asm/mce.h>
#define MCG_BANKCNT_MASK …
#define MCG_CTL_P …
#define MCG_EXT_P …
#define MCG_CMCI_P …
#define MCG_SEAM_NR …
#define MCG_EXT_CNT_MASK …
#define MCG_EXT_CNT_SHIFT …
#define MCG_EXT_CNT(c) …
#define MCG_SER_P …
#define MCG_ELOG_P …
#define MCG_LMCE_P …
#define MCG_STATUS_RIPV …
#define MCG_STATUS_EIPV …
#define MCG_STATUS_MCIP …
#define MCG_STATUS_LMCES …
#define MCG_STATUS_SEAM_NR …
#define MCG_EXT_CTL_LMCE_EN …
#define MCI_STATUS_VAL …
#define MCI_STATUS_OVER …
#define MCI_STATUS_UC …
#define MCI_STATUS_EN …
#define MCI_STATUS_MISCV …
#define MCI_STATUS_ADDRV …
#define MCI_STATUS_PCC …
#define MCI_STATUS_S …
#define MCI_STATUS_AR …
#define MCI_STATUS_CEC_SHIFT …
#define MCI_STATUS_CEC_MASK …
#define MCI_STATUS_CEC(c) …
#define MCI_STATUS_MSCOD(m) …
#define MCI_STATUS_TCC …
#define MCI_STATUS_SYNDV …
#define MCI_STATUS_DEFERRED …
#define MCI_STATUS_POISON …
#define MCI_STATUS_SCRUB …
#define MCI_CONFIG_MCAX …
#define MCI_IPID_MCATYPE …
#define MCI_IPID_HWID …
#define MCACOD …
#define MCACOD_SCRUB …
#define MCACOD_SCRUBMSK …
#define MCACOD_L3WB …
#define MCACOD_DATA …
#define MCACOD_INSTR …
#define MCI_MISC_ADDR_LSB(m) …
#define MCI_MISC_ADDR_MODE(m) …
#define MCI_MISC_ADDR_SEGOFF …
#define MCI_MISC_ADDR_LINEAR …
#define MCI_MISC_ADDR_PHYS …
#define MCI_MISC_ADDR_MEM …
#define MCI_MISC_ADDR_GENERIC …
#define MCI_ADDR_PHYSADDR …
#define MCI_CTL2_CMCI_EN …
#define MCI_CTL2_CMCI_THRESHOLD_MASK …
#define MCJ_CTX_MASK …
#define MCJ_CTX(flags) …
#define MCJ_CTX_RANDOM …
#define MCJ_CTX_PROCESS …
#define MCJ_CTX_IRQ …
#define MCJ_NMI_BROADCAST …
#define MCJ_EXCEPTION …
#define MCJ_IRQ_BROADCAST …
#define MCE_OVERFLOW …
#define MCE_LOG_MIN_LEN …
#define MCE_LOG_SIGNATURE …
#define MSR_AMD64_SMCA_MC0_CTL …
#define MSR_AMD64_SMCA_MC0_STATUS …
#define MSR_AMD64_SMCA_MC0_ADDR …
#define MSR_AMD64_SMCA_MC0_MISC0 …
#define MSR_AMD64_SMCA_MC0_CONFIG …
#define MSR_AMD64_SMCA_MC0_IPID …
#define MSR_AMD64_SMCA_MC0_SYND …
#define MSR_AMD64_SMCA_MC0_DESTAT …
#define MSR_AMD64_SMCA_MC0_DEADDR …
#define MSR_AMD64_SMCA_MC0_MISC1 …
#define MSR_AMD64_SMCA_MCx_CTL(x) …
#define MSR_AMD64_SMCA_MCx_STATUS(x) …
#define MSR_AMD64_SMCA_MCx_ADDR(x) …
#define MSR_AMD64_SMCA_MCx_MISC(x) …
#define MSR_AMD64_SMCA_MCx_CONFIG(x) …
#define MSR_AMD64_SMCA_MCx_IPID(x) …
#define MSR_AMD64_SMCA_MCx_SYND(x) …
#define MSR_AMD64_SMCA_MCx_DESTAT(x) …
#define MSR_AMD64_SMCA_MCx_DEADDR(x) …
#define MSR_AMD64_SMCA_MCx_MISCy(x, y) …
#define XEC(x, mask) …
#define MCE_HANDLED_CEC …
#define MCE_HANDLED_UC …
#define MCE_HANDLED_EXTLOG …
#define MCE_HANDLED_NFIT …
#define MCE_HANDLED_EDAC …
#define MCE_HANDLED_MCELOG …
#define MCE_IN_KERNEL_RECOV …
#define MCE_IN_KERNEL_COPYIN …
struct mce_log_buffer { … };
enum mce_notifier_prios { … };
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 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 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_setup(struct mce *m);
void mce_log(struct mce *m);
DECLARE_PER_CPU(struct device *, mce_device);
#define MAX_NR_BANKS …
#ifdef CONFIG_X86_MCE_INTEL
void mce_intel_feature_init(struct cpuinfo_x86 *c);
void mce_intel_feature_clear(struct cpuinfo_x86 *c);
void cmci_clear(void);
void cmci_reenable(void);
void cmci_rediscover(void);
void cmci_recheck(void);
#else
static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) { }
static inline void mce_intel_feature_clear(struct cpuinfo_x86 *c) { }
static inline void cmci_clear(void) {}
static inline void cmci_reenable(void) {}
static inline void cmci_rediscover(void) {}
static inline void cmci_recheck(void) {}
#endif
int mce_available(struct cpuinfo_x86 *c);
bool mce_is_memory_error(struct mce *m);
bool mce_is_correctable(struct mce *m);
bool mce_usable_address(struct mce *m);
DECLARE_PER_CPU(unsigned, mce_exception_count);
DECLARE_PER_CPU(unsigned, mce_poll_count);
mce_banks_t;
DECLARE_PER_CPU(mce_banks_t, mce_poll_banks);
enum mcp_flags { … };
void machine_check_poll(enum mcp_flags flags, mce_banks_t *b);
int mce_notify_irq(void);
DECLARE_PER_CPU(struct mce, injectm);
extern void mce_disable_bank(int bank);
void do_machine_check(struct pt_regs *pt_regs);
extern void (*mce_threshold_vector)(void);
extern void (*deferred_error_int_vector)(void);
struct cper_sec_mem_err;
extern void apei_mce_report_mem_error(int corrected,
struct cper_sec_mem_err *mem_err);
#ifdef CONFIG_X86_MCE_AMD
enum smca_bank_types { … };
extern bool amd_mce_is_memory_error(struct mce *m);
extern int mce_threshold_create_device(unsigned int cpu);
extern int mce_threshold_remove_device(unsigned int cpu);
void mce_amd_feature_init(struct cpuinfo_x86 *c);
enum smca_bank_types smca_get_bank_type(unsigned int cpu, unsigned int bank);
#else
static inline int mce_threshold_create_device(unsigned int cpu) { return 0; };
static inline int mce_threshold_remove_device(unsigned int cpu) { return 0; };
static inline bool amd_mce_is_memory_error(struct mce *m) { return false; };
static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { }
#endif
static inline void mce_hygon_feature_init(struct cpuinfo_x86 *c) { … }
unsigned long copy_mc_fragile_handle_tail(char *to, char *from, unsigned len);
#endif