On 30/06/20 18:07, Maxim Levitsky wrote: > I think we need to keep some form of this hack, since the kernel doesn't > report CPUID_7_0_ECX_WAITPKG via > KVM_GET_SUPPORTED_CPUID, so for this to work, we need to fix the kernel to > report it. > But to support older kernels that don't report this bit, we might still need > this. > What do you think? > > Note that kvm_arch_get_supported_cpuid also has a override for what KVM > reports about CPUID_EXT_MONITOR > via KVM_GET_SUPPORTED_CPUID when cpu_pm=on and also does this without > checking any conditions, > and it works because MWAIT is very old feature, and I guess it was the > inspiration for the above override > that we are trying to remove. > > Kernel sadly masks both MWAIT and WAITPKG in KVM_GET_SUPPORTED_CPUID currently > (it is in kvm_set_cpu_caps)
Right. We need to use host_cpuid instead of kvm_arch_get_supported_cpuid. Paolo