]> Pileus Git - ~andy/linux/commitdiff
KVM: PMU: Fix raw event check
authorGleb Natapov <gleb@redhat.com>
Sun, 26 Feb 2012 14:55:41 +0000 (16:55 +0200)
committerAvi Kivity <avi@redhat.com>
Thu, 8 Mar 2012 12:13:26 +0000 (14:13 +0200)
If eventsel has EDGE, INV or CMASK set we should create raw counter for
it, but the check is done on a wrong variable. Fix it.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/pmu.c

index 6af9a542e541543088572201a8262242e08b71e7..b52a8ed283b2a74366ae261c52fa71b6e04597fd 100644 (file)
@@ -223,7 +223,7 @@ static void reprogram_gp_counter(struct kvm_pmc *pmc, u64 eventsel)
        event_select = eventsel & ARCH_PERFMON_EVENTSEL_EVENT;
        unit_mask = (eventsel & ARCH_PERFMON_EVENTSEL_UMASK) >> 8;
 
-       if (!(event_select & (ARCH_PERFMON_EVENTSEL_EDGE |
+       if (!(eventsel & (ARCH_PERFMON_EVENTSEL_EDGE |
                                ARCH_PERFMON_EVENTSEL_INV |
                                ARCH_PERFMON_EVENTSEL_CMASK))) {
                config = find_arch_event(&pmc->vcpu->arch.pmu, event_select,