From nobody Wed Apr 24 08:30:06 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=1562933251; cv=none; d=zoho.com; s=zohoarc; b=LyifgBrkSSRNnWygVVovS0rozObNTXTFRJmuIaOXASJgSqx4aGfqms8upHVY6o1GZKKn8Up0K4LwVRmhddYKVeyRLE2/RLbSuFdI3H4HEKGS+1oOT38O5nvtu0GND50aaG1Zikj5GD2CakEcCm0dZXfMmfdDOo4ggMe0qL3cnQs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562933251; 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=AaseVXF6RUXVPL/ehZsHuDzbMNCq1dePypGBJfkFHg8ZgPjP4A08zGx9GbP+qOZ+maCwwRWU+Q8PZSVcNeSQNsuvwdjLyHYATLJy/W2fQhXOUWm9JmAy65QeuGmmnnf9FgQolT/MP9FFBmh8gaMPrrKGDyAODWzy/f6M8EuqtSg= 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 1562933251777345.82288757388915; Fri, 12 Jul 2019 05:07:31 -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 1hluJk-0003DB-Qu; Fri, 12 Jul 2019 12:06:24 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hluJj-0003D2-Ia for xen-devel@lists.xenproject.org; Fri, 12 Jul 2019 12:06:23 +0000 Received: from userp2120.oracle.com (unknown [156.151.31.85]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 7674f6a4-a49d-11e9-8980-bc764e045a96; Fri, 12 Jul 2019 12:06:21 +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 x6CC3w0x008648; Fri, 12 Jul 2019 12:06:06 GMT Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 2tjm9r57ka-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 12:06:06 +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 x6CC3R7l095743; Fri, 12 Jul 2019 12:04:05 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 2tpefd28y9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 12:04:05 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x6CC44JO006192; Fri, 12 Jul 2019 12:04:04 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Jul 2019 04:58:32 -0700 X-Inumbo-ID: 7674f6a4-a49d-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=DDXy799dLKIIzXw5g+O0VFzQNqNZN4eUI0vkngwwQ8vP2u2FK/wUhdmgkwpKR2lcFeKC BYdjKm2s26ZzACiuJaeLvjKQP3on05T7HQrPgf0/2xaxLFNThsuN+nOOnlINBCIQk3ma QvFtENroV1rM6EsupkrzStZGhRFmIGOolGVvt4IvITWBZeiR/dggVJbVbfv9UuzFLWS3 IIkvenxZhyzA1BM67dybsKlxmpA/gf6zeDnw/kycnk8+KyRQaQvMh5zfOIKhX0WE0oB/ sED72dbfEP7ghsm7BBJXWL3TTTVlQslU8OrqNMHc7X6KSFiNYrR+i511ENDak5Y2vObf Mg== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Thu, 11 Jul 2019 20:02:08 +0800 Message-Id: <1562846532-32152-2-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562846532-32152-1-git-send-email-zhenzhong.duan@oracle.com> References: <1562846532-32152-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 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-1907120132 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 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-1907120132 Subject: [Xen-devel] [PATCH v7 1/5] 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 Wed Apr 24 08:30:06 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=1562933155; cv=none; d=zoho.com; s=zohoarc; b=XxN+tlFatIpVbUKX7485Y/cdrA2lGs3ILz3rHcUAogFRU0Ig0bDmJetlnf8y6n747WWOWgUk/DcK+Ap8OJHdMxgC+05/4ptdrXUS3yJ+exd3SbCQKTmDTgB8WV9YcJ/CNOH4g559W3YV8MtNexen0W179r2xHJ6ST5Z/q+S9xQs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562933155; 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=zQjfHykB5iaD7iQOM/pJk0b5ag/Ug8YZ1XBdYru4KTs=; b=OXOYtGHetinMUY2hp+6BtFoH/P8pWHJPi2W8veSSpRt/apcgKywvrieAx88TVZ0obeb4P+aMq4JrVuYEy2y9oxQphqHsNFogSkqIEbNKU48lRLfiu1nvKGKI5NPRxOfAfLFUjQ8st2dtcChivNELSve0H2bjs8zzeBfRg9X3A0s= 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 1562933155062388.8553854909918; Fri, 12 Jul 2019 05:05:55 -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 1hluHr-0002ya-5x; Fri, 12 Jul 2019 12:04:27 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hluHq-0002yU-5J for xen-devel@lists.xenproject.org; Fri, 12 Jul 2019 12:04:26 +0000 Received: from aserp2120.oracle.com (unknown [141.146.126.78]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 30dcc6f5-a49d-11e9-8980-bc764e045a96; Fri, 12 Jul 2019 12:04:25 +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 x6CC3mBq093615; Fri, 12 Jul 2019 12:04:08 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 2tjkkq572n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 12:04:08 +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 x6CC3TgJ175345; Fri, 12 Jul 2019 12:04:07 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 2tmwgyr39k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 12:04:07 +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 x6CC461N020739; Fri, 12 Jul 2019 12:04:06 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Jul 2019 04:58:34 -0700 X-Inumbo-ID: 30dcc6f5-a49d-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=7mSXW1AaKAj4lnksyNN8rOaqG9NBDQLiPAqjKyUrhew=; b=bh2AHFVKZnF9quE+D6y7wuHOHN5HvcKGkaq/HIvfD1KJzd8EVfZmeNZ9qYg8RLoHmYh0 brWSLT88B0DzNpJOVjmznqnRD0JLPgx8imnK9lV+Wd3mPSljN7ALCraV11zaOdwhJ9mY 8vgxPZMQl2M7OBkgcBtlr1gbEUj9VbBSCf/We2VadT9yyjXYYbOtDY9kNvFKxHwdP5qb GbkJpZQSPtjFmjLXT9ExJIoiadw5gwowzQXukD37a3CAl8PdMuxIM4c0i/Gj0W8exTg3 g7kom/njDSVkGww/Wu5upIJqyZFUnBGraaDJ+wHnsgar3WFfy5K2PvBF4zAOzkRpbQnn Lw== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Thu, 11 Jul 2019 20:02:09 +0800 Message-Id: <1562846532-32152-3-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562846532-32152-1-git-send-email-zhenzhong.duan@oracle.com> References: <1562846532-32152-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 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-1907120132 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 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-1907120132 Subject: [Xen-devel] [PATCH v7 2/5] 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 f1c433d..dbfe9c2 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5271,6 +5271,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 50a30f6..f7b4c53 100644 --- a/arch/x86/include/asm/hypervisor.h +++ b/arch/x86/include/asm/hypervisor.h @@ -53,8 +53,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 87e39ad..7eaad41 100644 --- a/arch/x86/kernel/cpu/hypervisor.c +++ b/arch/x86/kernel/cpu/hypervisor.c @@ -58,6 +58,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) { @@ -65,6 +73,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 6857b45..3ad34f0 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 Wed Apr 24 08:30:06 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=1562933251; cv=none; d=zoho.com; s=zohoarc; b=Abf4uaUWOmBLgFM/uaXxHtU+bvyHN4qlMXfIFgWocFiEECH+Uy07xrLc3y+2taQ18XWY07kvQBsLMzbWFabch9aA27Kxmoe7dmacufzUiHoknU+lNFWVKJOII9hoXch7hxa4pDlCon185AaEAGoRVlfKVfBTHsLpkFtKn6FqkRc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562933251; 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=OBJPVS5bavMRtdTwWePhYdgxHdkDhDxuHYRcdOrqZsQ=; b=N50tHo6yqEVr/DVzPbd/yyxGtlTCzBRSVdo9NttHwyPdReik/KHf1biBlHJQf4p4OFdsktWwDyPxrLHf8Jr/x06dTz8ixMbpLMbnpHPWKJrEvmhSXzhO7zWQKyuq+4kE5M19wByabQtS8K9h3A23omhBcx0Kgtzy4yaTN9BoNA0= 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 1562933251329145.27182541551065; Fri, 12 Jul 2019 05:07:31 -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 1hluJm-0003Dc-4F; Fri, 12 Jul 2019 12:06:26 +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 1hluJl-0003DF-0Y for xen-devel@lists.xenproject.org; Fri, 12 Jul 2019 12:06:25 +0000 Received: from userp2120.oracle.com (unknown [156.151.31.85]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 76f4c222-a49d-11e9-bd4a-8f795214a4e2; Fri, 12 Jul 2019 12:06:22 +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 x6CC48vM008727; Fri, 12 Jul 2019 12:06:09 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2tjm9r57kt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 12:06:08 +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 x6CC3RS1175143; Fri, 12 Jul 2019 12:04:08 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 2tmwgyr39m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 12:04:08 +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 x6CC46oQ020742; Fri, 12 Jul 2019 12:04:06 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Jul 2019 04:58:37 -0700 X-Inumbo-ID: 76f4c222-a49d-11e9-bd4a-8f795214a4e2 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=E14zOpdJ0upmAZGDNVryByKPU7mvCSiYeFkhZvpvH9w=; b=FIbqhn+OIc/U3TbGekk1kglxd3dkGTWFGJdCpcL1g3oBGHoGYJkXA6rDjY54xgo2y/dK X9luy9yF/lq/XVDZr37+fSwS08ukeu9t6SsM5o4LJvUFFEnnmJwIVQoy2Q7DkvGHrqlm eVWLCWmWuZI49RlSLSayIuTHVxPJC9wNhwpchfwkASiKHJsetWs98UWyTh/WgaYux566 0kijlVfG+Wn0ts7S7dS1rPHXF37Un3NWB/Wh34D/uiJgFQKFBPByDk9gPWu/+PFEaJpy dIiwK7TJeQa9YaUYJsTPEBakRqkDTPmGpqTWtGKNiophhx6p/JKfiPNGnegJ/jTyXpbd JA== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Thu, 11 Jul 2019 20:02:10 +0800 Message-Id: <1562846532-32152-4-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562846532-32152-1-git-send-email-zhenzhong.duan@oracle.com> References: <1562846532-32152-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 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-1907120132 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 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-1907120132 Subject: [Xen-devel] [PATCH v7 3/5] 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 Reviewed-by: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov --- 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 dbfe9c2..c3f3e01 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5257,6 +5257,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 Wed Apr 24 08:30:06 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=1562933165; cv=none; d=zoho.com; s=zohoarc; b=mD35lLc+Ng3wRmfemEORonZsNIYHf89+qgXPXHIQzCvMO+ru66eW7UM19NQZrLKQ55i2fXIyCm/ijrSk21Dxu7IJMKQiUIqgMSg5g6UNQwnhJ++6nteN42dLo+LjxA2fcIzAER2ubKZN5GN3GJQ3fSuh2gd7v70wSIbVrDYQCbM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562933165; 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=jVLhDtgf7GgVzhiiekYp0h6xy3I457skNIyNIRnpD1w=; b=EYSLN1JKUcchwCBtVJCVgKnGHTys2d4wQcPN7pZVapfxxPHl0Rge8yQH2uLrsaIt0Td5XJsN5ju8h7QdcDXQUP/pfRm+PYXKMzziz/aRUZCgu5L+Gjggf+iNomPQmplrFeopYxgVN6An01VWdfCyhB89u19JVeI4gr0cmMi7tJM= 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 1562933165080164.67823397511154; Fri, 12 Jul 2019 05:06:05 -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 1hluHt-0002z7-EF; Fri, 12 Jul 2019 12:04:29 +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 1hluHr-0002yh-HR for xen-devel@lists.xenproject.org; Fri, 12 Jul 2019 12:04:27 +0000 Received: from userp2130.oracle.com (unknown [156.151.31.86]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 30f86b7a-a49d-11e9-b077-47b9931d4c93; Fri, 12 Jul 2019 12:04:25 +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 x6CC408T193538; Fri, 12 Jul 2019 12:04:10 GMT Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2tjk2u5af6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 12:04:10 +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 x6CC3Qgd095638; Fri, 12 Jul 2019 12:04:09 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 2tpefd290c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 12:04:09 +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 x6CC4849020751; Fri, 12 Jul 2019 12:04:08 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Jul 2019 04:58:39 -0700 X-Inumbo-ID: 30f86b7a-a49d-11e9-b077-47b9931d4c93 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=cmT+Q26he6loqTunuFKBeKHkRTXIORCg1WJGoyTRd0U=; b=dT0B4osZgrJIBjgIG/p8aeYQD6xxSoEnCYjXXaYuYzsGKOv4LR1wp93zJyKSTmygCSTp ph73BeOol2YBxWwyvpj38coMoLYOI+cVJZrxfQcWnXol4g5Vhre3eD85sxsxSsoGSu8A GJlrREG2eNQDebVAVAHPGheUGv+XBUlucOwWsZCOAbN+RHXjk9TmN9CvX2cWeQPUQsEn RJgYIgohkM4CapajncSQK6g2hxYctkZhY4fKZr9JCIM1Tpk168u7sPAV+RrMBo8f9pEO 9GNJkT2qcB28xgvOK9MKeZmQ5vuPv4YMYiGZiobxNe+0h25W7NyK7Zdryc7tcYbX1m7L VA== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Thu, 11 Jul 2019 20:02:11 +0800 Message-Id: <1562846532-32152-5-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562846532-32152-1-git-send-email-zhenzhong.duan@oracle.com> References: <1562846532-32152-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 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-1907120132 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 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-1907120132 Subject: [Xen-devel] [PATCH v7 4/5] x86/paravirt: Remove const mark from x86_hyper_xen_hvm variable 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 "nopv" support needs it to be changeable at boot up stage. Checkpatch report warning, so move variable declarations from hypervisor.c to hypervisor.h 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/include/asm/hypervisor.h | 8 ++++++++ arch/x86/kernel/cpu/hypervisor.c | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hyper= visor.h index f7b4c53..e41cbf2 100644 --- a/arch/x86/include/asm/hypervisor.h +++ b/arch/x86/include/asm/hypervisor.h @@ -58,6 +58,14 @@ struct hypervisor_x86 { bool ignore_nopv; }; =20 +extern const struct hypervisor_x86 x86_hyper_vmware; +extern const struct hypervisor_x86 x86_hyper_ms_hyperv; +extern const struct hypervisor_x86 x86_hyper_xen_pv; +extern const struct hypervisor_x86 x86_hyper_kvm; +extern const struct hypervisor_x86 x86_hyper_jailhouse; +extern const struct hypervisor_x86 x86_hyper_acrn; +extern struct hypervisor_x86 x86_hyper_xen_hvm; + extern bool nopv; extern enum x86_hypervisor_type x86_hyper_type; extern void init_hypervisor_platform(void); diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervi= sor.c index 7eaad41..553bfbf 100644 --- a/arch/x86/kernel/cpu/hypervisor.c +++ b/arch/x86/kernel/cpu/hypervisor.c @@ -26,14 +26,6 @@ #include #include =20 -extern const struct hypervisor_x86 x86_hyper_vmware; -extern const struct hypervisor_x86 x86_hyper_ms_hyperv; -extern const struct hypervisor_x86 x86_hyper_xen_pv; -extern const struct hypervisor_x86 x86_hyper_xen_hvm; -extern const struct hypervisor_x86 x86_hyper_kvm; -extern const struct hypervisor_x86 x86_hyper_jailhouse; -extern const struct hypervisor_x86 x86_hyper_acrn; - static const __initconst struct hypervisor_x86 * const hypervisors[] =3D { #ifdef CONFIG_XEN_PV --=20 1.8.3.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Wed Apr 24 08:30:06 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=1562933257; cv=none; d=zoho.com; s=zohoarc; b=ZWtXY0Q1V8uMMpvKF1qh8cKljwwS7dBfNM3Mm7sssrO9sBQuf5TOt6Q+nDdoCeBZgUBHjG3ON9mKvMveWSeFX0reriN6FlG2XQWDRLObgM6E1QJiTOKkJOBgUVPv8yJHZNsoCuIeExDib0PJTsiz1LvY8CRG4JN1hX4pLudWTd0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562933257; 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=qvWvLa8ABZFypRn4tbAsi7njpi7cDBHrE76MkZVZmT4=; b=c1T6RNJzQ0akjU2Ipc07DjYI88GjJ+W6Wqq6PDoCGk6jlqHwUZCHaTvswWW5ukCGN8Zf5yQJqsQkWDRNIsUIVNX5wTiIn2tU5BsQ5ZNIJkUI8ClOZVXEH301LUajnAAuLZb1K/Fx+HVnSCZo5x4YCLx/sut2fyy67/XXfNdW3Rs= 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 1562933257966882.1701371275977; Fri, 12 Jul 2019 05:07:37 -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 1hluJt-0003GS-Jb; Fri, 12 Jul 2019 12:06:33 +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 1hluJr-0003Fv-T0 for xen-devel@lists.xenproject.org; Fri, 12 Jul 2019 12:06:31 +0000 Received: from userp2130.oracle.com (unknown [156.151.31.86]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 7bae9fcc-a49d-11e9-a336-3b0491518641; Fri, 12 Jul 2019 12:06:30 +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 x6CC3rCI193467; Fri, 12 Jul 2019 12:06:14 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2tjk2u5ase-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 12:06:14 +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 x6CC3SwE048154; Fri, 12 Jul 2019 12:04:14 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 2tn1j23ypk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 12:04:14 +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 x6CC4DoP015905; Fri, 12 Jul 2019 12:04:13 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Jul 2019 04:58:42 -0700 X-Inumbo-ID: 7bae9fcc-a49d-11e9-a336-3b0491518641 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=GnDNkS4LsM8yVEL9aAyB/fPBX18ezyafmslh/QcfNf0=; b=Eu7o9s7kk21lH33SUye2XpeJt4sEtbKJ/fXDLGZvLgaRbZge6oJ3bEgOOEt0fc0KwLCa Bz9JL9t4fRXlU2IbRT0p4c4oSLzLN+5fFXoz61lT8Qx/hrgnA7q9LOEL2jQwUf3K7lMJ 9Cuu968ASOjqygPbg9W/wuAkngR+mguvoG+JcRkrdhoFKCU+1cC04YlIh5uFIgarmOFI lqcvWxfkP/WlDg7W1QvhQzvjD6JFwUi7gLXqE4KznuK5W46jDcznExOuabN0qWeLhZ05 2AWK5Z59w/P6XVlSwlwyhGvO5upRKuHlMVAvUHvhkNnSL78p+WD7/rTFTu1s8mTGNZRS dg== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Thu, 11 Jul 2019 20:02:12 +0800 Message-Id: <1562846532-32152-6-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1562846532-32152-1-git-send-email-zhenzhong.duan@oracle.com> References: <1562846532-32152-1-git-send-email-zhenzhong.duan@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 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-1907120132 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 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-1907120132 Subject: [Xen-devel] [PATCH v7 5/5] 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. In this case, we have to panic early if PVH is detected and nopv is enabled to avoid a worse situation later. Move xen_platform_hvm() after xen_hvm_guest_late_init() to avoid compile error. 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 --- arch/x86/include/asm/x86_init.h | 2 ++ arch/x86/kernel/x86_init.c | 4 ++-- arch/x86/xen/enlighten_hvm.c | 45 ++++++++++++++++++++++++++++++++-----= ---- 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_ini= t.h index b85a7c5..ac09341 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -301,6 +301,8 @@ struct x86_apic_ops { extern void x86_early_init_platform_quirks(void); extern void x86_init_noop(void); extern void x86_init_uint_noop(unsigned int unused); +extern bool bool_x86_init_noop(void); +extern void x86_op_int_noop(int cpu); extern bool x86_pnpbios_disabled(void); =20 #endif diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 50a2b49..1bef687 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -29,8 +29,8 @@ void x86_init_noop(void) { } void __init x86_init_uint_noop(unsigned int unused) { } static int __init iommu_init_noop(void) { return 0; } static void iommu_shutdown_noop(void) { } -static bool __init bool_x86_init_noop(void) { return false; } -static void x86_op_int_noop(int cpu) { } +bool __init bool_x86_init_noop(void) { return false; } +void x86_op_int_noop(int cpu) { } =20 /* * The platform setup functions are preset with the default functions diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c index 1756cf7..e138f7d 100644 --- a/arch/x86/xen/enlighten_hvm.c +++ b/arch/x86/xen/enlighten_hvm.c @@ -231,14 +231,6 @@ bool __init xen_hvm_need_lapic(void) return true; } =20 -static uint32_t __init xen_platform_hvm(void) -{ - if (xen_pv_domain()) - return 0; - - return xen_cpuid_base(); -} - static __init void xen_hvm_guest_late_init(void) { #ifdef CONFIG_XEN_PVH @@ -250,6 +242,9 @@ static __init void xen_hvm_guest_late_init(void) /* PVH detected. */ xen_pvh =3D true; =20 + if (nopv) + panic("\"nopv\" and \"xen_nopv\" parameters are unsupported in PVH guest= ."); + /* Make sure we don't fall back to (default) ACPI_IRQ_MODEL_PIC. */ if (!nr_ioapics && acpi_irq_model =3D=3D ACPI_IRQ_MODEL_PIC) acpi_irq_model =3D ACPI_IRQ_MODEL_PLATFORM; @@ -259,7 +254,38 @@ static __init void xen_hvm_guest_late_init(void) #endif } =20 -const __initconst struct hypervisor_x86 x86_hyper_xen_hvm =3D { +static uint32_t __init xen_platform_hvm(void) +{ + uint32_t xen_domain =3D xen_cpuid_base(); + struct x86_hyper_init *h =3D &x86_hyper_xen_hvm.init; + + if (xen_pv_domain()) + return 0; + + 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 && xen_domain) { + /* + * Guest booting via normal boot entry (like via grub2) goes + * here. + * + * Use interface functions for bare hardware if nopv, + * xen_hvm_guest_late_init is an exception as we need to + * detect PVH and panic there. + */ + h->init_platform =3D x86_init_noop; + h->x2apic_available =3D bool_x86_init_noop; + h->init_mem_mapping =3D x86_init_noop; + h->init_after_bootmem =3D x86_init_noop; + h->guest_late_init =3D xen_hvm_guest_late_init; + x86_hyper_xen_hvm.runtime.pin_vcpu =3D x86_op_int_noop; + } + return xen_domain; +} + +struct hypervisor_x86 x86_hyper_xen_hvm __initdata =3D { .name =3D "Xen HVM", .detect =3D xen_platform_hvm, .type =3D X86_HYPER_XEN_HVM, @@ -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