e3480271f5
Until now, the mce_severity mechanism can only identify the severity of UCNA error as MCE_KEEP_SEVERITY. Meanwhile, it is not able to filter out DEFERRED error for AMD platform. This patch extends the mce_severity mechanism for handling UCNA/DEFERRED error. In order to do this, the patch introduces a new severity level - MCE_UCNA/DEFERRED_SEVERITY. In addition, mce_severity is specific to machine check exception, and it will check MCIP/EIPV/RIPV bits. In order to use mce_severity mechanism in non-exception context, the patch also introduces a new argument (is_excp) for mce_severity. `is_excp' is used to explicitly specify the calling context of mce_severity. Reviewed-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com> Signed-off-by: Chen Yucong <slaoub@gmail.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
69 lines
1.7 KiB
C
69 lines
1.7 KiB
C
#include <linux/device.h>
|
|
#include <asm/mce.h>
|
|
|
|
enum severity_level {
|
|
MCE_NO_SEVERITY,
|
|
MCE_DEFERRED_SEVERITY,
|
|
MCE_UCNA_SEVERITY = MCE_DEFERRED_SEVERITY,
|
|
MCE_KEEP_SEVERITY,
|
|
MCE_SOME_SEVERITY,
|
|
MCE_AO_SEVERITY,
|
|
MCE_UC_SEVERITY,
|
|
MCE_AR_SEVERITY,
|
|
MCE_PANIC_SEVERITY,
|
|
};
|
|
|
|
#define ATTR_LEN 16
|
|
|
|
/* One object for each MCE bank, shared by all CPUs */
|
|
struct mce_bank {
|
|
u64 ctl; /* subevents to enable */
|
|
unsigned char init; /* initialise bank? */
|
|
struct device_attribute attr; /* device attribute */
|
|
char attrname[ATTR_LEN]; /* attribute name */
|
|
};
|
|
|
|
int mce_severity(struct mce *a, int tolerant, char **msg, bool is_excp);
|
|
struct dentry *mce_get_debugfs_dir(void);
|
|
|
|
extern struct mce_bank *mce_banks;
|
|
extern mce_banks_t mce_banks_ce_disabled;
|
|
|
|
#ifdef CONFIG_X86_MCE_INTEL
|
|
unsigned long mce_intel_adjust_timer(unsigned long interval);
|
|
void mce_intel_cmci_poll(void);
|
|
void mce_intel_hcpu_update(unsigned long cpu);
|
|
void cmci_disable_bank(int bank);
|
|
#else
|
|
# define mce_intel_adjust_timer mce_adjust_timer_default
|
|
static inline void mce_intel_cmci_poll(void) { }
|
|
static inline void mce_intel_hcpu_update(unsigned long cpu) { }
|
|
static inline void cmci_disable_bank(int bank) { }
|
|
#endif
|
|
|
|
void mce_timer_kick(unsigned long interval);
|
|
|
|
#ifdef CONFIG_ACPI_APEI
|
|
int apei_write_mce(struct mce *m);
|
|
ssize_t apei_read_mce(struct mce *m, u64 *record_id);
|
|
int apei_check_mce(void);
|
|
int apei_clear_mce(u64 record_id);
|
|
#else
|
|
static inline int apei_write_mce(struct mce *m)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
static inline ssize_t apei_read_mce(struct mce *m, u64 *record_id)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline int apei_check_mce(void)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline int apei_clear_mce(u64 record_id)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
#endif
|