diff options
author | Gleb Natapov <gleb@redhat.com> | 2012-02-26 09:55:42 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-03-08 07:13:34 -0500 |
commit | 62079d8a431287a4da81db64e002c71f0e06ca83 (patch) | |
tree | 774d3dc7cebfc938863b47d0048ad3c79c953d21 /arch/x86 | |
parent | fac3368310765ade6bbdf07c9acdb04210e8b5b0 (diff) |
KVM: PMU: add proper support for fixed counter 2
Currently pmu emulation emulates fixed counter 2 as bus cycles
architectural counter, but since commit 9c1497ea591b25d perf has
pseudo encoding for it. Use it.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/pmu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index b52a8ed283b2..a73f0c104813 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c | |||
@@ -33,10 +33,11 @@ static struct kvm_arch_event_perf_mapping { | |||
33 | [4] = { 0x2e, 0x41, PERF_COUNT_HW_CACHE_MISSES }, | 33 | [4] = { 0x2e, 0x41, PERF_COUNT_HW_CACHE_MISSES }, |
34 | [5] = { 0xc4, 0x00, PERF_COUNT_HW_BRANCH_INSTRUCTIONS }, | 34 | [5] = { 0xc4, 0x00, PERF_COUNT_HW_BRANCH_INSTRUCTIONS }, |
35 | [6] = { 0xc5, 0x00, PERF_COUNT_HW_BRANCH_MISSES }, | 35 | [6] = { 0xc5, 0x00, PERF_COUNT_HW_BRANCH_MISSES }, |
36 | [7] = { 0x00, 0x30, PERF_COUNT_HW_REF_CPU_CYCLES }, | ||
36 | }; | 37 | }; |
37 | 38 | ||
38 | /* mapping between fixed pmc index and arch_events array */ | 39 | /* mapping between fixed pmc index and arch_events array */ |
39 | int fixed_pmc_events[] = {1, 0, 2}; | 40 | int fixed_pmc_events[] = {1, 0, 7}; |
40 | 41 | ||
41 | static bool pmc_is_gp(struct kvm_pmc *pmc) | 42 | static bool pmc_is_gp(struct kvm_pmc *pmc) |
42 | { | 43 | { |