lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 4 Oct 2019 10:52:45 -0400
From:   Boris Ostrovsky <boris.ostrovsky@...cle.com>
To:     Zhenzhong Duan <zhenzhong.duan@...cle.com>,
        linux-kernel@...r.kernel.org
Cc:     vkuznets@...hat.com, linux-hyperv@...r.kernel.org,
        kvm@...r.kernel.org, kys@...rosoft.com, haiyangz@...rosoft.com,
        sthemmin@...rosoft.com, sashal@...nel.org, tglx@...utronix.de,
        mingo@...hat.com, bp@...en8.de, pbonzini@...hat.com,
        rkrcmar@...hat.com, sean.j.christopherson@...el.com,
        wanpengli@...cent.com, jmattson@...gle.com, joro@...tes.org,
        jgross@...e.com, sstabellini@...nel.org, peterz@...radead.org,
        Jonathan Corbet <corbet@....net>,
        "H. Peter Anvin" <hpa@...or.com>, Will Deacon <will@...nel.org>
Subject: Re: [PATCH v4 1/4] x86/kvm: Add "nopvspin" parameter to disable PV
 spinlocks

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))
> +	/*
> +	 * Don't use the pvqspinlock code if no KVM_FEATURE_PV_UNHALT feature
> +	 * support, or there is REALTIME hints or only 1 vCPU.
> +	 */
> +	if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT) ||
> +	    kvm_para_has_hint(KVM_HINTS_REALTIME) ||
> +	    num_possible_cpus() == 1) {
> +		pr_info("PV spinlocks disabled\n");
>  		return;
> +	}
>  
> -	/* Don't use the pvqspinlock code if there is only 1 vCPU. */
> -	if (num_possible_cpus() == 1)
> +	if (nopvspin) {
> +		pr_info("PV spinlocks disabled forced by \"nopvspin\" parameter.\n");
> +		static_branch_disable(&virt_spin_lock_key);

Would it make sense to bring here the other site where the key is
disabled (in kvm_smp_prepare_cpus())?

(and, in fact, shouldn't all of the checks that result in early return
above disable the key?)

-boris

>  		return;
> +	}
> +	pr_info("PV spinlocks enabled\n");
>  
>  	__pv_init_lock_hash();
>  	pv_ops.lock.queued_spin_lock_slowpath = __pv_queued_spin_lock_slowpath;
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ