Re: [PATCH v3 4/4] x86/hyperv: Mark "hv_nopvspin" parameter obsolete and map it to "nopvspin"

From: Zhenzhong Duan
Date: Thu Oct 03 2019 - 07:22:54 EST



On 2019/10/3 1:19, Sean Christopherson wrote:
On Mon, Sep 30, 2019 at 08:44:39PM +0800, Zhenzhong Duan wrote:
Includes asm/hypervisor.h in order to reference x86_hyper_type.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@xxxxxxxxxx>
Cc: Jonathan Corbet <corbet@xxxxxxx>
Cc: "K. Y. Srinivasan" <kys@xxxxxxxxxxxxx>
Cc: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
Cc: Stephen Hemminger <sthemmin@xxxxxxxxxxxxx>
Cc: Sasha Levin <sashal@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
---
...snip
@@ -64,7 +63,7 @@ __visible bool hv_vcpu_is_preempted(int vcpu)
void __init hv_init_spinlocks(void)
{
- if (!hv_pvspin || !apic ||
+ if (!pvspin || !apic ||
!(ms_hyperv.hints & HV_X64_CLUSTER_IPI_RECOMMENDED) ||
!(ms_hyperv.features & HV_X64_MSR_GUEST_IDLE_AVAILABLE)) {
pr_info("PV spinlocks disabled\n");
@@ -82,7 +81,9 @@ void __init hv_init_spinlocks(void)
static __init int hv_parse_nopvspin(char *arg)
{
- hv_pvspin = false;
+ pr_notice("\"hv_nopvspin\" is deprecated, please use \"nopvspin\" instead\n");
+ if (x86_hyper_type == X86_HYPER_MS_HYPERV)
+ pvspin = false;
Personal preference would be to keep the hv_pvspin variable and add the
extra check in hv_init_spinlocks().

OK, will do that way. Thanks

Zhenzhong