Skip to content
Commit 83bdfe04 authored by Sean Christopherson's avatar Sean Christopherson
Browse files

KVM: x86/pmu: Avoid CPL lookup if PMC enabline for USER and KERNEL is the same

Don't bother querying the CPL if a PMC is (not) counting for both USER and
KERNEL, i.e. if the end result is guaranteed to be the same regardless of
the CPL.  Querying the CPL on Intel requires a VMREAD, i.e. isn't free,
and a single CMP+Jcc is cheap.

Link: https://lore.kernel.org/r/20231110022857.1273836-11-seanjc@google.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent e35529fb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment