Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312790
b: refs/heads/master
c: 2c9c42f
h: refs/heads/master
v: v3
  • Loading branch information
Borislav Petkov committed Jun 7, 2012
1 parent efdc687 commit 9902471
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 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: 18c20f373b76a64270a991396b06542abaf9f530
refs/heads/master: 2c9c42fa98c283961b7f6b6542fb4bf0c0539e15
23 changes: 5 additions & 18 deletions trunk/arch/x86/kernel/cpu/mcheck/mce_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,27 +359,14 @@ store_threshold_limit(struct threshold_block *b, const char *buf, size_t size)
return size;
}

struct threshold_block_cross_cpu {
struct threshold_block *tb;
long retval;
};

static void local_error_count_handler(void *_tbcc)
{
struct threshold_block_cross_cpu *tbcc = _tbcc;
struct threshold_block *b = tbcc->tb;
u32 low, high;

rdmsr(b->address, low, high);
tbcc->retval = (high & 0xFFF) - (THRESHOLD_MAX - b->threshold_limit);
}

static ssize_t show_error_count(struct threshold_block *b, char *buf)
{
struct threshold_block_cross_cpu tbcc = { .tb = b, };
u32 lo, hi;

rdmsr_on_cpu(b->cpu, b->address, &lo, &hi);

smp_call_function_single(b->cpu, local_error_count_handler, &tbcc, 1);
return sprintf(buf, "%lu\n", tbcc.retval);
return sprintf(buf, "%u\n", ((hi & THRESHOLD_MAX) -
(THRESHOLD_MAX - b->threshold_limit)));
}

static ssize_t store_error_count(struct threshold_block *b,
Expand Down

0 comments on commit 9902471

Please sign in to comment.