Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1069754ybn; Wed, 2 Oct 2019 10:21:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcwcerqUE0JkrH4tjLfia09Sd5kbD/25pUqoGveUu3YxGghBACRZaclV1vGPBZKtKF8qaZ X-Received: by 2002:a50:f19c:: with SMTP id x28mr4985163edl.42.1570036908706; Wed, 02 Oct 2019 10:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570036908; cv=none; d=google.com; s=arc-20160816; b=wT3+J4n/tWgilNZhhZihfz/pDcfttN1OXCZ6EUtMG3+FzvrBGywgxobKAbpGER33XQ XbZJhOiUs9OfdkZdGbo/mvlbGpuQYcOi78SPXR9iPHtaI76FDtsRlSvIFI8o1zreOPt7 +0Et4O+whToAl9+0g3JarR9uv/wQFwODUmhE+la09jYn/0ZASGzgELIhLeV0w7CccSSX c9I5aAhVqbYSbPvxPbouwe24sIfWnUCzntKvS5NYEI9HEYRQxE1FrKWWJN63ornDjEb7 UrsZJ8uWEwawwuzJal9eK4cx80+tVj7FNz7GppgE5wH5k5HYxmO2/Izw1ItPWE0KFThs H6fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=BgS9HHvbOMSCJXQcNOlamDtZhVNS13H91IQRw74xTgw=; b=u419WLHKmxxKNaL8aawKiZPDQB2QTIaeh0e7PipgW+eglut9anim/95aeOCDAd7L+d KEYaF+OUNx3Lw9S0Q8Ap2gNJ+cl3KFAxg+z5cR2n2bvZJvPKMTvHSO6gvXfvCgpmfJvy nIzTd8owDB5MbVTXYFLXM0TnEO+uC60nhtt+aj+/m/F2NlyO1ehp70srVzpFXNT5H3da 2dPTGlev0egJE7nzCCV6+dJIl520ZNmRyi7HK2S3mL+anM6pwN6Ac+nzaAQB/3FTl1OQ cBvyCq425ur+4XFpDrlwrhrF3JONtk962jHdxYZqPTtGvvK91K6cANCOfsuDW+JiMqgQ TM3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f43si12975499edf.422.2019.10.02.10.21.23; Wed, 02 Oct 2019 10:21:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728810AbfJBRTx (ORCPT + 99 others); Wed, 2 Oct 2019 13:19:53 -0400 Received: from mga02.intel.com ([134.134.136.20]:27107 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728199AbfJBRTx (ORCPT ); Wed, 2 Oct 2019 13:19:53 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2019 10:19:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,249,1566889200"; d="scan'208";a="196066711" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.41]) by orsmga006.jf.intel.com with ESMTP; 02 Oct 2019 10:19:52 -0700 Date: Wed, 2 Oct 2019 10:19:52 -0700 From: Sean Christopherson To: Zhenzhong Duan Cc: linux-kernel@vger.kernel.org, vkuznets@redhat.com, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, Jonathan Corbet , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Sasha Levin , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: Re: [PATCH v3 4/4] x86/hyperv: Mark "hv_nopvspin" parameter obsolete and map it to "nopvspin" Message-ID: <20191002171952.GE9615@linux.intel.com> References: <1569847479-13201-1-git-send-email-zhenzhong.duan@oracle.com> <1569847479-13201-5-git-send-email-zhenzhong.duan@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1569847479-13201-5-git-send-email-zhenzhong.duan@oracle.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Cc: Jonathan Corbet > Cc: "K. Y. Srinivasan" > Cc: Haiyang Zhang > Cc: Stephen Hemminger > Cc: Sasha Levin > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: "H. Peter Anvin" > --- > Documentation/admin-guide/kernel-parameters.txt | 6 +++++- > arch/x86/hyperv/hv_spinlock.c | 9 +++++---- > 2 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 1f0a62f..43f922c 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -1436,6 +1436,10 @@ > hv_nopvspin [X86,HYPER_V] Disables the paravirt spinlock optimizations > which allow the hypervisor to 'idle' the > guest on lock contention. > + This parameter is obsoleted by "nopvspin" > + parameter, which has equivalent effect for > + HYPER_V platform. > + > > keep_bootcon [KNL] > Do not unregister boot console at start. This is only > @@ -5331,7 +5335,7 @@ > as generic guest with no PV drivers. Currently support > XEN HVM, KVM, HYPER_V and VMWARE guest. > > - nopvspin [X86,XEN,KVM] Disables the qspinlock slow path > + nopvspin [X86,XEN,KVM,HYPER_V] Disables the qspinlock slow path > using PV optimizations which allow the hypervisor to > 'idle' the guest on lock contention. > > diff --git a/arch/x86/hyperv/hv_spinlock.c b/arch/x86/hyperv/hv_spinlock.c > index 07f21a0..e00e319 100644 > --- a/arch/x86/hyperv/hv_spinlock.c > +++ b/arch/x86/hyperv/hv_spinlock.c > @@ -12,12 +12,11 @@ > > #include > > +#include > #include > #include > #include > > -static bool __initdata hv_pvspin = true; > - > static void hv_qlock_kick(int cpu) > { > apic->send_IPI(cpu, X86_PLATFORM_IPI_VECTOR); > @@ -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(). > return 0; > } > early_param("hv_nopvspin", hv_parse_nopvspin); > -- > 1.8.3.1 >