From nobody Sun May 5 11:56:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1558347582; cv=none; d=zoho.com; s=zohoarc; b=CzvTJuNb/Szedxsv13FrXkcV09u2n9CC7jqaKOXlTTMS6xXGVB4A/JaQUJg3Wwap36veWtdy/rTChV7qZoKcYn5T9CKkhdMeYgjh62QqVREzzMH+STkdR8s0uzI/bosWtXjRy/S6WxvO8s0tTb5Li2GFvRyidx9q4/3ja9SkXV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558347582; 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=gGGz4B2I4FrvvNPG42iaanW7ZexfkEoLlZWOTDtJ5aA=; b=T/E5Fed4+7LsEMA0oIh8GqYxQ/yBBgXUiWGrbME2NJImx+vgEepyWbwmKbPfRIlhioX1eVp1ITmPyxJ4p0BSoVUrqytoadntjVJ8/oHwrkTl8VzfN396fqQykMCgS/IeYfQyioJD++7ujfbXfU1WQU0OxtPShqHF8gDW9KfQ+3M= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1558347582013252.00608465955384; Mon, 20 May 2019 03:19: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 1hSfN9-000852-1t; Mon, 20 May 2019 10:18: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 1hSfN7-00084l-Nq for xen-devel@lists.xenproject.org; Mon, 20 May 2019 10:18:21 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 9621b350-7ae8-11e9-a659-039fc2ce5bac; Mon, 20 May 2019 10:18:18 +0000 (UTC) X-Inumbo-ID: 9621b350-7ae8-11e9-a659-039fc2ce5bac Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=SoftFail smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@MIAPEX02MSOL02.citrite.net 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; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=23.29.105.83; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: SoftFail (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com is inclined to not designate 23.29.105.83 as permitted sender) identity=mailfrom; client-ip=23.29.105.83; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 include:spf.citrix.com include:spf2.citrix.com include:ironport.citrix.com exists:%{i}._spf.mta.salesforce.com ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@MIAPEX02MSOL02.citrite.net) identity=helo; client-ip=23.29.105.83; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@MIAPEX02MSOL02.citrite.net"; x-conformance=sidf_compatible IronPort-SDR: AGfejWn/EUGs4O8uUIPMt7VfhVcFNncIj+L313f8AGgS9Jud2KEhszvkjinmSHehseb5zeNKLc V9oGp/Ejry6SlA+PGoihexxcWE3OeppSGpCOOpUvfGNlEqNxA4bhsnxY+j9DYrWu9sUJzzKB3G Rp8QVbCCiZFHw6GicqAePDu0E6UHTN3ybRT4zP9ZbT7Yz4LydozZZ8dEDrAw7VfePu21p6qnGP 0KYWOiSe8Hd0Hq5f7Vx9Moemtqc7XlJ1Sqsl6dCl/iDOHCpQbgG/mK4xYSts/gex2ldyhKXFYo 7hM= X-SBRS: 2.7 X-MesageID: 629045 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 23.29.105.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.60,491,1549947600"; d="scan'208";a="629045" From: Andrew Cooper To: Xen-devel Date: Mon, 20 May 2019 11:18:11 +0100 Message-ID: <1558347494-21640-2-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1558347494-21640-1-git-send-email-andrew.cooper3@citrix.com> References: <1558347494-21640-1-git-send-email-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 1/4] x86/pv: Fix error handling in dom0_construct_pv() 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: Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" One path in dom0_construct_pv() returns -1 unlike all other error paths. Switch it to returning -EINVAL. This was last modified by c/s c84481fb XSA-55, but the bug predates that series. However, this patch did (for no obvious reason) introduce a bifurcated tail to the function with two subtly different elf_check_broken() clauses. As the elf_check_broken() is just a warning and doesn't influence the furth= er boot, fold the exit paths together and use a single clause. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/pv/dom0_build.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c index cef2d42..064a10e 100644 --- a/xen/arch/x86/pv/dom0_build.c +++ b/xen/arch/x86/pv/dom0_build.c @@ -735,7 +735,7 @@ int __init dom0_construct_pv(struct domain *d, mapcache_override_current(NULL); switch_cr3_cr4(current->arch.cr3, read_cr4()); printk("Invalid HYPERCALL_PAGE field in ELF notes.\n"); - rc =3D -1; + rc =3D -EINVAL; goto out; } hypercall_page_initialise( @@ -903,21 +903,15 @@ int __init dom0_construct_pv(struct domain *d, rc =3D dom0_setup_permissions(d); BUG_ON(rc !=3D 0); =20 - if ( elf_check_broken(&elf) ) - printk(" Xen warning: dom0 kernel broken ELF: %s\n", - elf_check_broken(&elf)); - if ( d->domain_id =3D=3D hardware_domid ) iommu_hwdom_init(d); =20 v->is_initialised =3D 1; clear_bit(_VPF_down, &v->pause_flags); =20 - return 0; - out: if ( elf_check_broken(&elf) ) - printk(" Xen dom0 kernel broken ELF: %s\n", + printk(XENLOG_WARNING "Dom0 kernel broken ELF: %s\n", elf_check_broken(&elf)); =20 return rc; --=20 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun May 5 11:56:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1558352969; cv=none; d=zoho.com; s=zohoarc; b=FkX688omBuNbKZN3YsCBbcmo5ng2zBpI4EPHSA7i165nNPninuCAUquwMf5Ro4HmPDPNdBdLuGW9DsJrt2w/jOBwyQ0sH7rCpxGBkWmEhvvKRl5VxOeJQx9w93kjAdn3Pbkg8s/2NBD9EtGe9yWxP8NIPwtg2XAijUGb51ccZ3k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558352969; 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=I/hQ5hQse5Dv4s7Tfny4CnguDW48bXtG4pdDCIk67Ac=; b=Oux5qiwg6QINhr9BHxC3KDVXHP+Yw0n0ORU/qGJcDAWPydOqDfhiE6QbmSPXGEGYx+5SYaJlqS07b6NHvtpXqahqxSYe3kiIPL5GWM2hJFRxWi3WXZwTYT6YQAdpsrsFPr8YkhCgAVz3AArPnrPIYc8YxCdBo2R33dHDsTQpc54= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1558352969603999.7014214589973; Mon, 20 May 2019 04:49:29 -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 1hSfNB-00085r-Gw; Mon, 20 May 2019 10:18:25 +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 1hSfN9-00085P-VR for xen-devel@lists.xenproject.org; Mon, 20 May 2019 10:18:23 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 981ad59c-7ae8-11e9-8277-5781eda551ae; Mon, 20 May 2019 10:18:21 +0000 (UTC) X-Inumbo-ID: 981ad59c-7ae8-11e9-8277-5781eda551ae Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=SoftFail smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@MIAPEX02MSOL01.citrite.net 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; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=23.29.105.83; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: SoftFail (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com is inclined to not designate 23.29.105.83 as permitted sender) identity=mailfrom; client-ip=23.29.105.83; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 include:spf.citrix.com include:spf2.citrix.com include:ironport.citrix.com exists:%{i}._spf.mta.salesforce.com ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@MIAPEX02MSOL01.citrite.net) identity=helo; client-ip=23.29.105.83; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@MIAPEX02MSOL01.citrite.net"; x-conformance=sidf_compatible IronPort-SDR: +BMD2r4VwSHOxe19ETszbshqGZr3HjLzcw9oBiySnffhyTpABUlqI4824O2xPNLDWki2+wYKZo SczsCjfTs+SbmL0Mo55vlvGpoMspvxX7V+m9Hu7klkOSgbXHt2YG95gw3C4gqZYaWDa8smFryV x4vCD80QLhGYnjOpg9O8bY83LAkdUIjHkkKGM0iSWLt7cWG+E1GlbXWbYwpBIN65Jj4e/SAPKi PJCoCrigJfpS9ugiEX4FedY5CaRyTUb+Y6pPk5WVnz6IcOFwnAMbXQR2v62/l36mHltSPcnvIO azQ= X-SBRS: 2.7 X-MesageID: 629047 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 23.29.105.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.60,491,1549947600"; d="scan'208";a="629047" From: Andrew Cooper To: Xen-devel Date: Mon, 20 May 2019 11:18:12 +0100 Message-ID: <1558347494-21640-3-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1558347494-21640-1-git-send-email-andrew.cooper3@citrix.com> References: <1558347494-21640-1-git-send-email-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 2/4] x86/boot: Rename dom0_{pvh, verbose} variables to have an opt_ prefix 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: Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" For consistency with other command line options. No functional change. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/dom0_build.c | 12 ++++++------ xen/arch/x86/hvm/dom0_build.c | 2 +- xen/arch/x86/setup.c | 2 +- xen/include/asm-x86/setup.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c index 73f5407..27315d5 100644 --- a/xen/arch/x86/dom0_build.c +++ b/xen/arch/x86/dom0_build.c @@ -261,7 +261,7 @@ unsigned int __init dom0_max_vcpus(void) max_vcpus =3D opt_dom0_max_vcpus_min; if ( opt_dom0_max_vcpus_max < max_vcpus ) max_vcpus =3D opt_dom0_max_vcpus_max; - limit =3D dom0_pvh ? HVM_MAX_VCPUS : MAX_VIRT_CPUS; + limit =3D opt_dom0_pvh ? HVM_MAX_VCPUS : MAX_VIRT_CPUS; if ( max_vcpus > limit ) max_vcpus =3D limit; =20 @@ -280,8 +280,8 @@ struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom= 0) #ifdef CONFIG_SHADOW_PAGING bool __initdata opt_dom0_shadow; #endif -bool __initdata dom0_pvh =3D !IS_ENABLED(CONFIG_PV); -bool __initdata dom0_verbose; +bool __initdata opt_dom0_pvh =3D !IS_ENABLED(CONFIG_PV); +bool __initdata opt_dom0_verbose; =20 static int __init parse_dom0_param(const char *s) { @@ -296,15 +296,15 @@ static int __init parse_dom0_param(const char *s) ss =3D strchr(s, '\0'); =20 if ( IS_ENABLED(CONFIG_PV) && !cmdline_strcmp(s, "pv") ) - dom0_pvh =3D false; + opt_dom0_pvh =3D false; else if ( IS_ENABLED(CONFIG_HVM) && !cmdline_strcmp(s, "pvh") ) - dom0_pvh =3D true; + opt_dom0_pvh =3D true; #ifdef CONFIG_SHADOW_PAGING else if ( (val =3D parse_boolean("shadow", s, ss)) >=3D 0 ) opt_dom0_shadow =3D val; #endif else if ( (val =3D parse_boolean("verbose", s, ss)) >=3D 0 ) - dom0_verbose =3D val; + opt_dom0_verbose =3D val; else rc =3D -EINVAL; =20 diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c index aa599f0..8845399 100644 --- a/xen/arch/x86/hvm/dom0_build.c +++ b/xen/arch/x86/hvm/dom0_build.c @@ -484,7 +484,7 @@ static int __init pvh_populate_p2m(struct domain *d) return rc; } =20 - if ( dom0_verbose ) + if ( opt_dom0_verbose ) print_order_stats(d); =20 return 0; diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 9566b1d..0ed94a6 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1713,7 +1713,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) init_guest_cpuid(); init_guest_msr_policy(); =20 - if ( dom0_pvh ) + if ( opt_dom0_pvh ) { dom0_cfg.flags |=3D (XEN_DOMCTL_CDF_hvm_guest | ((hvm_hap_supported() && !opt_dom0_shadow) ? diff --git a/xen/include/asm-x86/setup.h b/xen/include/asm-x86/setup.h index bb4c385..15d6363 100644 --- a/xen/include/asm-x86/setup.h +++ b/xen/include/asm-x86/setup.h @@ -64,8 +64,8 @@ extern bool opt_dom0_shadow; #else #define opt_dom0_shadow false #endif -extern bool dom0_pvh; -extern bool dom0_verbose; +extern bool opt_dom0_pvh; +extern bool opt_dom0_verbose; =20 #define max_init_domid (0) =20 --=20 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun May 5 11:56:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1558347582; cv=none; d=zoho.com; s=zohoarc; b=Xok2qg2s43bJqnA8e0f507C2a02GEfakMMgy/EoIlalMqNCd4F8KRVMv8ztK2fV4P0akXuE5b2o3Sk1XfLfhTO4XaKtnETfpmtRsbbPt19nWGo8xuuleiZr2I4MBTid0TFpi10Sgo+HGr5oZdKlq4CIrQ1+5EJX/VBVGRuh5L9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558347582; 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=3mSO07NaaJ6xifk7TltOUefqlKb1eIlPr9cVfp+oIWc=; b=lfrHKQAqeVWtohCNiAWCur7hmJgSB49zmgMF+GOUjp0UV2Xg8KxyXuwibkm9MMRVqLQM4fwp0OeJ166ikG6K9/Wqyn72xgLIQ42pS4A2mGA1a5XN1pWmhCIa7i7mr7S4I6Z/qGgzIn2msPPR7WIN7Z143yoMtw11KSF1HT9znDQ= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1558347582325145.25815955913413; Mon, 20 May 2019 03:19: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 1hSfN8-00084q-EO; Mon, 20 May 2019 10:18:22 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hSfN6-00084S-Ps for xen-devel@lists.xenproject.org; Mon, 20 May 2019 10:18:20 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 96d40ae5-7ae8-11e9-8980-bc764e045a96; Mon, 20 May 2019 10:18:19 +0000 (UTC) X-Inumbo-ID: 96d40ae5-7ae8-11e9-8980-bc764e045a96 Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=SoftFail smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@MIAPEX02MSOL02.citrite.net 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; Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=23.29.105.83; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: SoftFail (esa1.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com is inclined to not designate 23.29.105.83 as permitted sender) identity=mailfrom; client-ip=23.29.105.83; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 include:spf.citrix.com include:spf2.citrix.com include:ironport.citrix.com exists:%{i}._spf.mta.salesforce.com ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@MIAPEX02MSOL02.citrite.net) identity=helo; client-ip=23.29.105.83; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@MIAPEX02MSOL02.citrite.net"; x-conformance=sidf_compatible IronPort-SDR: Qaq2mWysxf/SSS8UIpPHCAjxk7c2SN61H34G49UFI4fZOrg4ryl8X9dkRX6BbsDnWYItn2LAkr 9Jg56tvrcGPwUpMsh2OieD7JCvzrHi/lTZOSeq5FRIhb5S1FVjcn+FRv7Cw3jBnwKTJMc8USth /7kuxmhyw4PLD3uCfdEeBvAS/3YtqknFo1rx6e023qbGNtSpDojEJSpxWai4vu8bmEHAkBJfTz SRiXgAkjopPdENTvIbYnOa2F/C3Qi4BtI5f4OI1JlZy03nyeicUsYR6U+v+01nQuGg+BT18x1B NDk= X-SBRS: 2.7 X-MesageID: 641030 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 23.29.105.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.60,491,1549947600"; d="scan'208";a="641030" From: Andrew Cooper To: Xen-devel Date: Mon, 20 May 2019 11:18:13 +0100 Message-ID: <1558347494-21640-4-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1558347494-21640-1-git-send-email-andrew.cooper3@citrix.com> References: <1558347494-21640-1-git-send-email-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 3/4] x86/boot: Wire up dom0=shadow for PV dom0 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: Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This would have been very handy when debugging some pv-l1tf issues. As the= re is no cost to supporting it, wire it up. Due to the way dom0 is constructed, switching into shadow mode must be done after the pagetables are written, and because of partially being in dom0 context, shadow_enable() doesn't like the state it finds. Reuse the pv_l1tf tasklet for convenience, which will switch dom0 into shad= ow mode just before it starts executing. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- docs/misc/xen-command-line.pandoc | 14 +++++++++----- xen/arch/x86/dom0_build.c | 8 -------- xen/arch/x86/pv/dom0_build.c | 9 +++++++++ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line= .pandoc index 1fc1802..e6d241e 100644 --- a/docs/misc/xen-command-line.pandoc +++ b/docs/misc/xen-command-line.pandoc @@ -675,12 +675,16 @@ Controls for how dom0 is constructed on x86 systems. selected mode. * For a PVH dom0, the hardware must have VT-x/SVM extensions availab= le. =20 -* The `shadow` boolean is only applicable when dom0 is constructed as a = PVH - guest, and controls whether dom0 uses hardware assisted paging, or sha= dow - paging. The default is HAP when available, and shadow otherwise. +* The `shadow` boolean allows dom0 to be explicitly constructed using sh= adow + paging. This option is unavailable when `CONFIG_SHADOW_PAGING` is + disabled. =20 - This option is unavailable when `CONFIG_SHADOW_PAGING` is disabled. S= uch - builds of Xen require HAP-capable hardware to use a PVH dom0. + For PVH, dom0 defaults to using HAP on capable hardware, and falls bac= k to + shadow paging otherwise. A PVH dom0 cannot be used if Xen is compiled + without paging support, and the hardware lacks HAP support. + + For PV, the use of dom0 shadow mode is only for development purposes. = PV + guests do no require any paging support by default. =20 * The `verbose` boolean is intended for diagnostics, and prints out extra information during the dom0 build. It defaults to false. diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c index 27315d5..93e5531 100644 --- a/xen/arch/x86/dom0_build.c +++ b/xen/arch/x86/dom0_build.c @@ -588,14 +588,6 @@ int __init construct_dom0(struct domain *d, const modu= le_t *image, =20 process_pending_softirqs(); =20 -#ifdef CONFIG_SHADOW_PAGING - if ( opt_dom0_shadow && !dom0_pvh ) - { - opt_dom0_shadow =3D false; - printk(XENLOG_WARNING "Shadow Dom0 requires PVH. Option ignored.\n= "); - } -#endif - if ( is_hvm_domain(d) ) rc =3D dom0_construct_pvh(d, image, image_headroom, initrd, cmdlin= e); else if ( is_pv_domain(d) ) diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c index 064a10e..4a1526a 100644 --- a/xen/arch/x86/pv/dom0_build.c +++ b/xen/arch/x86/pv/dom0_build.c @@ -906,6 +906,15 @@ int __init dom0_construct_pv(struct domain *d, if ( d->domain_id =3D=3D hardware_domid ) iommu_hwdom_init(d); =20 + /* Activate shadow mode, if requested. Reuse the pv_l1tf tasklet. */ +#ifdef CONFIG_SHADOW_PAGING + if ( opt_dom0_shadow ) + { + printk("Switching dom0 to using shadow paging\n"); + tasklet_schedule(&d->arch.paging.shadow.pv_l1tf_tasklet); + } +#endif + v->is_initialised =3D 1; clear_bit(_VPF_down, &v->pause_flags); =20 --=20 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun May 5 11:56:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1558352974; cv=none; d=zoho.com; s=zohoarc; b=eI27h+3hhSyF4hFlOJIBUaMOsMOPlaVHq0kUhUa1GfmA3sl5SSXmMbRaS7zFBzCgjDNF6hYoXTIV60SxFWINg3oFZSgaFqedAjVsetgqjWMin++Jjpc02kSm1mzC9jujyjXsnsxvPGM7fIwv1ZYC2BAXnazsY0O6uacJ09HzTXs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558352974; 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=aJS8a6+EbSoz3N7HdqUpqCFI0W9pZWNvsVULqFFiXwU=; b=FRM8DbMIUV37AJLqc3GIIDurO10g8zcfyAV6X1YRT2j+V96FWUiWoYXoVqRpODciHIyk0B4qX8Qs8usldWYIItzV14+nO8aGXyz7ZTAdam/fNPniXdKp2h4ksVldU7uFJngx5gMvRoS822gy/u12J1KHxhqDUPo9yI/X5DlYtwE= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1558352974067632.464304833161; Mon, 20 May 2019 04:49:34 -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 1hSfN8-00084w-Oo; Mon, 20 May 2019 10:18:22 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hSfN7-00084a-3O for xen-devel@lists.xenproject.org; Mon, 20 May 2019 10:18:21 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 977aba84-7ae8-11e9-8980-bc764e045a96; Mon, 20 May 2019 10:18:20 +0000 (UTC) X-Inumbo-ID: 977aba84-7ae8-11e9-8980-bc764e045a96 Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=SoftFail smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@MIAPEX02MSOL01.citrite.net 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; Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=23.29.105.83; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: SoftFail (esa1.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com is inclined to not designate 23.29.105.83 as permitted sender) identity=mailfrom; client-ip=23.29.105.83; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 include:spf.citrix.com include:spf2.citrix.com include:ironport.citrix.com exists:%{i}._spf.mta.salesforce.com ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@MIAPEX02MSOL01.citrite.net) identity=helo; client-ip=23.29.105.83; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@MIAPEX02MSOL01.citrite.net"; x-conformance=sidf_compatible IronPort-SDR: LKv5Zr2d4JflOrzLK105P6AbjiMap8a2SxIsNWKV8Kvevb77qalPy3K91Obvj4qnuSk1ZH3nbu /3NNQ9blhKRZAlcE3RR1He8wO54NcIaThuH/Gof1Gc28KPV5fbSWwvScSNPTGZD1UQN1rpviQK eYtYUT/UAKa3p9dKyzEk4HZZUT4IhxeqbjYcRtRZlVQDMomZfWm3JKWQdWx95JgxwhIajBMQr8 zDDcwSkAkxbuO4+sbFowI2wF80RXYEGLhLjPVqm+rZx8BnTj7zwB4SKa/JhEj+7VKFkFh/oqUB wVo= X-SBRS: 2.7 X-MesageID: 641031 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 23.29.105.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.60,491,1549947600"; d="scan'208";a="641031" From: Andrew Cooper To: Xen-devel Date: Mon, 20 May 2019 11:18:14 +0100 Message-ID: <1558347494-21640-5-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1558347494-21640-1-git-send-email-andrew.cooper3@citrix.com> References: <1558347494-21640-1-git-send-email-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 4/4] x86/boot: Link opt_dom0_verbose to CONFIG_VERBOSE_DEBUG 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: Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" We currently have an asymmetric setup where CONFIG_VERBOSE_DEBUG controls extra diagnostics for a PV dom0, and opt_dom0_verbose controls extra diagnostics for a PVH dom0. Default opt_dom0_verbose to CONFIG_VERBOSE_DEBUG and use opt_dom0_verbose consistently. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- docs/misc/xen-command-line.pandoc | 3 ++- xen/arch/x86/dom0_build.c | 2 +- xen/arch/x86/pv/dom0_build.c | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line= .pandoc index e6d241e..51dc8ae 100644 --- a/docs/misc/xen-command-line.pandoc +++ b/docs/misc/xen-command-line.pandoc @@ -687,7 +687,8 @@ Controls for how dom0 is constructed on x86 systems. guests do no require any paging support by default. =20 * The `verbose` boolean is intended for diagnostics, and prints out extra - information during the dom0 build. It defaults to false. + information during the dom0 build. It defaults to the compile time ch= oice + of `CONFIG_VERBOSE_DEBUG`. =20 ### dom0-iommu =3D List of [ passthrough=3D, strict=3D, map-inclusive=3D<= bool>, diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c index 93e5531..9b06363 100644 --- a/xen/arch/x86/dom0_build.c +++ b/xen/arch/x86/dom0_build.c @@ -281,7 +281,7 @@ struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom= 0) bool __initdata opt_dom0_shadow; #endif bool __initdata opt_dom0_pvh =3D !IS_ENABLED(CONFIG_PV); -bool __initdata opt_dom0_verbose; +bool __initdata opt_dom0_verbose =3D IS_ENABLED(CONFIG_VERBOSE_DEBUG); =20 static int __init parse_dom0_param(const char *s) { diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c index 4a1526a..903611f 100644 --- a/xen/arch/x86/pv/dom0_build.c +++ b/xen/arch/x86/pv/dom0_build.c @@ -345,9 +345,10 @@ int __init dom0_construct_pv(struct domain *d, =20 if ( (rc =3D elf_init(&elf, image_start, image_len)) !=3D 0 ) return rc; -#ifdef CONFIG_VERBOSE_DEBUG - elf_set_verbose(&elf); -#endif + + if ( opt_dom0_verbose ) + elf_set_verbose(&elf); + elf_parse_binary(&elf); if ( (rc =3D elf_xen_parse(&elf, &parms)) !=3D 0 ) goto out; --=20 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel