KVM: x86/pmu: Explicitly check for RDPMC of unsupported Intel PMC types
authorSean Christopherson <seanjc@google.com>
Tue, 9 Jan 2024 23:02:31 +0000 (15:02 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 30 Jan 2024 23:28:02 +0000 (15:28 -0800)
commita634c76b2c1a642d11f5d6e1810181daedcbe0ab
tree4a5073446321b90a64a76715dd0fa9836d24dd3a
parent7a0fc734c20dd1ad9bc1b8b922b61616f31d3823
KVM: x86/pmu: Explicitly check for RDPMC of unsupported Intel PMC types

Explicitly check for attempts to read unsupported PMC types instead of
letting the bounds check fail.  Functionally, letting the check fail is
ok, but it's unnecessarily subtle and does a poor job of documenting the
architectural behavior that KVM is emulating.

Reviewed-by: Dapeng MiĀ  <dapeng1.mi@linux.intel.com>
Tested-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20240109230250.424295-12-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/pmu_intel.c