]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: omit "impossible" pmu MSRs from MSR list
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 1 Oct 2019 13:33:07 +0000 (15:33 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 4 Oct 2019 12:01:28 +0000 (14:01 +0200)
commit747814f21e8fdceb63d05228152004b004be0779
treea1c70907c8be2603235a2c33b0f99b878c3fdbac
parentcfd9efc32867e9dd9a81e5f19c5a3c46c7edbd08
KVM: x86: omit "impossible" pmu MSRs from MSR list

INTEL_PMC_MAX_GENERIC is currently 32, which exceeds the 18
contiguous MSR indices reserved by Intel for event selectors.
Since some machines actually have MSRs past the reserved range,
filtering them against x86_pmu.num_counters_gp may have false
positives.  Cut the list to 18 entries to avoid this.

Reported-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Suggested-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Jim Mattson <jamttson@google.com>
Fixes: 40fc5149497e ("kvm: x86: Add Intel PMU MSRs to msrs_to_save[]", 2019-08-21)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c