diff options
author | Xiaoyao Li <xiaoyao.li@intel.com> | 2019-11-13 09:15:21 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-11-13 15:50:39 +0100 |
commit | 6cbee2b9eccfc1c93a03aaa286ec93331f7c95e7 (patch) | |
tree | c97f491e02cb4133c2ff76f09dd33df1fcf0278a | |
parent | e37f9f139f62deddff90c7298ae3a85026a71067 (diff) | |
download | linux-6cbee2b9eccfc1c93a03aaa286ec93331f7c95e7.tar.bz2 |
KVM: X86: Reset the three MSR list number variables to 0 in kvm_init_msr_list()
When applying commit 7a5ee6edb42e ("KVM: X86: Fix initialization of MSR
lists"), it forgot to reset the three MSR lists number varialbes to 0
while removing the useless conditionals.
Fixes: 7a5ee6edb42e (KVM: X86: Fix initialization of MSR lists)
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 7db5c8ef35dd..5d530521f11d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -5130,6 +5130,10 @@ static void kvm_init_msr_list(void) perf_get_x86_pmu_capability(&x86_pmu); + num_msrs_to_save = 0; + num_emulated_msrs = 0; + num_msr_based_features = 0; + for (i = 0; i < ARRAY_SIZE(msrs_to_save_all); i++) { if (rdmsr_safe(msrs_to_save_all[i], &dummy[0], &dummy[1]) < 0) continue; |