Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312792
b: refs/heads/master
c: 336d335
h: refs/heads/master
v: v3
  • Loading branch information
Borislav Petkov committed Jun 7, 2012
1 parent 15a1718 commit 2d23cf4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6e927361bd403dbf5f6a2668a2a07df1f1b2daff
refs/heads/master: 336d335a963a5a4f5d7f915b4d74ada5d7b4d05b
35 changes: 31 additions & 4 deletions trunk/arch/x86/kernel/cpu/mcheck/mce_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@
#define MASK_BLKPTR_LO 0xFF000000
#define MCG_XBLK_ADDR 0xC0000400

static const char * const th_names[] = {
"load_store",
"insn_fetch",
"combined_unit",
"",
"northbridge",
"execution_unit",
};

static DEFINE_PER_CPU(struct threshold_bank * [NR_BANKS], threshold_banks);

static unsigned char shared_bank[NR_BANKS] = {
Expand All @@ -68,6 +77,26 @@ struct thresh_restart {
u16 old_limit;
};

static const char * const bank4_names(struct threshold_block *b)
{
switch (b->address) {
/* MSR4_MISC0 */
case 0x00000413:
return "dram";

case 0xc0000408:
return "ht_links";

case 0xc0000409:
return "l3_cache";

default:
WARN(1, "Funny MSR: 0x%08x\n", b->address);
return "";
}
};


static bool lvt_interrupt_supported(unsigned int bank, u32 msr_high_bits)
{
/*
Expand Down Expand Up @@ -481,7 +510,7 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu,

err = kobject_init_and_add(&b->kobj, &threshold_ktype,
per_cpu(threshold_banks, cpu)[bank]->kobj,
"misc%i", block);
(bank == 4 ? bank4_names(b) : th_names[bank]));
if (err)
goto out_free;
recurse:
Expand Down Expand Up @@ -541,11 +570,9 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
struct device *dev = per_cpu(mce_device, cpu);
struct amd_northbridge *nb = NULL;
struct threshold_bank *b = NULL;
char name[32];
const char *name = th_names[bank];
int err = 0;

sprintf(name, "threshold_bank%i", bank);

if (shared_bank[bank]) {

nb = node_to_amd_nb(amd_get_nb_id(cpu));
Expand Down

0 comments on commit 2d23cf4

Please sign in to comment.