Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-06-30 Thread Maxim Levitsky
On Thu, 2020-05-21 at 10:40 +0200, Paolo Bonzini wrote: > On 21/05/20 08:44, Tao Xu wrote: > > I am sorry, I mean: > > By default, we don't expose WAITPKG to guest. For QEMU, we can use > > "-overcommit cpu-pm=on" to use WAITPKG. > > But UMONITOR, UMWAIT and TPAUSE are not NOPs on older processors

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-27 Thread Maxim Levitsky
On Tue, 2020-05-26 at 18:21 -0700, Sean Christopherson wrote: > On Sat, May 23, 2020 at 07:14:55PM +0300, Maxim Levitsky wrote: > > This msr is only available when the host supports WAITPKG feature. > > > > This breaks a nested guest, if the L1 hypervisor is set to ignore > > unknown msrs, because

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-26 Thread Sean Christopherson
On Sat, May 23, 2020 at 07:14:55PM +0300, Maxim Levitsky wrote: > This msr is only available when the host supports WAITPKG feature. > > This breaks a nested guest, if the L1 hypervisor is set to ignore > unknown msrs, because the only other safety check that the > kernel does is that it attempts

[PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-23 Thread Maxim Levitsky
This msr is only available when the host supports WAITPKG feature. This breaks a nested guest, if the L1 hypervisor is set to ignore unknown msrs, because the only other safety check that the kernel does is that it attempts to read the msr and rejects it if it gets an exception. Fixes: 6e3ba4abce

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-21 Thread Paolo Bonzini
On 21/05/20 08:44, Tao Xu wrote: > > I am sorry, I mean: > By default, we don't expose WAITPKG to guest. For QEMU, we can use > "-overcommit cpu-pm=on" to use WAITPKG. But UMONITOR, UMWAIT and TPAUSE are not NOPs on older processors (which I should have checked before committing your patch, I adm

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-21 Thread Paolo Bonzini
On 21/05/20 06:33, Xiaoyao Li wrote: > I remember there is certainly some reason why we don't expose WAITPKG to > guest by default. That's a userspace policy decision. KVM_GET_SUPPORTED_CPUID should still tell userspace that it's supported. Paolo > Tao, please help clarify it.

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-21 Thread Xiaoyao Li
On 5/21/2020 12:56 AM, Maxim Levitsky wrote: On Wed, 2020-05-20 at 18:33 +0200, Vitaly Kuznetsov wrote: Maxim Levitsky writes: This msr is only available when the host supports WAITPKG feature. This breaks a nested guest, if the L1 hypervisor is set to ignore unknown msrs, because the only o

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-20 Thread Tao Xu
On 5/21/2020 2:37 PM, Xiaoyao Li wrote: On 5/21/2020 1:28 PM, Tao Xu wrote: On 5/21/2020 12:33 PM, Xiaoyao Li wrote: On 5/21/2020 5:05 AM, Paolo Bonzini wrote: On 20/05/20 18:07, Maxim Levitsky wrote: This msr is only available when the host supports WAITPKG feature. This breaks a neste

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-20 Thread Xiaoyao Li
On 5/21/2020 1:28 PM, Tao Xu wrote: On 5/21/2020 12:33 PM, Xiaoyao Li wrote: On 5/21/2020 5:05 AM, Paolo Bonzini wrote: On 20/05/20 18:07, Maxim Levitsky wrote: This msr is only available when the host supports WAITPKG feature. This breaks a nested guest, if the L1 hypervisor is set to igno

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-20 Thread Tao Xu
On 5/21/2020 12:33 PM, Xiaoyao Li wrote: On 5/21/2020 5:05 AM, Paolo Bonzini wrote: On 20/05/20 18:07, Maxim Levitsky wrote: This msr is only available when the host supports WAITPKG feature. This breaks a nested guest, if the L1 hypervisor is set to ignore unknown msrs, because the only ot

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-20 Thread Xiaoyao Li
On 5/21/2020 5:05 AM, Paolo Bonzini wrote: On 20/05/20 18:07, Maxim Levitsky wrote: This msr is only available when the host supports WAITPKG feature. This breaks a nested guest, if the L1 hypervisor is set to ignore unknown msrs, because the only other safety check that the kernel does is that

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-20 Thread Maxim Levitsky
On Wed, 2020-05-20 at 23:05 +0200, Paolo Bonzini wrote: > On 20/05/20 18:07, Maxim Levitsky wrote: > > This msr is only available when the host supports WAITPKG feature. > > > > This breaks a nested guest, if the L1 hypervisor is set to ignore > > unknown msrs, because the only other safety check

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-20 Thread Paolo Bonzini
On 20/05/20 18:07, Maxim Levitsky wrote: > This msr is only available when the host supports WAITPKG feature. > > This breaks a nested guest, if the L1 hypervisor is set to ignore > unknown msrs, because the only other safety check that the > kernel does is that it attempts to read the msr and > r

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-20 Thread Maxim Levitsky
On Wed, 2020-05-20 at 19:15 +0200, Vitaly Kuznetsov wrote: > Maxim Levitsky writes: > > > On Wed, 2020-05-20 at 18:33 +0200, Vitaly Kuznetsov wrote: > > > Maxim Levitsky writes: > > > > > > > This msr is only available when the host supports WAITPKG feature. > > > > > > > > This breaks a neste

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-20 Thread Vitaly Kuznetsov
Maxim Levitsky writes: > On Wed, 2020-05-20 at 18:33 +0200, Vitaly Kuznetsov wrote: >> Maxim Levitsky writes: >> >> > This msr is only available when the host supports WAITPKG feature. >> > >> > This breaks a nested guest, if the L1 hypervisor is set to ignore >> > unknown msrs, because the on

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-20 Thread Maxim Levitsky
On Wed, 2020-05-20 at 18:33 +0200, Vitaly Kuznetsov wrote: > Maxim Levitsky writes: > > > This msr is only available when the host supports WAITPKG feature. > > > > This breaks a nested guest, if the L1 hypervisor is set to ignore > > unknown msrs, because the only other safety check that the >

Re: [PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-20 Thread Vitaly Kuznetsov
Maxim Levitsky writes: > This msr is only available when the host supports WAITPKG feature. > > This breaks a nested guest, if the L1 hypervisor is set to ignore > unknown msrs, because the only other safety check that the > kernel does is that it attempts to read the msr and > rejects it if it g

[PATCH 2/2] kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally

2020-05-20 Thread Maxim Levitsky
This msr is only available when the host supports WAITPKG feature. This breaks a nested guest, if the L1 hypervisor is set to ignore unknown msrs, because the only other safety check that the kernel does is that it attempts to read the msr and rejects it if it gets an exception. Fixes: 6e3ba4abce