From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DATE_IN_PAST_12_24, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF8D9ECE58A for ; Tue, 1 Oct 2019 12:40:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B5DC421920 for ; Tue, 1 Oct 2019 12:40:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="kWQA8bGg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387935AbfJAMkn (ORCPT ); Tue, 1 Oct 2019 08:40:43 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:56238 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731685AbfJAMkm (ORCPT ); Tue, 1 Oct 2019 08:40:42 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x91CO9xB189415; Tue, 1 Oct 2019 12:40:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2019-08-05; bh=tmIzy72qo+rS2sy4J+XBqwA5jvB3VFv9TPhVygdVa7Y=; b=kWQA8bGgkUtKe2qYLz2nbdy/72JuavFBsGKY2SQwgaG/BkQZXwZoUWfdA5v8005nVILl s+BELxWHEusy2j96GG045p5V4oEtPyxkKt47/4t8BpUn8BY7l18cygkuKvrYo214CFgH +2iNatq7OJnbt7cQPHqJcKX7hhZ9xcALf+7lrF5r3Z7hZDcz30cATfNhPwFs6EfksM5U keipkT62fhgQuseLpZf5XESZErDqbtea+xekHj2ThzgNZ/PGaF63iBido91qk51s/mM8 90N6TPdVkMHdGKI/EwWCpsqsJFosYgpnEPx4gGMwuIRPQZ3zrf3Ir/uldQ/SyuejSYWH qQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2v9xxunhym-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 01 Oct 2019 12:40:12 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x91COQs4039826; Tue, 1 Oct 2019 12:40:12 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2vbqd0sv8f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 01 Oct 2019 12:40:12 +0000 Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x91CeBbh005979; Tue, 1 Oct 2019 12:40:11 GMT Received: from z2.cn.oracle.com (/10.182.71.205) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 01 Oct 2019 05:40:11 -0700 From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Cc: vkuznets@redhat.com, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, Zhenzhong Duan , Jonathan Corbet , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Sasha Levin , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: [PATCH v3 4/4] x86/hyperv: Mark "hv_nopvspin" parameter obsolete and map it to "nopvspin" Date: Mon, 30 Sep 2019 20:44:39 +0800 Message-Id: <1569847479-13201-5-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1569847479-13201-1-git-send-email-zhenzhong.duan@oracle.com> References: <1569847479-13201-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9396 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910010114 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9396 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910010114 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; return 0; } early_param("hv_nopvspin", hv_parse_nopvspin); -- 1.8.3.1