@@ -304,6 +304,11 @@ void kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu)
304
304
305
305
cpuid_entry_change (best , X86_FEATURE_APIC ,
306
306
vcpu -> arch .apic_base & MSR_IA32_APICBASE_ENABLE );
307
+
308
+ if (!kvm_check_has_quirk (vcpu -> kvm , KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT ))
309
+ cpuid_entry_change (best , X86_FEATURE_MWAIT ,
310
+ vcpu -> arch .ia32_misc_enable_msr &
311
+ MSR_IA32_MISC_ENABLE_MWAIT );
307
312
}
308
313
309
314
best = kvm_find_cpuid_entry_index (vcpu , 7 , 0 );
@@ -319,14 +324,6 @@ void kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu)
319
324
if (best && (cpuid_entry_has (best , X86_FEATURE_XSAVES ) ||
320
325
cpuid_entry_has (best , X86_FEATURE_XSAVEC )))
321
326
best -> ebx = xstate_required_size (vcpu -> arch .xcr0 , true);
322
-
323
- if (!kvm_check_has_quirk (vcpu -> kvm , KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT )) {
324
- best = kvm_find_cpuid_entry (vcpu , 0x1 );
325
- if (best )
326
- cpuid_entry_change (best , X86_FEATURE_MWAIT ,
327
- vcpu -> arch .ia32_misc_enable_msr &
328
- MSR_IA32_MISC_ENABLE_MWAIT );
329
- }
330
327
}
331
328
EXPORT_SYMBOL_GPL (kvm_update_cpuid_runtime );
332
329
0 commit comments