aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu/perf_event.h
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-03-07 14:52:43 -0800
committerOlof Johansson <olof@lixom.net>2012-03-07 14:53:14 -0800
commit591e7afd2e686394912d65a6faeb933b76b26b5d (patch)
tree5e992381e6d9456d6293d16ad1c2ed36efcb7bd3 /arch/x86/kernel/cpu/perf_event.h
parentff0ea1ee058e3906502452eba60fd220ece4401d (diff)
parentc9f46a850a07dcf45ee195b958593fae1b78c221 (diff)
Merge branch 'maintainers' of git://gitorious.org/linux-davinci/linux-davinci into next/maintainers
* 'maintainers' of git://gitorious.org/linux-davinci/linux-davinci: (2 commits) MAINTAINERS: add TI DaVinci git tree information MAINTAINERS: mark TI DaVinci list as "moderated" (also included an update to 3.3-rc6) Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_event.h')
-rw-r--r--arch/x86/kernel/cpu/perf_event.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h
index 8944062f46e..c30c807ddc7 100644
--- a/arch/x86/kernel/cpu/perf_event.h
+++ b/arch/x86/kernel/cpu/perf_event.h
@@ -147,7 +147,9 @@ struct cpu_hw_events {
/*
* AMD specific bits
*/
- struct amd_nb *amd_nb;
+ struct amd_nb *amd_nb;
+ /* Inverted mask of bits to clear in the perf_ctr ctrl registers */
+ u64 perf_ctr_virt_mask;
void *kfree_on_online;
};
@@ -417,9 +419,11 @@ void x86_pmu_disable_all(void);
static inline void __x86_pmu_enable_event(struct hw_perf_event *hwc,
u64 enable_mask)
{
+ u64 disable_mask = __this_cpu_read(cpu_hw_events.perf_ctr_virt_mask);
+
if (hwc->extra_reg.reg)
wrmsrl(hwc->extra_reg.reg, hwc->extra_reg.config);
- wrmsrl(hwc->config_base, hwc->config | enable_mask);
+ wrmsrl(hwc->config_base, (hwc->config | enable_mask) & ~disable_mask);
}
void x86_pmu_enable_all(int added);