From patchwork Mon Oct 7 09:04:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenzhong Duan X-Patchwork-Id: 11179191 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 42ACB112B for ; Tue, 8 Oct 2019 09:04:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22D3520867 for ; Tue, 8 Oct 2019 09:04:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Ug0V9g2/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730068AbfJHJEH (ORCPT ); Tue, 8 Oct 2019 05:04:07 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:39164 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbfJHJEH (ORCPT ); Tue, 8 Oct 2019 05:04:07 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x988hY9d149324; Tue, 8 Oct 2019 09:01:59 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=IGWEYxl9bWVz7EM8e449J5MsQV400hBu8xSSmkfuH5Y=; b=Ug0V9g2/xFiWAJ9gcJT8JwES+xE+q3crBqwiDt+3vEZjyAEiYxPiOJCW0sL7jN4S7hcH 9aTMssjDRoIPNznIfnd81gstSNC5WWpOb54GtDMRMvPL6lPjF96gJIyHmlwUXTAVJ4ID HyBRfAEfQftQ3Ew9mNEpv17J4iBx+y/9AJ+oXvGO64kseVDmURntDsqKi7XA7soTVPyL yWRJ50BYI2Vo+VBkcQoOPjGyx623d5GY2TzhIZ/HgcGJpYfmOdxeSBVxN9mT0JZJrtqO Z9+ZKU4M9UOCp/aAQqxfWSg4qkVAwvk07DSVnVnCMxAAVUOxXMxeW/CHUjM9KQE544jO ag== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 2vek4qc3ds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Oct 2019 09:01:59 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x988hvL1027599; Tue, 8 Oct 2019 08:59:58 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2vg205ur7t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Oct 2019 08:59:58 +0000 Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x988xtpe023595; Tue, 8 Oct 2019 08:59:55 GMT Received: from z2.cn.oracle.com (/10.182.71.205) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 08 Oct 2019 01:59:55 -0700 From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Cc: vkuznets@redhat.com, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, sashal@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, pbonzini@redhat.com, rkrcmar@redhat.com, sean.j.christopherson@intel.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org, peterz@infradead.org, Zhenzhong Duan , "H. Peter Anvin" Subject: [PATCH v5 1/5] Revert "KVM: X86: Fix setup the virt_spin_lock_key before static key get initialized" Date: Mon, 7 Oct 2019 17:04:27 +0800 Message-Id: <1570439071-9814-2-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1570439071-9814-1-git-send-email-zhenzhong.duan@oracle.com> References: <1570439071-9814-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9403 signatures=668684 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-1910080089 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9403 signatures=668684 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-1910080089 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This reverts commit 34226b6b70980a8f81fff3c09a2c889f77edeeff. Commit 8990cac6e5ea ("x86/jump_label: Initialize static branching early") adds jump_label_init() call in setup_arch() to make static keys initialized early, so we could use the original simpler code again. The similar change for XEN is in commit 090d54bcbc54 ("Revert "x86/paravirt: Set up the virt_spin_lock_key after static keys get initialized"") Signed-off-by: Zhenzhong Duan Cc: Paolo Bonzini Cc: Radim Krcmar Cc: Sean Christopherson Cc: Vitaly Kuznetsov Cc: Wanpeng Li Cc: Jim Mattson Cc: Joerg Roedel Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Reviewed-by: Vitaly Kuznetsov --- arch/x86/kernel/kvm.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index e820568..3bc6a266 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -527,13 +527,6 @@ static void kvm_smp_send_call_func_ipi(const struct cpumask *mask) } } -static void __init kvm_smp_prepare_cpus(unsigned int max_cpus) -{ - native_smp_prepare_cpus(max_cpus); - if (kvm_para_has_hint(KVM_HINTS_REALTIME)) - static_branch_disable(&virt_spin_lock_key); -} - static void __init kvm_smp_prepare_boot_cpu(void) { /* @@ -633,7 +626,6 @@ static void __init kvm_guest_init(void) apic_set_eoi_write(kvm_guest_apic_eoi_write); #ifdef CONFIG_SMP - smp_ops.smp_prepare_cpus = kvm_smp_prepare_cpus; smp_ops.smp_prepare_boot_cpu = kvm_smp_prepare_boot_cpu; if (kvm_para_has_feature(KVM_FEATURE_PV_SCHED_YIELD) && !kvm_para_has_hint(KVM_HINTS_REALTIME) && @@ -835,8 +827,10 @@ void __init kvm_spinlock_init(void) if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT)) return; - if (kvm_para_has_hint(KVM_HINTS_REALTIME)) + if (kvm_para_has_hint(KVM_HINTS_REALTIME)) { + static_branch_disable(&virt_spin_lock_key); return; + } /* Don't use the pvqspinlock code if there is only 1 vCPU. */ if (num_possible_cpus() == 1) From patchwork Mon Oct 7 09:04:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenzhong Duan X-Patchwork-Id: 11179179 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 72C1C139A for ; Tue, 8 Oct 2019 09:01:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4A679206B6 for ; Tue, 8 Oct 2019 09:01:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="F8eiyRyh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730127AbfJHJBs (ORCPT ); Tue, 8 Oct 2019 05:01:48 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:51318 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729847AbfJHJBq (ORCPT ); Tue, 8 Oct 2019 05:01:46 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x988hcXV176910; Tue, 8 Oct 2019 09:00:03 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=caWQ7jWymKsI+i0kg/thLzHqPJQLW0k0hWxmmHlX0bY=; b=F8eiyRyhDFyUsBulyK7dslgF2TcmSZ2bETCNgELU3WvVvYtolw0Xbs76geJ+uPDGsuYJ mdbgmh1R7IOPpn07x4B3nyLsmlC0W1ofFupFKCAG8/FN3ZMHBaODtn5gcF/7L9ExjrI7 UId5PpEm9Q3SGJIDezNpstEBoaKxZ3VUy4X+smcJx6qtHOd/Mz4+rkdtXaWuiONLzPLa pkcgGqBt0K49dXy0ncRxJIHlczxFrNxuo+1Q5x6jUFJbUABGfZf9+MQ8zjMkG1yVYTTb x18bT3aOi8smt1wzfm1iEct1spQZeG2Al36BXd7tIoL/jKZhw806LKAGSXTXzhZg+DFU wg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 2vektrbvjj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Oct 2019 09:00:03 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x988heTD047819; Tue, 8 Oct 2019 09:00:02 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 2vgeuxer1x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Oct 2019 09:00:02 +0000 Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x98901FK032397; Tue, 8 Oct 2019 09:00:01 GMT Received: from z2.cn.oracle.com (/10.182.71.205) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 08 Oct 2019 02:00:00 -0700 From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Cc: vkuznets@redhat.com, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, sashal@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, pbonzini@redhat.com, rkrcmar@redhat.com, sean.j.christopherson@intel.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org, peterz@infradead.org, Zhenzhong Duan , "H. Peter Anvin" Subject: [PATCH v5 2/5] x86/kvm: Change print code to use pr_*() format Date: Mon, 7 Oct 2019 17:04:28 +0800 Message-Id: <1570439071-9814-3-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1570439071-9814-1-git-send-email-zhenzhong.duan@oracle.com> References: <1570439071-9814-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9403 signatures=668684 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-1910080089 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9403 signatures=668684 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-1910080089 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org pr_*() is preferred than printk(KERN_* ...), after change all the print in arch/x86/kernel/kvm.c will have "kvm_guest: xxx" style. No functional change. Signed-off-by: Zhenzhong Duan Cc: Paolo Bonzini Cc: Radim Krcmar Cc: Sean Christopherson Cc: Vitaly Kuznetsov Cc: Wanpeng Li Cc: Jim Mattson Cc: Joerg Roedel Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Reviewed-by: Vitaly Kuznetsov --- arch/x86/kernel/kvm.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 3bc6a266..ef836d6 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -7,6 +7,8 @@ * Authors: Anthony Liguori */ +#define pr_fmt(fmt) "kvm_guest: " fmt + #include #include #include @@ -286,8 +288,8 @@ static void kvm_register_steal_time(void) return; wrmsrl(MSR_KVM_STEAL_TIME, (slow_virt_to_phys(st) | KVM_MSR_ENABLED)); - pr_info("kvm-stealtime: cpu %d, msr %llx\n", - cpu, (unsigned long long) slow_virt_to_phys(st)); + pr_info("stealtime: cpu %d, msr %llx\n", cpu, + (unsigned long long) slow_virt_to_phys(st)); } static DEFINE_PER_CPU_DECRYPTED(unsigned long, kvm_apic_eoi) = KVM_PV_EOI_DISABLED; @@ -321,8 +323,7 @@ static void kvm_guest_cpu_init(void) wrmsrl(MSR_KVM_ASYNC_PF_EN, pa); __this_cpu_write(apf_reason.enabled, 1); - printk(KERN_INFO"KVM setup async PF for cpu %d\n", - smp_processor_id()); + pr_info("setup async PF for cpu %d\n", smp_processor_id()); } if (kvm_para_has_feature(KVM_FEATURE_PV_EOI)) { @@ -347,8 +348,7 @@ static void kvm_pv_disable_apf(void) wrmsrl(MSR_KVM_ASYNC_PF_EN, 0); __this_cpu_write(apf_reason.enabled, 0); - printk(KERN_INFO"Unregister pv shared memory for cpu %d\n", - smp_processor_id()); + pr_info("Unregister pv shared memory for cpu %d\n", smp_processor_id()); } static void kvm_pv_guest_cpu_reboot(void *unused) @@ -469,7 +469,8 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector) } else { ret = kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap, (unsigned long)(ipi_bitmap >> BITS_PER_LONG), min, icr); - WARN_ONCE(ret < 0, "KVM: failed to send PV IPI: %ld", ret); + WARN_ONCE(ret < 0, "kvm_guest: failed to send PV IPI: %ld", + ret); min = max = apic_id; ipi_bitmap = 0; } @@ -479,7 +480,8 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector) if (ipi_bitmap) { ret = kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap, (unsigned long)(ipi_bitmap >> BITS_PER_LONG), min, icr); - WARN_ONCE(ret < 0, "KVM: failed to send PV IPI: %ld", ret); + WARN_ONCE(ret < 0, "kvm_guest: failed to send PV IPI: %ld", + ret); } local_irq_restore(flags); @@ -509,7 +511,7 @@ static void kvm_setup_pv_ipi(void) { apic->send_IPI_mask = kvm_send_ipi_mask; apic->send_IPI_mask_allbutself = kvm_send_ipi_mask_allbutself; - pr_info("KVM setup pv IPIs\n"); + pr_info("setup pv IPIs\n"); } static void kvm_smp_send_call_func_ipi(const struct cpumask *mask) @@ -631,11 +633,11 @@ static void __init kvm_guest_init(void) !kvm_para_has_hint(KVM_HINTS_REALTIME) && kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) { smp_ops.send_call_func_ipi = kvm_smp_send_call_func_ipi; - pr_info("KVM setup pv sched yield\n"); + pr_info("setup pv sched yield\n"); } if (cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "x86/kvm:online", kvm_cpu_online, kvm_cpu_down_prepare) < 0) - pr_err("kvm_guest: Failed to install cpu hotplug callbacks\n"); + pr_err("failed to install cpu hotplug callbacks\n"); #else sev_map_percpu_data(); kvm_guest_cpu_init(); @@ -738,7 +740,7 @@ static __init int kvm_setup_pv_tlb_flush(void) zalloc_cpumask_var_node(per_cpu_ptr(&__pv_tlb_mask, cpu), GFP_KERNEL, cpu_to_node(cpu)); } - pr_info("KVM setup pv remote TLB flush\n"); + pr_info("setup pv remote TLB flush\n"); } return 0; @@ -866,8 +868,8 @@ static void kvm_enable_host_haltpoll(void *i) void arch_haltpoll_enable(unsigned int cpu) { if (!kvm_para_has_feature(KVM_FEATURE_POLL_CONTROL)) { - pr_err_once("kvm: host does not support poll control\n"); - pr_err_once("kvm: host upgrade recommended\n"); + pr_err_once("host does not support poll control\n"); + pr_err_once("host upgrade recommended\n"); return; } From patchwork Mon Oct 7 09:04:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenzhong Duan X-Patchwork-Id: 11179187 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6DF8E139A for ; Tue, 8 Oct 2019 09:02:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 463FE20867 for ; Tue, 8 Oct 2019 09:02:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="kJCyYW2f" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730287AbfJHJCi (ORCPT ); Tue, 8 Oct 2019 05:02:38 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:37304 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbfJHJCi (ORCPT ); Tue, 8 Oct 2019 05:02:38 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x988hUD5149236; Tue, 8 Oct 2019 09:00:14 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=u2jGBUxoErbaYaYaUwvdGHAGNkpkUIl2vloendr17aw=; b=kJCyYW2foTF62Id/gXENuhPw6Lv6uKrn4AmwQpiaq7wK/jeIulwToNUXTYwXL3BrdEx4 w8SAN8FfiUodRnX5qiPlNLBzKyCjS2Th/HmGw9LSO+t6S1sMBywRfGRgE8pcpA5WFAQv GkJ5f+cV01v71RyeHOeGp2eMBIgN9Je81v64PvFF3XqxN6S641NTHzs2omPwwNOewTik 3f9LzhnwOqN3P2JqEMartjtUDP24xf06C4MysezxLa3LpuZM97S3mhZi1cZL+elhNJ+R fIV6Wn83zA1SwCx1imxrFpM08t9oNJtazEp8I5XvHdcLlaJtUy5tkD/DFLlzznsYQfIB qQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2vek4qc368-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Oct 2019 09:00:14 +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 x988h3jx124613; Tue, 8 Oct 2019 09:00:14 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 2vgefa8jf2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Oct 2019 09:00:13 +0000 Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x98906r5023909; Tue, 8 Oct 2019 09:00:06 GMT Received: from z2.cn.oracle.com (/10.182.71.205) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 08 Oct 2019 02:00:06 -0700 From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Cc: vkuznets@redhat.com, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, sashal@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, pbonzini@redhat.com, rkrcmar@redhat.com, sean.j.christopherson@intel.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org, peterz@infradead.org, Zhenzhong Duan , Jonathan Corbet , "H. Peter Anvin" , Will Deacon Subject: [PATCH v5 3/5] x86/kvm: Add "nopvspin" parameter to disable PV spinlocks Date: Mon, 7 Oct 2019 17:04:29 +0800 Message-Id: <1570439071-9814-4-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1570439071-9814-1-git-send-email-zhenzhong.duan@oracle.com> References: <1570439071-9814-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9403 signatures=668684 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-1910080089 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9403 signatures=668684 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-1910080089 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 also replace Xen and Hyper-V specific parameters in future patches. Define variable nopvsin as global because it will be used in future patches as above. Signed-off-by: Zhenzhong Duan Cc: Jonathan Corbet Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Paolo Bonzini Cc: Radim Krcmar Cc: Sean Christopherson Cc: Vitaly Kuznetsov Cc: Wanpeng Li Cc: Jim Mattson Cc: Joerg Roedel Cc: Peter Zijlstra Cc: Will Deacon --- Documentation/admin-guide/kernel-parameters.txt | 5 +++++ arch/x86/include/asm/qspinlock.h | 1 + arch/x86/kernel/kvm.c | 21 +++++++++++++++++---- kernel/locking/qspinlock.c | 7 +++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index c7ac2f3..89d77ea 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5330,6 +5330,11 @@ as generic guest with no PV drivers. Currently support XEN HVM, KVM, HYPER_V and VMWARE guest. + nopvspin [X86,KVM] + Disables the qspinlock slow path using PV optimizations + which allow the hypervisor to 'idle' the guest on lock + contention. + xirc2ps_cs= [NET,PCMCIA] Format: ,,,,,[,[,[,]]] diff --git a/arch/x86/include/asm/qspinlock.h b/arch/x86/include/asm/qspinlock.h index 444d6fd..d86ab94 100644 --- a/arch/x86/include/asm/qspinlock.h +++ b/arch/x86/include/asm/qspinlock.h @@ -32,6 +32,7 @@ static __always_inline u32 queued_fetch_set_pending_acquire(struct qspinlock *lo extern void __pv_init_lock_hash(void); extern void __pv_queued_spin_lock_slowpath(struct qspinlock *lock, u32 val); extern void __raw_callee_save___pv_queued_spin_unlock(struct qspinlock *lock); +extern bool nopvspin; #define queued_spin_unlock queued_spin_unlock /** diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index ef836d6..6e14bd4 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -825,18 +825,31 @@ __visible bool __kvm_vcpu_is_preempted(long cpu) */ void __init kvm_spinlock_init(void) { - /* Does host kernel support KVM_FEATURE_PV_UNHALT? */ - if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT)) + /* + * Disable PV qspinlocks if host kernel doesn't support + * KVM_FEATURE_PV_UNHALT feature or there is only 1 vCPU. + * virt_spin_lock_key is enabled to avoid lock holder + * preemption issue. + */ + if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT) || + num_possible_cpus() == 1) { + pr_info("PV spinlocks disabled\n"); return; + } if (kvm_para_has_hint(KVM_HINTS_REALTIME)) { + pr_info("PV spinlocks disabled with KVM_HINTS_REALTIME hints.\n"); static_branch_disable(&virt_spin_lock_key); 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); return; + } + + pr_info("PV spinlocks enabled\n"); __pv_init_lock_hash(); pv_ops.lock.queued_spin_lock_slowpath = __pv_queued_spin_lock_slowpath; diff --git a/kernel/locking/qspinlock.c b/kernel/locking/qspinlock.c index 2473f10..75193d6 100644 --- a/kernel/locking/qspinlock.c +++ b/kernel/locking/qspinlock.c @@ -580,4 +580,11 @@ void queued_spin_lock_slowpath(struct qspinlock *lock, u32 val) #include "qspinlock_paravirt.h" #include "qspinlock.c" +bool nopvspin __initdata; +static __init int parse_nopvspin(char *arg) +{ + nopvspin = true; + return 0; +} +early_param("nopvspin", parse_nopvspin); #endif From patchwork Mon Oct 7 09:04:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenzhong Duan X-Patchwork-Id: 11179181 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 742C61668 for ; Tue, 8 Oct 2019 09:02:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4D25E206B6 for ; Tue, 8 Oct 2019 09:02:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="DoACfvRb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730179AbfJHJB5 (ORCPT ); Tue, 8 Oct 2019 05:01:57 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:51508 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730156AbfJHJB4 (ORCPT ); Tue, 8 Oct 2019 05:01:56 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x988hhgg176985; Tue, 8 Oct 2019 09:00:16 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=3+a8jxRfmNDEdrqLNhrQpAvhMUL4KphFXVnnvxuHmRQ=; b=DoACfvRbds8AUzjLAMbJj8NrxYWZ4mQ1fcU4I4d1iyWiMtXuOLiaozcP0qoKDCJ34dnd V1VOId4Men5E7t9w19W/T2ii+o5P/mYG1nQjnMrCAnlpNcuPlp2wcc88OnceKsD1xOJs wkfH7+1dVFne9oT8Yxk8VueQ4FaxU0BNpkprF5krJ5rW2bh3vJ9SFUrrSj4dCZjbFXho NSfi8HZ2EGkDkzUa3lPDTEqZuRT3mb34I4CVQoNHV4lrHUShC6U653o/EiVwSKibx4I1 qV+1u6Kc54h7Yj/yR4Bb8k0oL5ZXXO5yjwPn1Yz6/oMvrHsJ0IojdbIMrx+Ga9uyhJQP eg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 2vektrbvkh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Oct 2019 09:00:16 +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 x988h365124670; Tue, 8 Oct 2019 09:00:15 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 2vgefa8jj4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Oct 2019 09:00:15 +0000 Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x9890CJc023974; Tue, 8 Oct 2019 09:00:12 GMT Received: from z2.cn.oracle.com (/10.182.71.205) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 08 Oct 2019 02:00:11 -0700 From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Cc: vkuznets@redhat.com, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, sashal@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, pbonzini@redhat.com, rkrcmar@redhat.com, sean.j.christopherson@intel.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org, peterz@infradead.org, Zhenzhong Duan , Jonathan Corbet , "H. Peter Anvin" Subject: [PATCH v5 4/5] xen: Mark "xen_nopvspin" parameter obsolete Date: Mon, 7 Oct 2019 17:04:30 +0800 Message-Id: <1570439071-9814-5-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1570439071-9814-1-git-send-email-zhenzhong.duan@oracle.com> References: <1570439071-9814-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9403 signatures=668684 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-1910080089 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9403 signatures=668684 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-1910080089 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Map "xen_nopvspin" to "nopvspin", fix stale description of "xen_nopvspin" as we use qspinlock now. Signed-off-by: Zhenzhong Duan Reviewed-by: Boris Ostrovsky Cc: Jonathan Corbet Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" --- Documentation/admin-guide/kernel-parameters.txt | 7 ++++--- arch/x86/xen/spinlock.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 89d77ea..df1eacc 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5303,8 +5303,9 @@ never -- do not unplug even if version check succeeds xen_nopvspin [X86,XEN] - Disables the ticketlock slowpath using Xen PV - optimizations. + Disables the qspinlock slowpath using Xen PV optimizations. + This parameter is obsoleted by "nopvspin" parameter, which + has equivalent effect for XEN platform. xen_nopv [X86] Disables the PV optimizations forcing the HVM guest to @@ -5330,7 +5331,7 @@ as generic guest with no PV drivers. Currently support XEN HVM, KVM, HYPER_V and VMWARE guest. - nopvspin [X86,KVM] + nopvspin [X86,XEN,KVM] Disables the qspinlock slow path using PV optimizations which allow the hypervisor to 'idle' the guest on lock contention. diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c index 6deb490..799f4eb 100644 --- a/arch/x86/xen/spinlock.c +++ b/arch/x86/xen/spinlock.c @@ -114,9 +114,8 @@ void xen_uninit_lock_cpu(int cpu) */ void __init xen_init_spinlocks(void) { - /* Don't need to use pvqspinlock code if there is only 1 vCPU. */ - if (num_possible_cpus() == 1) + if (num_possible_cpus() == 1 || nopvspin) xen_pvspin = false; if (!xen_pvspin) { @@ -137,6 +136,7 @@ void __init xen_init_spinlocks(void) static __init int xen_parse_nopvspin(char *arg) { + pr_notice("\"xen_nopvspin\" is deprecated, please use \"nopvspin\" instead\n"); xen_pvspin = false; return 0; } From patchwork Mon Oct 7 09:04:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenzhong Duan X-Patchwork-Id: 11179185 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8050F1668 for ; Tue, 8 Oct 2019 09:02:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E965206C2 for ; Tue, 8 Oct 2019 09:02:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="kP9wKZ16" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730232AbfJHJCX (ORCPT ); Tue, 8 Oct 2019 05:02:23 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:60750 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730036AbfJHJCX (ORCPT ); Tue, 8 Oct 2019 05:02:23 -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 x988hUmt189402; Tue, 8 Oct 2019 09:00:21 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=6zx+HXQZEXKowQg35WPZrfCHzQ03y1NjjMoY3ktOXVM=; b=kP9wKZ16IfTRx7GPFzL6M8xdq6f1Et1QYWA7EhfgP/SpRyJ2BFHv/fS7ThqH8Cqa9bgc iqfQWRL51QmzgZtbKuPCEJyTIKWZt5lkfMBOkZQM+XE/eyix6n0K8bdeewiQJ6+ydlGC N8Qb6MpAx8GzuK8RM3n7BTVLvlDy5aHEvO4WwZ3FVRKQ6huoGEE5Rkh1OFYfKn2jt+1W D4ePIU6IaPbnOdjdb8r+a7V2SwUhajeSplG286knf9QfnmpovLhgDZ/PeLtduDHbJWvY k5O3KECvaVxrDN9Dx1pEyU/04Jc9NWgwz6kEu1+fRIf03eFX98277WGgA7uzGKnW8GwQ dA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2vejkuc4xp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Oct 2019 09:00:20 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x988hgr3108039; Tue, 8 Oct 2019 09:00:19 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 2vg1yvkdvk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Oct 2019 09:00:19 +0000 Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x9890HCW005717; Tue, 8 Oct 2019 09:00:18 GMT Received: from z2.cn.oracle.com (/10.182.71.205) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 08 Oct 2019 02:00:17 -0700 From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Cc: vkuznets@redhat.com, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, sashal@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, pbonzini@redhat.com, rkrcmar@redhat.com, sean.j.christopherson@intel.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org, peterz@infradead.org, Zhenzhong Duan , Jonathan Corbet , "H. Peter Anvin" Subject: [PATCH v5 5/5] x86/hyperv: Mark "hv_nopvspin" parameter obsolete Date: Mon, 7 Oct 2019 17:04:31 +0800 Message-Id: <1570439071-9814-6-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1570439071-9814-1-git-send-email-zhenzhong.duan@oracle.com> References: <1570439071-9814-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9403 signatures=668684 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-1910080089 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9403 signatures=668684 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-1910080089 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Map "hv_nopvspin" to "nopvspin". Signed-off-by: Zhenzhong Duan Reviewed-by: Michael Kelley 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 | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index df1eacc..08c6d34 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] + 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..47c7d6c 100644 --- a/arch/x86/hyperv/hv_spinlock.c +++ b/arch/x86/hyperv/hv_spinlock.c @@ -64,6 +64,9 @@ __visible bool hv_vcpu_is_preempted(int vcpu) void __init hv_init_spinlocks(void) { + if (nopvspin) + hv_pvspin = false; + if (!hv_pvspin || !apic || !(ms_hyperv.hints & HV_X64_CLUSTER_IPI_RECOMMENDED) || !(ms_hyperv.features & HV_X64_MSR_GUEST_IDLE_AVAILABLE)) { @@ -82,6 +85,7 @@ void __init hv_init_spinlocks(void) static __init int hv_parse_nopvspin(char *arg) { + pr_notice("\"hv_nopvspin\" is deprecated, please use \"nopvspin\" instead\n"); hv_pvspin = false; return 0; }