From nobody Tue Apr 23 22:25:22 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=1562203061; cv=none; d=zoho.com; s=zohoarc; b=hHCcr+d/Q80HrHEUx88jeMT/5p3yAvTzNhSu9/A3yZEsuEtU13JJ7fiPYht+cpWYuh4kEZ5RWofvWp5XoHc6oiV2YlIhXa8WpX0xetLu5If4e16i9GNhyWzv8wIFf3ol7AgJxokk9PzapOEjSiG3xscekGVBYPHUQJ+jL/dm3Jk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562203061; 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=LljVk0zSOdEktR30BsLf0aEXIqzh2VwvvLVQXCwQ0TpIOhOB8gyQMUvL8/xvwjqMxv/IBOYjf9lRTzo1HHxgqgpWuhA2Ova0r5Oq0iDQGwjvhRWVWyU2I4TbSlYhG8zqvdsoX1fL7VxWKS1HM6kBBp6D7QiwaxJkuzJ2dfsTTjw= 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 1562203061689618.8348300074307; Wed, 3 Jul 2019 18:17:41 -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 1hiqMD-0000VK-9d; Thu, 04 Jul 2019 01:16:17 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hiqMC-0000VF-Ic for xen-devel@lists.xenproject.org; Thu, 04 Jul 2019 01:16:16 +0000 Received: from aserp2120.oracle.com (unknown [141.146.126.78]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 511816bc-9df9-11e9-8980-bc764e045a96; Thu, 04 Jul 2019 01:16: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 x641EUdk123573; Thu, 4 Jul 2019 01:16:01 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 2te5tbv6rm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2019 01:16:01 +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 x641ChlE039884; Thu, 4 Jul 2019 01:16:00 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2th5qks8k9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2019 01:16:00 +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 x641FxHl017794; Thu, 4 Jul 2019 01:15:59 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 03 Jul 2019 18:15:59 -0700 X-Inumbo-ID: 511816bc-9df9-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=rKZhRLv86J9i1rvrZktSTTZCQ+BL1+OOD2Uqcglx6kQg6n9trrHvxI/Uf6doxbDZQhTr jYZtVLBHXUinpS8X23Frvp5m09GUPCxgYu8l0PRyJ+WmTVLQWrT7D7LE9XxWAFAr13lI R3fzCMbe3hobkdJ1hHcbNbq8vfJv0JKW3/S62JShkqz28p5rAKO46yuR5U9Ykgehrvjp +jLy5FvVnlH75VqnVh7lNngxWh/susHJr1LV6c54vUPtu08usCNmriIK1cTdl2zgTqNl 0dPZLskmwLvOZvOb1eEvRcmSPaoSqfVMw3tUvy7KXkt0RJKucCSHFDhkxMrackcsm5uI Rw== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Wed, 3 Jul 2019 09:19:35 +0800 Message-Id: <1562116778-5846-2-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562116778-5846-1-git-send-email-zhenzhong.duan@oracle.com> References: <1562116778-5846-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9307 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-1907040013 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9307 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-1907040014 Subject: [Xen-devel] [PATCH v5 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, xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, tglx@linutronix.de 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 23 22:25:22 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=1562203167; cv=none; d=zoho.com; s=zohoarc; b=jl7XvshiGnBCZTknheCU9Uo2L8HS41epE+MTsmVizZeO8yvvqh4cy3upXOIj9KClJhVwRhkaEwZ+Bjo9c+6+DxU5Fkjw28iMo52j82BKdGbMfqh0fGwXYWCJ2GwoYLrHUq3JgUmkvI6Wy3UZt/vG8SQ57lWwhii71/fUjexazP4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562203167; 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=2sGQ5ixBwncpitbevi3qNiebiUYSZDSkCFaAJn0wY1A=; b=UwzGbRVwpqRxoWPzTIAEOG0pXUg2cuYX9aqAPyX8jw+pk/NpIOCAIimElTOQR34Xd7+Pu8OScbGRC0yVPamVGoe037XH0HYIwbcZ3a+9XzJ5SoFix8evlrapihbstR308YK9NHfDr7Jh5wiWQrWmdEon18xP1hXOZHc3TycCh1w= 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 1562203167292799.3819517659732; Wed, 3 Jul 2019 18:19:27 -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 1hiqOA-0000sF-Nf; Thu, 04 Jul 2019 01:18:18 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hiqO9-0000rs-DA for xen-devel@lists.xenproject.org; Thu, 04 Jul 2019 01:18:17 +0000 Received: from aserp2120.oracle.com (unknown [141.146.126.78]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 9990df5f-9df9-11e9-8980-bc764e045a96; Thu, 04 Jul 2019 01:18:16 +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 x641EI3V123328; Thu, 4 Jul 2019 01:18:05 GMT Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2te5tbv6wc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2019 01:18:05 +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 x641CZXK089761; Thu, 4 Jul 2019 01:16:04 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2tebkv5td0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2019 01:16:04 +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 x641G2u7032301; Thu, 4 Jul 2019 01:16:02 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 03 Jul 2019 18:16:02 -0700 X-Inumbo-ID: 9990df5f-9df9-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=McFjyxa5TN9dJj6AfIiEg6O5IDlY1x1JqP2XAQDDw6g=; b=qo6dcN+40a12F1kR8Pc1IkBdJPcYwDKknnPIgKtfiuGmzU2p2K4Eb4f0jTfVz0CUj0rS PC7utQ/o4BYKSi9UT/+e0CKeU6YvyzbepTAq8Y7yJ2ugbY5nVGiVGm7c8TV00jbv4TqO W3opOcMFJ0FKsCHT9yEsAqA/McoHGo5EXfJfkCzy1JaMPrVE+NldLKFjfWdAVGWw4CSa l2ydnTTst7Jr9A3fPc5OzQDTjNnDrl6HA8n2sd+9mOVT5jOiTAZftVkJNT0igsHC9rTS RO1re2EaseC+2n3tHWG0ry9aJ7+YS7k7Sz5ttwe97z06wSQLYlaPbsJbPZ/8kljOjz28 UA== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Wed, 3 Jul 2019 09:19:36 +0800 Message-Id: <1562116778-5846-3-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562116778-5846-1-git-send-email-zhenzhong.duan@oracle.com> References: <1562116778-5846-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9307 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-1907040013 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9307 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-1907040014 Subject: [Xen-devel] [PATCH v5 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, xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, tglx@linutronix.de 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. We have "xen_nopv" for that purpose but only for XEN. For a consistent admin experience a common command line parameter "nopv" set across all PV guest implementations is a better choice. 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. 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 | 4 ++++ arch/x86/kernel/cpu/hypervisor.c | 11 +++++++++++ arch/x86/kernel/jailhouse.c | 1 + arch/x86/xen/enlighten_pv.c | 1 + 5 files changed, 22 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..00240b0 100644 --- a/arch/x86/include/asm/hypervisor.h +++ b/arch/x86/include/asm/hypervisor.h @@ -52,8 +52,12 @@ struct hypervisor_x86 { =20 /* runtime callbacks */ struct x86_hyper_runtime runtime; + + /* ignore nopv parameter */ + bool ignore_nopv; }; =20 +extern bool nopv; extern enum x86_hypervisor_type x86_hyper_type; extern void init_hypervisor_platform(void); static inline bool hypervisor_is_type(enum x86_hypervisor_type 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 1b2ee55..c52c4105 100644 --- a/arch/x86/kernel/jailhouse.c +++ b/arch/x86/kernel/jailhouse.c @@ -217,4 +217,5 @@ static bool 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 23 22:25:22 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=1562203062; cv=none; d=zoho.com; s=zohoarc; b=HZw2iXrJQx9es/Q2cDrCgKRoRUINVIfOrwdrypTlPCafAuUVCYJqjUCxjxiMOlP6N1FZHHvXkVy0AD4nT0jzUI+NjfmJgxdfQ7BT0KCO0yGyjvApVRZ4AbFqoFQD8VuoGqMNOsFFXFFHjZ8x0lh6Mqcsm0DwU5kZkusKAqQ/Aos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562203062; 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=Jj8b3jVqiVcBGLMvF8kt3iKkaSS3XQjKW/LJcjA4gOU=; b=dsCzVHjEP3nxQ+icfceNTddRlYlXdbf+F2FlzD6G9+dKDXFtRi35zRffH2Aq+FKKiDlZI5WkI2GDyR/4u26IqYehkMFklD7qXfIYodgJHR8ydj2F12TuzZ2Ni0IHU6CZrsx5iOxsbDkDZLhIB49B7tETGCCeELMXSan7sGdilVg= 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 1562203062127799.8084475463569; Wed, 3 Jul 2019 18:17:42 -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 1hiqMJ-0000W1-5S; Thu, 04 Jul 2019 01:16:23 +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 1hiqMI-0000Vt-LY for xen-devel@lists.xenproject.org; Thu, 04 Jul 2019 01:16:22 +0000 Received: from aserp2120.oracle.com (unknown [141.146.126.78]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 529d239c-9df9-11e9-8224-7f87ca585c88; Thu, 04 Jul 2019 01:16:17 +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 x641ELVj123406; Thu, 4 Jul 2019 01:16:06 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 2te5tbv6rx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2019 01:16:06 +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 x641Ca7m171107; Thu, 4 Jul 2019 01:16:06 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 2th5qm18at-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2019 01:16:06 +0000 Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x641G5lu026874; Thu, 4 Jul 2019 01:16:05 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 03 Jul 2019 18:16:04 -0700 X-Inumbo-ID: 529d239c-9df9-11e9-8224-7f87ca585c88 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=7EONRTmmeGFvVCXtQC6IK+HBE0ZbOZS1TzpKDcuyVw0=; b=SvuqvOW0QMcbCnNoA3Hk6po54G1amoaC8/wol5laRpot5IEisw9rJSawyorwuRKKOVBQ 1sGMgGp4RlO2NprxXph5PDQTTcdn+7g0AnFZrFkoHg8cGe8Yn59AaWE1TpW7Fdj7pLu7 apeGBjgwDuhuiE6T4PHpW6TZdkr/4ficoYXOSlzGfNKZgx/9qWNnH/jCjxPGB4AcKx2t 4YWu+922ulCF1jwXgAJLibGHgkaNueKkKgAz7amS2KPRAxKPgSA0+QWBXxjSQAHmbAcw Wu8lQF3JFAwx8ADEJJ8VHZmFw5pD8Dr4su5EvSxuhlClNoOOsn/ygFTCVWUyhI4Aw3jI CA== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Wed, 3 Jul 2019 09:19:37 +0800 Message-Id: <1562116778-5846-4-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562116778-5846-1-git-send-email-zhenzhong.duan@oracle.com> References: <1562116778-5846-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9307 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-1907040013 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9307 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-1907040014 Subject: [Xen-devel] [PATCH v5 3/4] xen: Map "xen_nopv" parameter to "nopv" and mark it obsolete 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, xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, tglx@linutronix.de 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) Clean up unnecessory code after that operation. Signed-off-by: Zhenzhong Duan Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Reviewed-by: Boris Ostrovsky --- Documentation/admin-guide/kernel-parameters.txt | 2 ++ arch/x86/xen/enlighten_hvm.c | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index 21e08af..8ab34a1 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5254,6 +5254,8 @@ xen_nopv [X86] Disables the PV optimizations forcing the HVM guest to run as generic HVM guest with no PV drivers. + This option is obsoleted by the "nopv" option, which + has equivalent effect for XEN platform. =20 xen_scrub_pages=3D [XEN] Boolean option to control scrubbing pages before giving them back diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c index ac4943c..1756cf7 100644 --- a/arch/x86/xen/enlighten_hvm.c +++ b/arch/x86/xen/enlighten_hvm.c @@ -210,18 +210,18 @@ 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; + pr_notice("\"xen_nopv\" is deprecated, please use \"nopv\" instead\n"); + + if (xen_cpuid_base()) + nopv =3D true; + return 0; } early_param("xen_nopv", xen_parse_nopv); =20 bool __init xen_hvm_need_lapic(void) { - if (xen_nopv) - return false; if (xen_pv_domain()) return false; if (!xen_hvm_domain()) @@ -233,7 +233,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 23 22:25:22 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=1562203061; cv=none; d=zoho.com; s=zohoarc; b=lW4xajH7P9fVt+9QF+YINOL1sSY278nzXHoRsRxKcUoN4ZExLI5xuGCHOHbH3tt4Au8r3I5Mh5Wkxdp1VeKa8yF2YaF3Q6lQ5OcGsj5IJaeXLJF8L1molVLCjDdPn1lEgNtEyUgo3MIqTdVgbLKkTGS1RhlqaYNE+KPenZWWtuk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562203061; 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=g9ikhrcBMSSgVPBOuZAIchutuJBjAo6uFFBI8X9yMcI=; b=br+qpGeRnfGEWDrKtQBcaxA8ooywqHn/db1DElcjY/r9uFZ+KOA/Vha4ZJSJD36QuQ/RBA3LI+NO5s8d/9DU6r9aGTrb2DRMhWJcDa7yaYyaDP0GxGo8XIbFlu22SqmmityrxSiTaus1H2DJsOCSxCfghomIH3fZsifnzZsXchQ= 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 1562203061991701.3851687130489; Wed, 3 Jul 2019 18:17:41 -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 1hiqMH-0000Vh-Ro; Thu, 04 Jul 2019 01:16:21 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hiqMF-0000VV-Sx for xen-devel@lists.xenproject.org; Thu, 04 Jul 2019 01:16:19 +0000 Received: from aserp2120.oracle.com (unknown [141.146.126.78]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 5375b5e6-9df9-11e9-8980-bc764e045a96; Thu, 04 Jul 2019 01:16:18 +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 x641Efot123673; Thu, 4 Jul 2019 01:16:08 GMT Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2te5tbv6s2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2019 01:16:08 +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 x641Cceh089845; Thu, 4 Jul 2019 01:16:07 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2tebkv5tdj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2019 01:16:07 +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 x641G7tj010700; Thu, 4 Jul 2019 01:16:07 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 03 Jul 2019 18:16:07 -0700 X-Inumbo-ID: 5375b5e6-9df9-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=HhKAAWVPipFLRo00kLa1NJDWOLc4M9riT3RNfy4Uozs=; b=wb7MTWSeBsklCUBYPP99Z2BcF022Vw3ID16E/qh0bdF7nB7k1tlNEWUtZO2/cS8lP0ZD yNCz1L07vjhGc0qoJRLasQyOaDbHgOCxOdEXyd54gcfMQIk7DUjJ3oOfVdOfV8Q8vQ5g i8oAQpk7tKiO5Ms8vco8jiuHzpem2VPS3mxsJ8bKszx6U4gRSOvfPaUZPpUoY5CD+HiG lWK79YzScafjJjT6ivE7ICnc8TpIky7TSX3WmnIewaloynLkKNq42lBpqed0havaSTxq fhQ8TDFt8aDTFi2RL3MIclgIj8jVEMcu8L4Bn73q+IsNVF5vPoKkE9TKh9lQsAxuvw0M GA== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Wed, 3 Jul 2019 09:19:38 +0800 Message-Id: <1562116778-5846-5-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562116778-5846-1-git-send-email-zhenzhong.duan@oracle.com> References: <1562116778-5846-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9307 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-1907040013 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9307 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-1907040014 Subject: [Xen-devel] [PATCH v5 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, xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, tglx@linutronix.de 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 1756cf7..09a010a 100644 --- a/arch/x86/xen/enlighten_hvm.c +++ b/arch/x86/xen/enlighten_hvm.c @@ -231,11 +231,37 @@ 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\" and \"xen_nopv\" parameters are unsupported 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"); + nopv =3D false; + } 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 @@ -268,4 +294,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