Skip to content

Commit 6cbee2b

Browse files
calmisibonzini
authored andcommitted
KVM: X86: Reset the three MSR list number variables to 0 in kvm_init_msr_list()
When applying commit 7a5ee6e ("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: 7a5ee6e (KVM: X86: Fix initialization of MSR lists) Signed-off-by: Xiaoyao Li <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent e37f9f1 commit 6cbee2b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/kvm/x86.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5130,6 +5130,10 @@ static void kvm_init_msr_list(void)
51305130

51315131
perf_get_x86_pmu_capability(&x86_pmu);
51325132

5133+
num_msrs_to_save = 0;
5134+
num_emulated_msrs = 0;
5135+
num_msr_based_features = 0;
5136+
51335137
for (i = 0; i < ARRAY_SIZE(msrs_to_save_all); i++) {
51345138
if (rdmsr_safe(msrs_to_save_all[i], &dummy[0], &dummy[1]) < 0)
51355139
continue;

0 commit comments

Comments
 (0)