KVM: x86/pmu: Correct the mask used in a pmu event filter lookup
authorAaron Lewis <aaronlewis@google.com>
Tue, 20 Dec 2022 16:12:30 +0000 (16:12 +0000)
committerSean Christopherson <seanjc@google.com>
Tue, 24 Jan 2023 18:06:10 +0000 (10:06 -0800)
commit6a5cba7bed35580effda9fb1872b274da47e6b23
treeacd176cf254c9a1a2fe9dff712f28ef0de78e6c9
parent7cb79f433e75b05d1635aefaa851cfcd1cb7dc4f
KVM: x86/pmu: Correct the mask used in a pmu event filter lookup

When checking if a pmu event the guest is attempting to program should
be filtered, only consider the event select + unit mask in that
decision. Use an architecture specific mask to mask out all other bits,
including bits 35:32 on Intel.  Those bits are not part of the event
select and should not be considered in that decision.

Fixes: 66bb8a065f5a ("KVM: x86: PMU Event Filter")
Signed-off-by: Aaron Lewis <aaronlewis@google.com>
Link: https://lore.kernel.org/r/20221220161236.555143-2-aaronlewis@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/pmu.c
arch/x86/kvm/pmu.h
arch/x86/kvm/svm/pmu.c
arch/x86/kvm/vmx/pmu_intel.c