From patchwork Mon Mar 27 13:34:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9646721 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 828A3602C8 for ; Mon, 27 Mar 2017 13:37:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7280328307 for ; Mon, 27 Mar 2017 13:37:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6545227F80; Mon, 27 Mar 2017 13:37:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9FBAB27F80 for ; Mon, 27 Mar 2017 13:37:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csUnG-0005g9-7Q; Mon, 27 Mar 2017 13:34:46 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csUnF-0005g2-Em for xen-devel@lists.xenproject.org; Mon, 27 Mar 2017 13:34:45 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id F3/7E-32461-4F419D85; Mon, 27 Mar 2017 13:34:44 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLIsWRWlGSWpSXmKPExsXitHSDve4XkZs RBp+WCVl83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBlrbvazFTyQqpj9u4W1gfG7aBcjB4eEgL/E 5gmMXYycHGwCyhI/O3vZQGwRAT2JpgPPgeJcHMwCXxglPm9vZQJJCAtYS5yYeB+sgUVAVWLO1 GfMIDavgLlE08lZ7CC2hIC8xK62i6wQcUGJkzOfsIDYzAKaEq3bf7ND2PISzVtng/UKCShIdE w/xjSBkWcWkpZZSFpmIWlZwMi8ilGjOLWoLLVI18hIL6koMz2jJDcxM0fX0MBULze1uDgxPTU nMalYLzk/dxMjMHjqGRgYdzDuafc7xCjJwaQkyvvh9I0IIb6k/JTKjMTijPii0pzU4kOMGhwc ApvXrr7AKMWSl5+XqiTBe4L/ZoSQYFFqempFWmYOMLxhSiU4eJREeOUFgdK8xQWJucWZ6RCpU 4y6HLca9rxhEgKbISXOyyUAVCQAUpRRmgc3AhZrlxhlpYR5GRkYGIR4ClKLcjNLUOVfMYpzMC oJ887kAprCk5lXArfpFdARTEBHHJ5/A+SIkkSElFQD44ZU1h+hxV+drKY+3mTP7s5qrZq/Rsx 7p/6GTZtld80U3xfS9aXKjF/qatDKyldTb8sq5VbLTXmwvtEjQFLw75Sunfy7Fsv6sNdFL2n7 csm/Pu/A46fVYl2hR0uuNHFf7br5w7/uTSz/9F+BU893TLwxKfLwJDaR7Gfx88/ISHeGFRcs9 LoqoMRSnJFoqMVcVJwIAO5r+NSwAgAA X-Env-Sender: prvs=25272e2f3=wei.liu2@citrix.com X-Msg-Ref: server-15.tower-206.messagelabs.com!1490621682!77552872!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 50682 invoked from network); 27 Mar 2017 13:34:43 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 27 Mar 2017 13:34:43 -0000 X-IronPort-AV: E=Sophos;i="5.36,231,1486425600"; d="scan'208";a="424870976" From: Wei Liu To: Xen-devel Date: Mon, 27 Mar 2017 14:34:01 +0100 Message-ID: <20170327133401.3573-1-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Cc: Wei Liu , George Dunlap , Andrew Cooper , Tim Deegan , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [Xen-devel] [PATCH v3] x86: clarify shadow paging Dom0 support X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Classic PV shadow paging Dom0 has been broken for years, and can't possibly be configured after 4045953. PVH shadow paging Dom0 should still be possible. Change the code and documentation to clarify that. Signed-off-by: Wei Liu Acked-by: Jan Beulich --- v3: 1. don't panic v2: 1. simplify need_paging 2. move panic to construct_dom0 Cc: Jan Beulich Cc: Andrew Cooper Cc: Tim Deegan Cc: George Dunlap Cc: Roger Pau Monné --- docs/misc/xen-command-line.markdown | 8 ++------ xen/arch/x86/dom0_build.c | 11 ++++++++--- xen/arch/x86/pv/dom0_build.c | 5 ----- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown index bdbdb8a53b..9eb85d68b5 100644 --- a/docs/misc/xen-command-line.markdown +++ b/docs/misc/xen-command-line.markdown @@ -652,11 +652,6 @@ restrictions set up here. Note that the values to be specified here are ACPI PXM ones, not Xen internal node numbers. `relaxed` sets up vCPU affinities to prefer but be not limited to the specified node(s). -### dom0\_shadow -> `= ` - -This option is deprecated, please use `dom0=shadow` instead. - ### dom0\_vcpus\_pin > `= ` @@ -679,7 +674,8 @@ Flag that makes a dom0 boot in PVHv2 mode. > Default: `false` -Flag that makes a dom0 use shadow paging. +Flag that makes a dom0 use shadow paging. Only works when "pvh" is +enabled. ### dtuart (ARM) > `= path [:options]` diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c index 20221b5e32..8597d43b11 100644 --- a/xen/arch/x86/dom0_build.c +++ b/xen/arch/x86/dom0_build.c @@ -174,7 +174,6 @@ struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0) #ifdef CONFIG_SHADOW_PAGING bool __initdata opt_dom0_shadow; -boolean_param("dom0_shadow", opt_dom0_shadow); #endif bool __initdata dom0_pvh; @@ -252,8 +251,8 @@ unsigned long __init dom0_compute_nr_pages( avail -= max_pdx >> s; } - need_paging = is_hvm_domain(d) ? !iommu_hap_pt_share || !paging_mode_hap(d) - : opt_dom0_shadow; + need_paging = is_hvm_domain(d) && + (!iommu_hap_pt_share || !paging_mode_hap(d)); for ( ; ; need_paging = 0 ) { nr_pages = dom0_nrpages; @@ -456,6 +455,12 @@ int __init construct_dom0(struct domain *d, const module_t *image, process_pending_softirqs(); + if ( opt_dom0_shadow && !dom0_pvh ) + { + opt_dom0_shadow = false; + printk("Shadow Dom0 requires PVH. Option ignored."); + } + return (is_hvm_domain(d) ? dom0_construct_pvh : dom0_construct_pv) (d, image, image_headroom, initrd,bootstrap_map, cmdline); } diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c index 65cd2c5019..18c19a256f 100644 --- a/xen/arch/x86/pv/dom0_build.c +++ b/xen/arch/x86/pv/dom0_build.c @@ -870,11 +870,6 @@ int __init dom0_construct_pv(struct domain *d, regs->rsi = vstartinfo_start; regs->eflags = X86_EFLAGS_IF; -#ifdef CONFIG_SHADOW_PAGING - if ( opt_dom0_shadow && paging_enable(d, PG_SH_enable) == 0 ) - paging_update_paging_modes(v); -#endif - if ( test_bit(XENFEAT_supervisor_mode_kernel, parms.f_required) ) panic("Dom0 requires supervisor-mode execution");