diff options
Diffstat (limited to 'arch/x86/include/asm/mce.h')
| -rw-r--r-- | arch/x86/include/asm/mce.h | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 32c6e17b960b..563933e06a35 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */ | 13 | #define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */ |
| 14 | #define MCG_EXT_P (1ULL<<9) /* Extended registers available */ | ||
| 15 | #define MCG_CMCI_P (1ULL<<10) /* CMCI supported */ | ||
| 14 | 16 | ||
| 15 | #define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */ | 17 | #define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */ |
| 16 | #define MCG_STATUS_EIPV (1UL<<1) /* ip points to correct instruction */ | 18 | #define MCG_STATUS_EIPV (1UL<<1) /* ip points to correct instruction */ |
| @@ -90,14 +92,29 @@ extern int mce_disabled; | |||
| 90 | 92 | ||
| 91 | #include <asm/atomic.h> | 93 | #include <asm/atomic.h> |
| 92 | 94 | ||
| 95 | void mce_setup(struct mce *m); | ||
| 93 | void mce_log(struct mce *m); | 96 | void mce_log(struct mce *m); |
| 94 | DECLARE_PER_CPU(struct sys_device, device_mce); | 97 | DECLARE_PER_CPU(struct sys_device, device_mce); |
| 95 | extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); | 98 | extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); |
| 96 | 99 | ||
| 100 | /* | ||
| 101 | * To support more than 128 would need to escape the predefined | ||
| 102 | * Linux defined extended banks first. | ||
| 103 | */ | ||
| 104 | #define MAX_NR_BANKS (MCE_EXTENDED_BANK - 1) | ||
| 105 | |||
| 97 | #ifdef CONFIG_X86_MCE_INTEL | 106 | #ifdef CONFIG_X86_MCE_INTEL |
| 98 | void mce_intel_feature_init(struct cpuinfo_x86 *c); | 107 | void mce_intel_feature_init(struct cpuinfo_x86 *c); |
| 108 | void cmci_clear(void); | ||
| 109 | void cmci_reenable(void); | ||
| 110 | void cmci_rediscover(int dying); | ||
| 111 | void cmci_recheck(void); | ||
| 99 | #else | 112 | #else |
| 100 | static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) { } | 113 | static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) { } |
| 114 | static inline void cmci_clear(void) {} | ||
| 115 | static inline void cmci_reenable(void) {} | ||
| 116 | static inline void cmci_rediscover(int dying) {} | ||
| 117 | static inline void cmci_recheck(void) {} | ||
| 101 | #endif | 118 | #endif |
| 102 | 119 | ||
| 103 | #ifdef CONFIG_X86_MCE_AMD | 120 | #ifdef CONFIG_X86_MCE_AMD |
| @@ -106,11 +123,23 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c); | |||
| 106 | static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { } | 123 | static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { } |
| 107 | #endif | 124 | #endif |
| 108 | 125 | ||
| 109 | void mce_log_therm_throt_event(unsigned int cpu, __u64 status); | 126 | extern int mce_available(struct cpuinfo_x86 *c); |
| 127 | |||
| 128 | void mce_log_therm_throt_event(__u64 status); | ||
| 110 | 129 | ||
| 111 | extern atomic_t mce_entry; | 130 | extern atomic_t mce_entry; |
| 112 | 131 | ||
| 113 | extern void do_machine_check(struct pt_regs *, long); | 132 | extern void do_machine_check(struct pt_regs *, long); |
| 133 | |||
| 134 | typedef DECLARE_BITMAP(mce_banks_t, MAX_NR_BANKS); | ||
| 135 | DECLARE_PER_CPU(mce_banks_t, mce_poll_banks); | ||
| 136 | |||
| 137 | enum mcp_flags { | ||
| 138 | MCP_TIMESTAMP = (1 << 0), /* log time stamp */ | ||
| 139 | MCP_UC = (1 << 1), /* log uncorrected errors */ | ||
| 140 | }; | ||
| 141 | extern void machine_check_poll(enum mcp_flags flags, mce_banks_t *b); | ||
| 142 | |||
| 114 | extern int mce_notify_user(void); | 143 | extern int mce_notify_user(void); |
| 115 | 144 | ||
| 116 | #endif /* !CONFIG_X86_32 */ | 145 | #endif /* !CONFIG_X86_32 */ |
| @@ -120,8 +149,8 @@ extern void mcheck_init(struct cpuinfo_x86 *c); | |||
| 120 | #else | 149 | #else |
| 121 | #define mcheck_init(c) do { } while (0) | 150 | #define mcheck_init(c) do { } while (0) |
| 122 | #endif | 151 | #endif |
| 123 | extern void stop_mce(void); | 152 | |
| 124 | extern void restart_mce(void); | 153 | extern void (*mce_threshold_vector)(void); |
| 125 | 154 | ||
| 126 | #endif /* __KERNEL__ */ | 155 | #endif /* __KERNEL__ */ |
| 127 | #endif /* _ASM_X86_MCE_H */ | 156 | #endif /* _ASM_X86_MCE_H */ |
