KVM: VMX: Snapshot LBR capabilities during module initialization
authorSean Christopherson <seanjc@google.com>
Thu, 7 Mar 2024 01:13:42 +0000 (17:13 -0800)
committerSean Christopherson <seanjc@google.com>
Thu, 11 Apr 2024 19:58:46 +0000 (12:58 -0700)
commit447112d7edd77fa468938377418434233bcb3709
treea09c7abb357f62c358ce77af2fd47f200affb6de
parent7f2817ef52a1cc3ee0ace35eb8df7a39bd4fc9b7
KVM: VMX: Snapshot LBR capabilities during module initialization

Snapshot VMX's LBR capabilities once during module initialization instead
of calling into perf every time a vCPU reconfigures its vPMU.  This will
allow massaging the LBR capabilities, e.g. if the CPU doesn't support
callstacks, without having to remember to update multiple locations.

Opportunistically tag vmx_get_perf_capabilities() with __init, as it's
only called from vmx_set_cpu_caps().

Reviewed-by: Mingwei Zhang <mizhang@google.com>
Link: https://lore.kernel.org/r/20240307011344.835640-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/pmu_intel.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/vmx/vmx.h