From nobody Tue Apr 16 05:14:21 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1562034008; cv=none; d=zoho.com; s=zohoarc; b=CfoyKjRXyfEOtpPGdrg0FO4eCN+Bb2j2YkBu36Ii1yjNEU8S4EJk49DMZ/n5Rh2t1HyavmTTlsialVhHj7haUxR/hMLP0oCd3LrT6UQTdpYFC1z11Arnnj8NuQ/WQ2cQsKvk+aMWOg/doFcFLbBQe8HxlcuN/VA15vH6T1pApDo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562034008; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=yAZHp5GRBuZfICJGrw2tJ4xNzSDOFIZN8xOWZbUV0O4=; b=LEJc6K9P0tNntxnHPYuJEHxrW23zPHt7CAlNIByjLq3/f84mhIli2TXSEYlXXT63pFSibcbpc0P0ZuPdCmoaCyLpputzyKNCuJwVISFNsf0ziGKd4vERE81obdLyT+TUP7QjyllyyIWSJAvVqmaYcSy5UtMOaeKRquQbiT+1Oq0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1562034008664728.1052691531788; Mon, 1 Jul 2019 19:20:08 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hi8Ny-00039N-Sw; Tue, 02 Jul 2019 02:19:10 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hi8Nx-00039G-TV for xen-devel@lists.xenproject.org; Tue, 02 Jul 2019 02:19:09 +0000 Received: from aserp2120.oracle.com (unknown [141.146.126.78]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id c51efa7a-9c6f-11e9-8980-bc764e045a96; Tue, 02 Jul 2019 02:19:07 +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 x622IndG108147; Tue, 2 Jul 2019 02:18:56 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 2te5tbgq53-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 02 Jul 2019 02:18:56 +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 x622CTrA017620; Tue, 2 Jul 2019 02:16:56 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 2tebakg7td-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 02 Jul 2019 02:16:56 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x622Gra0028580; Tue, 2 Jul 2019 02:16:53 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 01 Jul 2019 19:16:53 -0700 X-Inumbo-ID: c51efa7a-9c6f-11e9-8980-bc764e045a96 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=YuCOXIRb/dHuU0bztnXWfWAbrWp+ScSgOTP4KoY+oi4=; b=tAl/AMnDKTSuR64IgCGUBHdTDLEhEjo81U7YmQfi4O17y6JWF1kBIjGQtp3Hw8rUV5eu 4auZ263pIUR3qvI/iMjB7YpdT2LH3d73Uu372vCJBbcMKQBr5T4UBzSPpYyxtvviyH92 qSfLS7p37fUU+2uzNoVx+Y255BTp4g0F94Q1k5iUkdywPD3gdMxww5cAPF5hOaepWn0A XH9G/rOTGm6dRCObcnGnzG4JXcZuA/KmYrWpaoxeuUGI9KxFRqCgWRurwNCchXfvvchz sdCzWtyJEJbU4Hg2JYCZp5iw/mGcoZ3jmK70Ni8p/CmxYtfHqZzbdkbZCcYDxETduP4D 8w== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Mon, 1 Jul 2019 10:20:25 +0800 Message-Id: <1561947628-1147-2-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1561947628-1147-1-git-send-email-zhenzhong.duan@oracle.com> References: <1561947628-1147-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9305 signatures=668688 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-1907020020 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9305 signatures=668688 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-1907020022 Subject: [Xen-devel] [PATCH v3 1/4] x86/xen: Mark xen_hvm_need_lapic() and xen_x2apic_para_available() as __init 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@redhat.com, bp@alien8.de, boris.ostrovsky@oracle.co, xen-devel@lists.xenproject.org, tglx@linutronix.de, Boris Ostrovsky MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) .. as they are only called at early bootup stage. In fact, other functions in x86_hyper_xen_hvm.init.* are all marked as __init. Unexport xen_hvm_need_lapic as it's never used outside. Signed-off-by: Zhenzhong Duan Reviewed-by: Juergen Gross Cc: Boris Ostrovsky Cc: Stefano Stabellini Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov --- arch/x86/include/asm/xen/hypervisor.h | 6 +++--- arch/x86/xen/enlighten_hvm.c | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/x= en/hypervisor.h index 39171b3..42e1245 100644 --- a/arch/x86/include/asm/xen/hypervisor.h +++ b/arch/x86/include/asm/xen/hypervisor.h @@ -44,14 +44,14 @@ static inline uint32_t xen_cpuid_base(void) } =20 #ifdef CONFIG_XEN -extern bool xen_hvm_need_lapic(void); +extern bool __init xen_hvm_need_lapic(void); =20 -static inline bool xen_x2apic_para_available(void) +static inline bool __init xen_x2apic_para_available(void) { return xen_hvm_need_lapic(); } #else -static inline bool xen_x2apic_para_available(void) +static inline bool __init xen_x2apic_para_available(void) { return (xen_cpuid_base() !=3D 0); } diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c index 0e75642..ac4943c 100644 --- a/arch/x86/xen/enlighten_hvm.c +++ b/arch/x86/xen/enlighten_hvm.c @@ -218,7 +218,7 @@ static __init int xen_parse_nopv(char *arg) } early_param("xen_nopv", xen_parse_nopv); =20 -bool xen_hvm_need_lapic(void) +bool __init xen_hvm_need_lapic(void) { if (xen_nopv) return false; @@ -230,7 +230,6 @@ bool xen_hvm_need_lapic(void) return false; return true; } -EXPORT_SYMBOL_GPL(xen_hvm_need_lapic); =20 static uint32_t __init xen_platform_hvm(void) { --=20 1.8.3.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Tue Apr 16 05:14:21 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1562033896; cv=none; d=zoho.com; s=zohoarc; b=CT1+kXeyPcfkLrG0sGH5f90slYIgoM/JCp6Nciwq2gblH1jLZZ1p+Lf5DADvjTCFPtAMi4cj5zIdVOYOgZc4BfU+SgYixgncX0Xahqu9WrDZRnQVf+J2eWXSSa6qpri6s++dDFPcBvgdHwFt9LadSU/T+R9ezDGHH6zsQ55DVA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562033896; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=gYTE9zG/a57lCBsRBwjFzwCIKjygMtXVZQLUbr3tsbg=; b=WU0DbnfNhM1naToqhrGfbenIBvC1TA1aAjdX3/64Gx2+UtwnS3TIVlNtpdnoqMw6oMK+YYTHZfGS0s24odadTFgoTP8BA7L2EhKopEbgUN+bCQt5Docc4v9qL9mrWyLk28C41kzha1dNei73ykMs99JMHE3hJLIon2wwyCSmW6c= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1562033896615722.7225235385775; Mon, 1 Jul 2019 19:18:16 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hi8M8-0002pl-DT; Tue, 02 Jul 2019 02:17:16 +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 1hi8M7-0002p5-4W for xen-devel@lists.xenproject.org; Tue, 02 Jul 2019 02:17:15 +0000 Received: from aserp2120.oracle.com (unknown [141.146.126.78]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 7f60b21c-9c6f-11e9-8f90-6799ed588b1f; Tue, 02 Jul 2019 02:17:10 +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 x622DOCQ104730; Tue, 2 Jul 2019 02:16:57 GMT Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2te5tbgq1f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 02 Jul 2019 02:16:57 +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 x622CV5X123786; Tue, 2 Jul 2019 02:16:57 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2tebku087q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 02 Jul 2019 02:16:56 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x622GuY9011194; Tue, 2 Jul 2019 02:16:56 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 01 Jul 2019 19:16:56 -0700 X-Inumbo-ID: 7f60b21c-9c6f-11e9-8f90-6799ed588b1f 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=tv0WJqGhMWgASy2cp0R54zmW/Tss6rl3pT32IAc9TR4=; b=y7tndfaQCopCRNE848b1SqOTCQZcVM2G59RI4IN1u7kraHlxqslnL8CU10PrxxZDk3JQ lF4jrnLVjcDQi7WrYIyET8KKOV7dQA+QKoHHqY9zaaeMgB1BiB31Dq3Q8mVQ6puumIJX MlvIt0R+i6KC2MEYCaYOv6tgBqgRwqUPtQ8PWi1UctirXn0REMXTSH24c7AiDm2DjEoz 6FWdDFNUSwYxtk+qo4047ICk0+M7/gzGaigMQskQcZH902pSitS3KuQCalLLZuAEXFCg FCek3PYV+qSIgNGjuQ/sfwBKs0v0Dzgsvl9B7vPQ5ammXrBIcPqz5xCNdUwILcNicV1N wg== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Mon, 1 Jul 2019 10:20:26 +0800 Message-Id: <1561947628-1147-3-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1561947628-1147-1-git-send-email-zhenzhong.duan@oracle.com> References: <1561947628-1147-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9305 signatures=668688 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-1907020020 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9305 signatures=668688 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-1907020021 Subject: [Xen-devel] [PATCH v3 2/4] 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, Jan Kiszka , Zhenzhong Duan , mingo@redhat.com, bp@alien8.de, boris.ostrovsky@oracle.co, xen-devel@lists.xenproject.org, tglx@linutronix.de, Boris Ostrovsky MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 are guest types which just won't work without PV extensions, like Xen PV, Xen PVH and jailhouse. add a "ignore_nopv" member to struct hypervisor_x86 set to true for those guest types and call the detect functions only if nopv is false or ignore_nopv is true. There is already 'xen_nopv' parameter for XEN platform but not for others. 'xen_nopv' can then be removed with this change. Suggested-by: Juergen Gross Signed-off-by: Zhenzhong Duan Reviewed-by: Juergen Gross Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Jan Kiszka Cc: Boris Ostrovsky Cc: Stefano Stabellini --- Documentation/admin-guide/kernel-parameters.txt | 5 +++++ arch/x86/include/asm/hypervisor.h | 3 +++ arch/x86/kernel/cpu/hypervisor.c | 11 +++++++++++ arch/x86/kernel/jailhouse.c | 1 + arch/x86/xen/enlighten_pv.c | 1 + 5 files changed, 21 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index 138f666..21e08af 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5268,6 +5268,11 @@ improve timer resolution at the expense of processing more timer interrupts. =20 + nopv=3D [X86,XEN,KVM,HYPER_V,VMWARE] + Disables the PV optimizations forcing the guest to run + as generic guest with no PV drivers. Currently support + XEN HVM, KVM, HYPER_V and VMWARE guest. + xirc2ps_cs=3D [NET,PCMCIA] Format: ,,,,,[,[,<= irq3>[,]]] diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hyper= visor.h index 8c5aaba..d75d2ea 100644 --- a/arch/x86/include/asm/hypervisor.h +++ b/arch/x86/include/asm/hypervisor.h @@ -52,6 +52,9 @@ struct hypervisor_x86 { =20 /* runtime callbacks */ struct x86_hyper_runtime runtime; + + /* ignore nopv parameter */ + bool ignore_nopv; }; =20 extern enum x86_hypervisor_type x86_hyper_type; diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervi= sor.c index 479ca47..337ff07 100644 --- a/arch/x86/kernel/cpu/hypervisor.c +++ b/arch/x86/kernel/cpu/hypervisor.c @@ -54,6 +54,14 @@ enum x86_hypervisor_type x86_hyper_type; EXPORT_SYMBOL(x86_hyper_type); =20 +bool __initdata nopv; +static __init int parse_nopv(char *arg) +{ + nopv =3D true; + return 0; +} +early_param("nopv", parse_nopv); + static inline const struct hypervisor_x86 * __init detect_hypervisor_vendor(void) { @@ -61,6 +69,9 @@ uint32_t pri, max_pri =3D 0; =20 for (p =3D hypervisors; p < hypervisors + ARRAY_SIZE(hypervisors); p++) { + if (unlikely(nopv) && !(*p)->ignore_nopv) + continue; + pri =3D (*p)->detect(); if (pri > max_pri) { max_pri =3D pri; diff --git a/arch/x86/kernel/jailhouse.c b/arch/x86/kernel/jailhouse.c index d96d563..880329f 100644 --- a/arch/x86/kernel/jailhouse.c +++ b/arch/x86/kernel/jailhouse.c @@ -217,4 +217,5 @@ static bool __init jailhouse_x2apic_available(void) .detect =3D jailhouse_detect, .init.init_platform =3D jailhouse_init_platform, .init.x2apic_available =3D jailhouse_x2apic_available, + .ignore_nopv =3D true, }; diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 4722ba2..5d16824 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -1463,4 +1463,5 @@ static uint32_t __init xen_platform_pv(void) .detect =3D xen_platform_pv, .type =3D X86_HYPER_XEN_PV, .runtime.pin_vcpu =3D xen_pin_vcpu, + .ignore_nopv =3D true, }; --=20 1.8.3.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Tue Apr 16 05:14:21 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1562033893; cv=none; d=zoho.com; s=zohoarc; b=aBtVDHLCER+WRPdhvkv9K6yvuBKW3E1ewWdPV7l1XK4krCCxI3ADTCDQfjajoGApCCz6bWj6qHAG9hvJBFTptEDZMMLZov3Ko+Wi6IjZpB4kIrjJQZQnbtYsZCqfat9fmpdWAXItJBgk24dJYquoBAmQo02Dp1MCFtV42XrmI7Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562033893; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=TqgOv6kNsvZWGoEeLFLuepIilFge5j/X+yJU//TXwS4=; b=JkJOaCVk4/yuFLXJFu5CrAVhOcoLZm6N6I3v71n+M8hUSN9nlt+7sx8ICDoDV2coDZvxeSV+0GmuEGY5/SDtCgshU0CdPg+gDWCJbCYqnBI8VQpnjCCP/ONdOYUoHRrHtYkfPDT7SlJXF8AbW1fYiyQ5AF52Mmg+TU4tnieERl4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1562033893469551.8787387348748; Mon, 1 Jul 2019 19:18:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hi8M8-0002pO-2R; Tue, 02 Jul 2019 02:17:16 +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 1hi8M6-0002oy-Tv for xen-devel@lists.xenproject.org; Tue, 02 Jul 2019 02:17:14 +0000 Received: from userp2130.oracle.com (unknown [156.151.31.86]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8022bcae-9c6f-11e9-811c-931d67c128f3; Tue, 02 Jul 2019 02:17:12 +0000 (UTC) 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 x622DRq3002531; Tue, 2 Jul 2019 02:17:01 GMT Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2te61e0nyh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 02 Jul 2019 02:17:01 +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 x622Cb7m123917; Tue, 2 Jul 2019 02:17:00 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2tebku0881-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 02 Jul 2019 02:17:00 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x622GwTH031712; Tue, 2 Jul 2019 02:16:59 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 01 Jul 2019 19:16:58 -0700 X-Inumbo-ID: 8022bcae-9c6f-11e9-811c-931d67c128f3 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=EFSmZR+aQfjnbpTqhm/zuPPtTY2fNuao7fBCYCnO2FA=; b=IG2IvXNHu0JNFqMmbrz6Az0gikxXqkcIC9S4CvfpeVDfyYXV59dJ6SwUrcPYRBiQeHS+ gS4cA8G1DLBtLQlZ1IrVpJTVq2gN1yvXKD8AwCL3uY2tANgsPPEYR/1NvZ6wtQYHsJ/g S9HoCCNPdp24J2fDpIqy+5vzAXh1XbTk/ywwhlZkk4kvVnezKTLjWy5dZJS17wdeFrYV oOhDdYFi4ie1NiW2GEGod8GnbXVoW09aTaAsmZ9igFBJmzQjg0rTkiYg1sq/tZo3DCtz spnmdfidz2WIpKW2OKIftelkLDKKqWMKsRn0hFdAXhQaCvYvINUfYhk9kvUIc1Ro4YsN DQ== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Mon, 1 Jul 2019 10:20:27 +0800 Message-Id: <1561947628-1147-4-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1561947628-1147-1-git-send-email-zhenzhong.duan@oracle.com> References: <1561947628-1147-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9305 signatures=668688 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-1907020020 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9305 signatures=668688 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-1907020021 Subject: [Xen-devel] [PATCH v3 3/4] 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@redhat.com, bp@alien8.de, boris.ostrovsky@oracle.co, xen-devel@lists.xenproject.org, tglx@linutronix.de, Boris Ostrovsky MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This reverts commit 8d693b911bb9c57009c24cb1772d205b84c7985c. Instead we use an unified parameter 'nopv' for all the hypervisor platforms. Signed-off-by: Zhenzhong Duan Reviewed-by: Juergen Gross Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov --- 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/Documentatio= n/admin-guide/kernel-parameters.txt index 21e08af..d5c3dcc 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. =20 - xen_nopv [X86] - Disables the PV optimizations forcing the HVM guest to - run as generic HVM guest with no PV drivers. - xen_scrub_pages=3D [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 } =20 -static bool xen_nopv; -static __init int xen_parse_nopv(char *arg) -{ - xen_nopv =3D 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) =20 static uint32_t __init xen_platform_hvm(void) { - if (xen_pv_domain() || xen_nopv) + if (xen_pv_domain()) return 0; =20 return xen_cpuid_base(); --=20 1.8.3.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Tue Apr 16 05:14:21 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1562034019; cv=none; d=zoho.com; s=zohoarc; b=Ys6F9JU4Fw2U7oTcUoEKulVzG11kS/gxzw1GdvmxOnknWs0AvdClu4BojBJX/4vF3DJ5raFDbVGRmy1QnyiQPRwrxfho9+wOrqcl/BhAZlnkk1fgdvalno0Wc32jzwNzUujH1Hwk8hh+GPw/GsrkhKXLA6t2NMBJeoXlIRDnvFE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562034019; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=RPfqD7hlfIKCAfPeOyg3mfLn/GFXz9wcbuD3Q7FZ/oE=; b=oA3/cdy+ewViNI30CmtWg5ceeb+EPOWynASzX3bz0LirFTLuUWQ4Bz7bH8z9+DDU4D7/+AMTubpEJiDcElni7pkwP1JsZFT6HIxVYdFCNSBUQ/89Y1x6ZYPwR6nKvde303TDhZMpAyAMHbGoNGpdt2OqxRWLn37P8I5cSMSJ5nE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1562034019738360.3077332115814; Mon, 1 Jul 2019 19:20:19 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hi8O9-0003B0-74; Tue, 02 Jul 2019 02:19:21 +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 1hi8O7-0003Aa-8j for xen-devel@lists.xenproject.org; Tue, 02 Jul 2019 02:19:19 +0000 Received: from aserp2120.oracle.com (unknown [141.146.126.78]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id c900239e-9c6f-11e9-ad17-67c99edb81a8; Tue, 02 Jul 2019 02:19:14 +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 x622IuNJ108174; Tue, 2 Jul 2019 02:19:03 GMT Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2te5tbgq5t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 02 Jul 2019 02:19:03 +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 x622CTMl123668; Tue, 2 Jul 2019 02:17:02 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 2tebku0886-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 02 Jul 2019 02:17:02 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x622H1Ne028602; Tue, 2 Jul 2019 02:17:01 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 01 Jul 2019 19:17:01 -0700 X-Inumbo-ID: c900239e-9c6f-11e9-ad17-67c99edb81a8 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=PSXRRg+VqoghiPb6E2wfzVIl4GDaBdiY849ddx84T70=; b=D0Nh/qH7UFDDUkkw9JQM9H4ujFTZibgPEHu0CumMwxvwXhp2OjB/WL5pHj9RuRNEIygO VAebqgtrBKU7riVuMhiBPkJh3syjb/stlqc6qQe/z1TjRfVdjO+Dx0Ke/mPZMTb4vUnu NpeoEa9gNJHt/s0iVZL7twzERO8SsuKaia0DUWAviKxQPUW5s0ojTnrpRPKd1WV6s/BD jqJ1C7NaS5C5lIpObBUlVbUPru70XVXz5RODyKpSVUtcbLihK7bDq7QcMITcICCXnuDM gefbLLyVYMuceEoV6FOHyJRMuON7spbyN9Zr1o0XJ2ze6v6Td/M+j5j1hFVoQpmByl/k dw== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Mon, 1 Jul 2019 10:20:28 +0800 Message-Id: <1561947628-1147-5-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1561947628-1147-1-git-send-email-zhenzhong.duan@oracle.com> References: <1561947628-1147-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9305 signatures=668688 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-1907020020 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9305 signatures=668688 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-1907020022 Subject: [Xen-devel] [PATCH v3 4/4] x86/xen: Add 'nopv' support for HVM guest 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@redhat.com, bp@alien8.de, boris.ostrovsky@oracle.co, xen-devel@lists.xenproject.org, tglx@linutronix.de, Boris Ostrovsky MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) PVH guest needs PV extentions to work, so 'nopv' parameter should be ignored for PVH but not for HVM guest. If PVH guest boots up via the Xen-PVH boot entry, xen_pvh is set early, we know it's PVH guest and ignore 'nopv' parameter directly. If PVH guest boots up via the normal boot entry same as HVM guest, it's hard to distinguish PVH and HVM guest at that time. To handle that case, add a new function xen_hvm_nopv_guest_late_init() to detect PVH at a late time and panic itself if 'nopv' enabled for a PVH guest. Signed-off-by: Zhenzhong Duan Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov --- arch/x86/xen/enlighten_hvm.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c index 7fcb4ea..340dff8 100644 --- a/arch/x86/xen/enlighten_hvm.c +++ b/arch/x86/xen/enlighten_hvm.c @@ -25,6 +25,7 @@ #include "mmu.h" #include "smp.h" =20 +extern bool nopv; static unsigned long shared_info_pfn; =20 void xen_hvm_init_shared_info(void) @@ -221,11 +222,36 @@ bool __init xen_hvm_need_lapic(void) return true; } =20 +static __init void xen_hvm_nopv_guest_late_init(void) +{ +#ifdef CONFIG_XEN_PVH + if (x86_platform.legacy.rtc || !x86_platform.legacy.no_vga) + return; + + /* PVH detected. */ + xen_pvh =3D true; + + panic("nopv parameter isn't supported in PVH guest."); +#endif +} + + static uint32_t __init xen_platform_hvm(void) { if (xen_pv_domain()) return 0; =20 + if (xen_pvh_domain() && nopv) { + /* Guest booting via the Xen-PVH boot entry goes here */ + pr_info("nopv parameter is ignored in PVH guest\n"); + } else if (nopv) { + /* + * Guest booting via normal boot entry (like via grub2) goes + * here. + */ + x86_init.hyper.guest_late_init =3D xen_hvm_nopv_guest_late_init; + return 0; + } return xen_cpuid_base(); } =20 @@ -258,4 +284,5 @@ static __init void xen_hvm_guest_late_init(void) .init.init_mem_mapping =3D xen_hvm_init_mem_mapping, .init.guest_late_init =3D xen_hvm_guest_late_init, .runtime.pin_vcpu =3D xen_pin_vcpu, + .ignore_nopv =3D true, }; --=20 1.8.3.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel