Skip to content
Commit 24c29b7a authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

KVM: x86: omit absent 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, these may survive the
filtering of msrs_to_save array and would be rejected by KVM_GET/SET_MSR.
To avoid this, cut the list to whatever CPUID reports for the host's
architectural PMU.

Reported-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Suggested-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Cc: Jim Mattson <jmattson@google.com>
Fixes: e2ada66e ("kvm: x86: Add Intel PMU MSRs to msrs_to_save[]", 2019-08-21)
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 6e06983d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment