diff options
author | Sean Christopherson <seanjc@google.com> | 2024-03-07 04:13:42 +0300 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2024-04-11 22:58:46 +0300 |
commit | 447112d7edd77fa468938377418434233bcb3709 (patch) | |
tree | a09c7abb357f62c358ce77af2fd47f200affb6de /arch/x86/kvm/vmx/vmx.h | |
parent | 7f2817ef52a1cc3ee0ace35eb8df7a39bd4fc9b7 (diff) | |
download | linux-447112d7edd77fa468938377418434233bcb3709.tar.xz |
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>
Diffstat (limited to 'arch/x86/kvm/vmx/vmx.h')
-rw-r--r-- | arch/x86/kvm/vmx/vmx.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h index 1742c88ba9c8..90f9e4434646 100644 --- a/arch/x86/kvm/vmx/vmx.h +++ b/arch/x86/kvm/vmx/vmx.h @@ -110,6 +110,8 @@ struct lbr_desc { bool msr_passthrough; }; +extern struct x86_pmu_lbr vmx_lbr_caps; + /* * The nested_vmx structure is part of vcpu_vmx, and holds information we need * for correct emulation of VMX (i.e., nested VMX) on this vcpu. |