Skip to content
Snippets Groups Projects
user avatar
Vitaly Kuznetsov authored
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2119111



commit 6348aafa
Author: Sean Christopherson <seanjc@google.com>
Date:   Wed Jul 27 23:34:24 2022 +0000

    KVM: VMX: Adjust number of LBR records for PERF_CAPABILITIES at refresh

    Now that the PMU is refreshed when MSR_IA32_PERF_CAPABILITIES is written
    by host userspace, zero out the number of LBR records for a vCPU during
    PMU refresh if PMU_CAP_LBR_FMT is not set in PERF_CAPABILITIES instead of
    handling the check at run-time.

    guest_cpuid_has() is expensive due to the linear search of guest CPUID
    entries, intel_pmu_lbr_is_enabled() is checked on every VM-Enter, _and_
    simply enumerating the same "Model" as the host causes KVM to set the
    number of LBR records to a non-zero value.

Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
    Message-Id: <20220727233424.2968356-4-seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>

Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
a3522737
Name Last commit Last update