Re: [PATCH v5 1/2] x86/cpu: Add support for UMONITOR/UMWAIT/TPAUSE

2019-10-09 Thread Paolo Bonzini
On 29/09/19 03:57, Tao Xu wrote: > +} else if (function == 7 && index == 0 && reg == R_ECX) { > +if (enable_cpu_pm) { > +ret |= CPUID_7_0_ECX_WAITPKG; This is incorrect. You should disable WAITPKG if !enable_cpu_pm, but you should not enable it forcefully if enable_cpu_pm

Re: [PATCH v5 1/2] x86/cpu: Add support for UMONITOR/UMWAIT/TPAUSE

2019-10-09 Thread Tao Xu
On 10/9/2019 4:06 PM, Paolo Bonzini wrote: On 29/09/19 03:57, Tao Xu wrote: +} else if (function == 7 && index == 0 && reg == R_ECX) { +if (enable_cpu_pm) { +ret |= CPUID_7_0_ECX_WAITPKG; This is incorrect. You should disable WAITPKG if !enable_cpu_pm, but you should n

[PATCH v5 1/2] x86/cpu: Add support for UMONITOR/UMWAIT/TPAUSE

2019-09-28 Thread Tao Xu
UMONITOR, UMWAIT and TPAUSE are a set of user wait instructions. This patch adds support for user wait instructions in KVM. Availability of the user wait instructions is indicated by the presence of the CPUID feature flag WAITPKG CPUID.0x07.0x0:ECX[5]. User wait instructions may be executed at any