aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/mcheck
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2012-05-04 11:05:27 -0400
committerBorislav Petkov <borislav.petkov@amd.com>2012-06-07 06:43:48 -0400
commit336d335a963a5a4f5d7f915b4d74ada5d7b4d05b (patch)
treeecf11ed8182ef506cf62a6a24fc1b7143df17cae /arch/x86/kernel/cpu/mcheck
parent6e927361bd403dbf5f6a2668a2a07df1f1b2daff (diff)
x86, MCE, AMD: Give proper names to the thresholding banks
Having the banks numbered is ok but having real names which mean something to the user makes a lot more sense: /sys/devices/system/machinecheck/machinecheck0/ |-- bank0 |-- bank1 |-- bank2 |-- bank3 |-- bank4 |-- bank5 |-- bank6 |-- check_interval |-- cmci_disabled |-- combined_unit | |-- combined_unit | |-- error_count | |-- threshold_limit |-- dont_log_ce |-- execution_unit | |-- execution_unit | |-- error_count | |-- threshold_limit |-- ignore_ce |-- insn_fetch | |-- insn_fetch | |-- error_count | |-- threshold_limit |-- load_store | |-- load_store | |-- error_count | |-- threshold_limit |-- monarch_timeout |-- northbridge | |-- dram | | |-- error_count | | |-- interrupt_enable | | |-- threshold_limit | |-- ht_links | | |-- error_count | | |-- interrupt_enable | | |-- threshold_limit | |-- l3_cache | |-- error_count | |-- interrupt_enable | |-- threshold_limit ... Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'arch/x86/kernel/cpu/mcheck')
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index e5ed2c7cb4de..e20bdf8d7c59 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -46,6 +46,15 @@
46#define MASK_BLKPTR_LO 0xFF000000 46#define MASK_BLKPTR_LO 0xFF000000
47#define MCG_XBLK_ADDR 0xC0000400 47#define MCG_XBLK_ADDR 0xC0000400
48 48
49static const char * const th_names[] = {
50 "load_store",
51 "insn_fetch",
52 "combined_unit",
53 "",
54 "northbridge",
55 "execution_unit",
56};
57
49static DEFINE_PER_CPU(struct threshold_bank * [NR_BANKS], threshold_banks); 58static DEFINE_PER_CPU(struct threshold_bank * [NR_BANKS], threshold_banks);
50 59
51static unsigned char shared_bank[NR_BANKS] = { 60static unsigned char shared_bank[NR_BANKS] = {
@@ -68,6 +77,26 @@ struct thresh_restart {
68 u16 old_limit; 77 u16 old_limit;
69}; 78};
70 79
80static const char * const bank4_names(struct threshold_block *b)
81{
82 switch (b->address) {
83 /* MSR4_MISC0 */
84 case 0x00000413:
85 return "dram";
86
87 case 0xc0000408:
88 return "ht_links";
89
90 case 0xc0000409:
91 return "l3_cache";
92
93 default:
94 WARN(1, "Funny MSR: 0x%08x\n", b->address);
95 return "";
96 }
97};
98
99
71static bool lvt_interrupt_supported(unsigned int bank, u32 msr_high_bits) 100static bool lvt_interrupt_supported(unsigned int bank, u32 msr_high_bits)
72{ 101{
73 /* 102 /*
@@ -481,7 +510,7 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu,
481 510
482 err = kobject_init_and_add(&b->kobj, &threshold_ktype, 511 err = kobject_init_and_add(&b->kobj, &threshold_ktype,
483 per_cpu(threshold_banks, cpu)[bank]->kobj, 512 per_cpu(threshold_banks, cpu)[bank]->kobj,
484 "misc%i", block); 513 (bank == 4 ? bank4_names(b) : th_names[bank]));
485 if (err) 514 if (err)
486 goto out_free; 515 goto out_free;
487recurse: 516recurse:
@@ -541,11 +570,9 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
541 struct device *dev = per_cpu(mce_device, cpu); 570 struct device *dev = per_cpu(mce_device, cpu);
542 struct amd_northbridge *nb = NULL; 571 struct amd_northbridge *nb = NULL;
543 struct threshold_bank *b = NULL; 572 struct threshold_bank *b = NULL;
544 char name[32]; 573 const char *name = th_names[bank];
545 int err = 0; 574 int err = 0;
546 575
547 sprintf(name, "threshold_bank%i", bank);
548
549 if (shared_bank[bank]) { 576 if (shared_bank[bank]) {
550 577
551 nb = node_to_amd_nb(amd_get_nb_id(cpu)); 578 nb = node_to_amd_nb(amd_get_nb_id(cpu));