From 47ca08a40b043815134d489e21870b53276f1a4a Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Mon, 27 Sep 2010 15:30:39 +0200 Subject: EDAC, MCE: Rename files Drop "edac_" string from the filenames since they're prefixed with edac/ in their pathname anyway. Signed-off-by: Borislav Petkov --- drivers/edac/mce_amd.h | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 drivers/edac/mce_amd.h (limited to 'drivers/edac/mce_amd.h') diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h new file mode 100644 index 0000000..2712a90 --- /dev/null +++ b/drivers/edac/mce_amd.h @@ -0,0 +1,72 @@ +#ifndef _EDAC_MCE_AMD_H +#define _EDAC_MCE_AMD_H + +#include + +#include + +#define ERROR_CODE(x) ((x) & 0xffff) +#define EXT_ERROR_CODE(x) (((x) >> 16) & 0x1f) +#define EXT_ERR_MSG(x) ext_msgs[EXT_ERROR_CODE(x)] + +#define LOW_SYNDROME(x) (((x) >> 15) & 0xff) +#define HIGH_SYNDROME(x) (((x) >> 24) & 0xff) + +#define TLB_ERROR(x) (((x) & 0xFFF0) == 0x0010) +#define MEM_ERROR(x) (((x) & 0xFF00) == 0x0100) +#define BUS_ERROR(x) (((x) & 0xF800) == 0x0800) + +#define TT(x) (((x) >> 2) & 0x3) +#define TT_MSG(x) tt_msgs[TT(x)] +#define II(x) (((x) >> 2) & 0x3) +#define II_MSG(x) ii_msgs[II(x)] +#define LL(x) (((x) >> 0) & 0x3) +#define LL_MSG(x) ll_msgs[LL(x)] +#define TO(x) (((x) >> 8) & 0x1) +#define TO_MSG(x) to_msgs[TO(x)] +#define PP(x) (((x) >> 9) & 0x3) +#define PP_MSG(x) pp_msgs[PP(x)] + +#define RRRR(x) (((x) >> 4) & 0xf) +#define RRRR_MSG(x) ((RRRR(x) < 9) ? rrrr_msgs[RRRR(x)] : "Wrong R4!") + +#define K8_NBSH 0x4C + +#define K8_NBSH_VALID_BIT BIT(31) +#define K8_NBSH_OVERFLOW BIT(30) +#define K8_NBSH_UC_ERR BIT(29) +#define K8_NBSH_ERR_EN BIT(28) +#define K8_NBSH_MISCV BIT(27) +#define K8_NBSH_VALID_ERROR_ADDR BIT(26) +#define K8_NBSH_PCC BIT(25) +#define K8_NBSH_ERR_CPU_VAL BIT(24) +#define K8_NBSH_CECC BIT(14) +#define K8_NBSH_UECC BIT(13) +#define K8_NBSH_ERR_SCRUBER BIT(8) + +extern const char *tt_msgs[]; +extern const char *ll_msgs[]; +extern const char *rrrr_msgs[]; +extern const char *pp_msgs[]; +extern const char *to_msgs[]; +extern const char *ii_msgs[]; +extern const char *ext_msgs[]; + +/* + * relevant NB regs + */ +struct err_regs { + u32 nbcfg; + u32 nbsh; + u32 nbsl; + u32 nbeah; + u32 nbeal; +}; + +void amd_report_gart_errors(bool); +void amd_register_ecc_decoder(void (*f)(int, struct mce *, u32)); +void amd_unregister_ecc_decoder(void (*f)(int, struct mce *, u32)); +void amd_decode_nb_mce(int, struct mce *, u32); +int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data); + +#endif /* _EDAC_MCE_AMD_H */ -- cgit v1.1 From 888ab8e6eb2e41179cdc8edf5d0abd1cce0f0370 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Wed, 18 Aug 2010 15:11:35 +0200 Subject: EDAC, MCE: Adjust DC decoders to F14h Add a per-family data cache decoders. Since there is a certain overlap between the different DC MCE signatures, reuse functionality between the families as far as possible. Signed-off-by: Borislav Petkov --- drivers/edac/mce_amd.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'drivers/edac/mce_amd.h') diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h index 2712a90..85985c2 100644 --- a/drivers/edac/mce_amd.h +++ b/drivers/edac/mce_amd.h @@ -44,6 +44,39 @@ #define K8_NBSH_UECC BIT(13) #define K8_NBSH_ERR_SCRUBER BIT(8) +enum tt_ids { + TT_INSTR = 0, + TT_DATA, + TT_GEN, + TT_RESV, +}; + +enum ll_ids { + LL_RESV = 0, + LL_L1, + LL_L2, + LL_LG, +}; + +enum ii_ids { + II_MEM = 0, + II_RESV, + II_IO, + II_GEN, +}; + +enum rrrr_ids { + R4_GEN = 0, + R4_RD, + R4_WR, + R4_DRD, + R4_DWR, + R4_IRD, + R4_PREF, + R4_EVICT, + R4_SNOOP, +}; + extern const char *tt_msgs[]; extern const char *ll_msgs[]; extern const char *rrrr_msgs[]; @@ -63,6 +96,13 @@ struct err_regs { u32 nbeal; }; +/* + * per-family decoder ops + */ +struct amd_decoder_ops { + bool (*dc_mce)(u16); +}; + void amd_report_gart_errors(bool); void amd_register_ecc_decoder(void (*f)(int, struct mce *, u32)); void amd_unregister_ecc_decoder(void (*f)(int, struct mce *, u32)); -- cgit v1.1 From dd53bce4e8987f6848840d42bbeead5221eff308 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Thu, 26 Aug 2010 19:05:49 +0200 Subject: EDAC, MCE: Adjust IC decoders to F14h Add support for IC MCEs for F14h CPUs. K8 and F10h are almost identical so use one function for both. Signed-off-by: Borislav Petkov --- drivers/edac/mce_amd.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/edac/mce_amd.h') diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h index 85985c2..dc81dba 100644 --- a/drivers/edac/mce_amd.h +++ b/drivers/edac/mce_amd.h @@ -101,6 +101,7 @@ struct err_regs { */ struct amd_decoder_ops { bool (*dc_mce)(u16); + bool (*ic_mce)(u16); }; void amd_report_gart_errors(bool); -- cgit v1.1 From 5ce88f6ea6bef929f59f9468413f922c9a486fa4 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Tue, 31 Aug 2010 18:28:08 +0200 Subject: EDAC, MCE: Complete NB MCE decoders Add support for decoding F14h BU MCEs and improve decoding of the remaining families. Signed-off-by: Borislav Petkov --- drivers/edac/mce_amd.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/edac/mce_amd.h') diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h index dc81dba..0d0637d 100644 --- a/drivers/edac/mce_amd.h +++ b/drivers/edac/mce_amd.h @@ -7,7 +7,6 @@ #define ERROR_CODE(x) ((x) & 0xffff) #define EXT_ERROR_CODE(x) (((x) >> 16) & 0x1f) -#define EXT_ERR_MSG(x) ext_msgs[EXT_ERROR_CODE(x)] #define LOW_SYNDROME(x) (((x) >> 15) & 0xff) #define HIGH_SYNDROME(x) (((x) >> 24) & 0xff) @@ -83,7 +82,6 @@ extern const char *rrrr_msgs[]; extern const char *pp_msgs[]; extern const char *to_msgs[]; extern const char *ii_msgs[]; -extern const char *ext_msgs[]; /* * relevant NB regs @@ -102,6 +100,7 @@ struct err_regs { struct amd_decoder_ops { bool (*dc_mce)(u16); bool (*ic_mce)(u16); + bool (*nb_mce)(u16, u8); }; void amd_report_gart_errors(bool); -- cgit v1.1 From cf1d2200dbc214c26a116c4d0c75b7cf27bb19b6 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Fri, 15 Oct 2010 15:20:18 +0200 Subject: EDAC, MCE: Add a BIT_64() macro Add a macro for 64-bit vectors to use when accessing MSR contents. Signed-off-by: Borislav Petkov --- drivers/edac/mce_amd.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/edac/mce_amd.h') diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h index 0d0637d..35f6e0e 100644 --- a/drivers/edac/mce_amd.h +++ b/drivers/edac/mce_amd.h @@ -5,6 +5,8 @@ #include +#define BIT_64(n) (U64_C(1) << (n)) + #define ERROR_CODE(x) ((x) & 0xffff) #define EXT_ERROR_CODE(x) (((x) >> 16) & 0x1f) -- cgit v1.1