From patchwork Sun Jun 23 13:01:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenzhong Duan X-Patchwork-Id: 11013015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD7261580 for ; Mon, 24 Jun 2019 13:01:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9ECD1279E0 for ; Mon, 24 Jun 2019 13:01:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92A1C28BB4; Mon, 24 Jun 2019 13:01:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=2.0 tests=BAYES_00,DATE_IN_PAST_12_24, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 775F2279E0 for ; Mon, 24 Jun 2019 13:01:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hfOYQ-0006Wn-Ci; Mon, 24 Jun 2019 12:58:38 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hfOYP-0006Wi-DR for xen-devel@lists.xenproject.org; Mon, 24 Jun 2019 12:58:37 +0000 X-Inumbo-ID: c5ccc312-967f-11e9-8fbf-830508511844 Received: from userp2120.oracle.com (unknown [156.151.31.85]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id c5ccc312-967f-11e9-8fbf-830508511844; Mon, 24 Jun 2019 12:58:33 +0000 (UTC) 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 x5OCsGs3142975; Mon, 24 Jun 2019 12:58:20 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-2018-07-02; bh=KLBclTheGjubyUpbAx+QHqK/8lekhX1YiHOk2x91wZU=; b=LyMN2+S4uJvGq8XmNHJVvnpR67iAGd3vC6p4NbKp3UGqqh4hnJ9n8WxpSKKmi4Jq8JWn vo8c0Il2jxhJWGEvd9ahOI+n4i2himzhdZR4vvA2N/aDN0CqcyDLMII1wgbKEvvm5A/P Zm3lD6r1Gzixk0z+MBa7gZWBtxhw05yVJgoYZBEETB2c+RnkUQ5LfS95bmEd/U9tTXHG q60lAks2RT9jdaavL6NcYWtwKXbVxTs95p5DBu7Aq/dLJwxj7e/imHCpHNXsiduY+B1J HtFLAFK4xvdKTw5CCwv6wsjcnxfP4Gd7hBPb70KhOrNxKahyU28PKMzhUq9unFMU5nMV Jg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 2t9cyq66qa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jun 2019 12:58:20 +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 x5OCwBQl108078; Mon, 24 Jun 2019 12:58:19 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2t9p6tjnhh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jun 2019 12:58:19 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x5OCwHri010630; Mon, 24 Jun 2019 12:58:17 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 24 Jun 2019 05:58:16 -0700 From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Sun, 23 Jun 2019 21:01:40 +0800 Message-Id: <1561294903-6166-3-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1561294903-6166-1-git-send-email-zhenzhong.duan@oracle.com> References: <1561294903-6166-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9297 signatures=668687 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-1810050000 definitions=main-1906240106 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9297 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906240105 Subject: [Xen-devel] [PATCH 3/6] x86: Add nopv parameter to disable PV extensions X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: jgross@suse.com, sstabellini@kernel.org, Zhenzhong Duan , mingo@kernel.org, bp@alien8.de, hpa@zytor.com, xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, tglx@linutronix.de MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP In virtualization environment, PV extensions (drivers, interrupts, timers, etc) are enabled in the majority of use cases which is the best option. However, in some cases (kexec not fully working, benchmarking) we want to disable PV extensions. As such introduce the 'nopv' parameter that will do it. There is already 'xen_nopv' parameter for XEN platform but not for others. 'xen_nopv' can then be removed with this change. Signed-off-by: Zhenzhong Duan Cc: xen-devel@lists.xenproject.org --- Documentation/admin-guide/kernel-parameters.txt | 4 ++++ arch/x86/kernel/cpu/hypervisor.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 138f666..b352f36 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5268,6 +5268,10 @@ improve timer resolution at the expense of processing more timer interrupts. + nopv= [X86] + Disables the PV optimizations forcing the guest to run + as generic guest with no PV drivers. + xirc2ps_cs= [NET,PCMCIA] Format: ,,,,,[,[,[,]]] diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c index 479ca47..4f2c875 100644 --- a/arch/x86/kernel/cpu/hypervisor.c +++ b/arch/x86/kernel/cpu/hypervisor.c @@ -85,10 +85,21 @@ static void __init copy_array(const void *src, void *target, unsigned int size) to[i] = from[i]; } +static bool nopv; +static __init int xen_parse_nopv(char *arg) +{ + nopv = true; + return 0; +} +early_param("nopv", xen_parse_nopv); + void __init init_hypervisor_platform(void) { const struct hypervisor_x86 *h; + if (nopv) + return; + h = detect_hypervisor_vendor(); if (!h) From patchwork Sun Jun 23 13:01:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenzhong Duan X-Patchwork-Id: 11013013 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD6621580 for ; Mon, 24 Jun 2019 13:00:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F3DE28761 for ; Mon, 24 Jun 2019 13:00:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9305028BBE; Mon, 24 Jun 2019 13:00:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=2.0 tests=BAYES_00,DATE_IN_PAST_12_24, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3B71528BB5 for ; Mon, 24 Jun 2019 13:00:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hfOYT-0006XF-QS; Mon, 24 Jun 2019 12:58:41 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hfOYS-0006X8-LN for xen-devel@lists.xenproject.org; Mon, 24 Jun 2019 12:58:40 +0000 X-Inumbo-ID: c7d0a7be-967f-11e9-ad16-3363066e5954 Received: from aserp2120.oracle.com (unknown [141.146.126.78]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id c7d0a7be-967f-11e9-ad16-3363066e5954; Mon, 24 Jun 2019 12:58:37 +0000 (UTC) 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 x5OCsHZP045489; Mon, 24 Jun 2019 12:58: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-2018-07-02; bh=NfIpW5m3VpvjUSio8dF11x/kBwlpwlo1ekYCD0h4Qk8=; b=IGMsHrMS2fAoEAx11Y9xAipulaGOKc79b9ufDIR0k6j3B/E5rJmLuNGtBn13kRGAxtjA HmjZpILCk5sQ7mowxzxWpoJXgL8hUb79oGyGQMagInkZTj1kwZQy2k1Cse3uQqtavHgD hzJFTqA/lL67i9AqYwhcgo4vbEbyySXKwwdUQKlEcNjdR8aDiZBkKe+jWK2yHU+p4vJz 1QjSCSgfqWayprex7bOiaosLHSfj/fwzUGTyNIxG7htGCFpvH6mIIkZeW2zAHfajD6SZ rU6F7waII+nuwwWKcq7eSbqCxDxQ7ygtDJ6Sk6Ge1hcMOiG5fuAA/TkTJnM0YKKDUBHu 9A== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 2t9c9pe7ee-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jun 2019 12:58:21 +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 x5OCwCth042307; Mon, 24 Jun 2019 12:58:21 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 2t9acbg5qs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jun 2019 12:58:21 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x5OCwJp0010645; Mon, 24 Jun 2019 12:58:20 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 24 Jun 2019 05:58:19 -0700 From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Sun, 23 Jun 2019 21:01:41 +0800 Message-Id: <1561294903-6166-4-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1561294903-6166-1-git-send-email-zhenzhong.duan@oracle.com> References: <1561294903-6166-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9297 signatures=668687 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-1810050000 definitions=main-1906240106 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9297 signatures=668687 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-1810050000 definitions=main-1906240105 Subject: [Xen-devel] [PATCH 4/6] Revert "xen: Introduce 'xen_nopv' to disable PV extensions for HVM guests." X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: jgross@suse.com, sstabellini@kernel.org, Zhenzhong Duan , mingo@kernel.org, bp@alien8.de, hpa@zytor.com, xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, tglx@linutronix.de MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit 8d693b911bb9c57009c24cb1772d205b84c7985c. Instead we use an unified parameter 'nopv' for all the hypervisor platforms. Signed-off-by: Zhenzhong Duan Cc: xen-devel@lists.xenproject.org --- Documentation/admin-guide/kernel-parameters.txt | 4 ---- arch/x86/xen/enlighten_hvm.c | 12 +----------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index b352f36..ebb75c1 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5251,10 +5251,6 @@ Disables the ticketlock slowpath using Xen PV optimizations. - xen_nopv [X86] - Disables the PV optimizations forcing the HVM guest to - run as generic HVM guest with no PV drivers. - xen_scrub_pages= [XEN] Boolean option to control scrubbing pages before giving them back to Xen, for use by other domains. Can be also changed at runtime diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c index ac4943c..7fcb4ea 100644 --- a/arch/x86/xen/enlighten_hvm.c +++ b/arch/x86/xen/enlighten_hvm.c @@ -210,18 +210,8 @@ static void __init xen_hvm_guest_init(void) #endif } -static bool xen_nopv; -static __init int xen_parse_nopv(char *arg) -{ - xen_nopv = true; - return 0; -} -early_param("xen_nopv", xen_parse_nopv); - bool __init xen_hvm_need_lapic(void) { - if (xen_nopv) - return false; if (xen_pv_domain()) return false; if (!xen_hvm_domain()) @@ -233,7 +223,7 @@ bool __init xen_hvm_need_lapic(void) static uint32_t __init xen_platform_hvm(void) { - if (xen_pv_domain() || xen_nopv) + if (xen_pv_domain()) return 0; return xen_cpuid_base();