Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312306
b: refs/heads/master
c: f285f92
h: refs/heads/master
v: v3
  • Loading branch information
Robert Richter authored and Ingo Molnar committed Jul 5, 2012
1 parent 5467885 commit 859aa9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 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: b1dc3c4820428ac6216537416b2fcd140fdc52e5
refs/heads/master: f285f92f7e4c9af20149130c8fd5027131b39b0e
8 changes: 5 additions & 3 deletions trunk/arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static void release_pmc_hardware(void) {}

static bool check_hw_exists(void)
{
u64 val, val_new = 0;
u64 val, val_new = ~0;
int i, reg, ret = 0;

/*
Expand Down Expand Up @@ -211,8 +211,9 @@ static bool check_hw_exists(void)
* that don't trap on the MSR access and always return 0s.
*/
val = 0xabcdUL;
ret = wrmsrl_safe(x86_pmu_event_addr(0), val);
ret |= rdmsrl_safe(x86_pmu_event_addr(0), &val_new);
reg = x86_pmu_event_addr(0);
ret = wrmsrl_safe(reg, val);
ret |= rdmsrl_safe(reg, &val_new);
if (ret || val != val_new)
goto msr_fail;

Expand All @@ -229,6 +230,7 @@ static bool check_hw_exists(void)

msr_fail:
printk(KERN_CONT "Broken PMU hardware detected, using software events only.\n");
printk(KERN_ERR "Failed to access perfctr msr (MSR %x is %Lx)\n", reg, val_new);

return false;
}
Expand Down

0 comments on commit 859aa9b

Please sign in to comment.