]> git.baikalelectronics.ru Git - kernel.git/commit
perf, intel: Use GO/HO bits in perf-ctr
authorGleb Natapov <gleb@redhat.com>
Wed, 5 Oct 2011 12:01:21 +0000 (14:01 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 10 Oct 2011 04:56:42 +0000 (06:56 +0200)
commit86f0c719b97c6514bf6b616c312d0696050d76e2
treea60b87261e4a73e10c594120e238f537b78137af
parent138bf855da764e515cb763f345d6aac787b6179c
perf, intel: Use GO/HO bits in perf-ctr

Intel does not have guest/host-only bit in perf counters like AMD
does.  To support GO/HO bits KVM needs to switch EVENTSELn values
(or PERF_GLOBAL_CTRL if available) at a guest entry. If a counter is
configured to count only in a guest mode it stays disabled in a host,
but VMX is configured to switch it to enabled value during guest entry.

This patch adds GO/HO tracking to Intel perf code and provides interface
for KVM to get a list of MSRs that need to be switched on a guest entry.

Only cpus with architectural PMU (v1 or later) are supported with this
patch.  To my knowledge there is not p6 models with VMX but without
architectural PMU and p4 with VMX are rare and the interface is general
enough to support them if need arise.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1317816084-18026-7-git-send-email-gleb@redhat.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/include/asm/perf_event.h
arch/x86/kernel/cpu/perf_event.h
arch/x86/kernel/cpu/perf_event_intel.c