KVM: VMX: Add helper to check reserved bits in IA32_PERF_GLOBAL_CTRL
authorOliver Upton <oupton@google.com>
Thu, 14 Nov 2019 00:17:15 +0000 (16:17 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 15 Nov 2019 10:44:13 +0000 (11:44 +0100)
commit9477f4449b0b011ce1d058c09ec450bfcdaab784
treecf312302e08c6429b487c1a2bb3b4eb545a08a7b
parentf245eeaddc3e442b761de8e9d1b93893a999f9aa
KVM: VMX: Add helper to check reserved bits in IA32_PERF_GLOBAL_CTRL

Create a helper function to check the validity of a proposed value for
IA32_PERF_GLOBAL_CTRL from the existing check in intel_pmu_set_msr().

Per Intel's SDM, the reserved bits in IA32_PERF_GLOBAL_CTRL must be
cleared for the corresponding host/guest state fields.

Suggested-by: Jim Mattson <jmattson@google.com>
Co-developed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Signed-off-by: Oliver Upton <oupton@google.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/pmu.h
arch/x86/kvm/vmx/pmu_intel.c