Re: [PATCH v4 1/4] x86/kvm: Add "nopvspin" parameter to disable PV spinlocks

2019-10-07 Thread Zhenzhong Duan
On 2019/10/7 22:46, Boris Ostrovsky wrote: On 10/6/19 3:49 AM, Zhenzhong Duan wrote: On 2019/10/4 22:52, Boris Ostrovsky wrote: On 10/3/19 10:02 AM, Zhenzhong Duan wrote:   void __init kvm_spinlock_init(void)   { -    /* Does host kernel support KVM_FEATURE_PV_UNHALT? */ -    if

Re: [PATCH v4 1/4] x86/kvm: Add "nopvspin" parameter to disable PV spinlocks

2019-10-07 Thread Boris Ostrovsky
On 10/6/19 3:49 AM, Zhenzhong Duan wrote: > On 2019/10/4 22:52, Boris Ostrovsky wrote: > >> On 10/3/19 10:02 AM, Zhenzhong Duan wrote: >>>   void __init kvm_spinlock_init(void) >>>   { >>> -    /* Does host kernel support KVM_FEATURE_PV_UNHALT? */ >>> -    if

Re: [PATCH v4 1/4] x86/kvm: Add "nopvspin" parameter to disable PV spinlocks

2019-10-06 Thread Zhenzhong Duan
On 2019/10/4 22:52, Boris Ostrovsky wrote: On 10/3/19 10:02 AM, Zhenzhong Duan wrote: void __init kvm_spinlock_init(void) { - /* Does host kernel support KVM_FEATURE_PV_UNHALT? */ - if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT)) - return; - - if

Re: [PATCH v4 1/4] x86/kvm: Add "nopvspin" parameter to disable PV spinlocks

2019-10-04 Thread Boris Ostrovsky
On 10/3/19 10:02 AM, Zhenzhong Duan wrote: > void __init kvm_spinlock_init(void) > { > - /* Does host kernel support KVM_FEATURE_PV_UNHALT? */ > - if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT)) > - return; > - > - if (kvm_para_has_hint(KVM_HINTS_REALTIME)) > + /* >

[PATCH v4 1/4] x86/kvm: Add "nopvspin" parameter to disable PV spinlocks

2019-10-04 Thread Zhenzhong Duan
There are cases where a guest tries to switch spinlocks to bare metal behavior (e.g. by setting "xen_nopvspin" on XEN platform and "hv_nopvspin" on HYPER_V). That feature is missed on KVM, add a new parameter "nopvspin" to disable PV spinlocks for KVM guest. The new 'nopvspin' parameter will