From patchwork Mon Oct 3 10:09:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9360363 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 137DC601C0 for ; Mon, 3 Oct 2016 10:12:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 018E6288DF for ; Mon, 3 Oct 2016 10:12:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9F2228901; Mon, 3 Oct 2016 10:12:35 +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 DD9B6288DF for ; Mon, 3 Oct 2016 10:12:34 +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 1br0C1-00020i-VF; Mon, 03 Oct 2016 10:09:53 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1br0C0-00020c-UK for xen-devel@lists.xenproject.org; Mon, 03 Oct 2016 10:09:53 +0000 Received: from [193.109.254.147] by server-11.bemta-6.messagelabs.com id AF/DC-08498-07E22F75; Mon, 03 Oct 2016 10:09:52 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLIsWRWlGSWpSXmKPExsXitHSDvW6+3qd wg1vXNC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozbfw6xFGyXqejv9G9gXCrexcjJISHgL9H+ 9R5zFyMHB4uAisSTf6IgYTYBHYmLc3eygdgiAsoSvb9+s3QxcnEwC3QySpz70McMkhAW8JR42 HSIFcTmFTCU+NS4iwmkSEhgM6PEsudvmCASghInZz5hAbGZgaYu2P2JDWQZs4C0xPJ/HCBhTg F7iUc/l4DNEQW6YdusvWCLhQQUJfrnPQArlxDglvjbbT+BkX8WkqGzkAydhTB0ASPzKkb14tS istQiXQu9pKLM9IyS3MTMHF1DAzO93NTi4sT01JzEpGK95PzcTYzA4GMAgh2Msy/7H2KU5GBS EuX13/wxXIgvKT+lMiOxOCO+qDQntfgQowYHh8DmtasvMEqx5OXnpSpJ8AbrfgoXEixKTU+tS MvMAcYHTKkEB4+SCC8rMEaEeIsLEnOLM9MhUqcYdTm2LLixlkkIbIaUOK8QyAwBkKKM0jy4Eb BYvcQoKyXMywh0oBBPQWpRbmYJqvwrRnEORiVh3nSQKTyZeSVwm14BHcEEdETglg8gR5QkIqS kGhiLPu89trYvYx3n2mn+62w+/IgPy9zw2HXdpY9vuH4XF62bn7Lnvc/BbObzaY4FurGBPZai dUq/Lp+X6j8tvLf1loYjr4Fu0tsED23fyx1+dqerJzHHXc4ou/eWpbs8OC433qmhfPd6o/Uq+ vsk7U+5lMQvKLkRyztx8WPnAI/DNnpbVzn9alZiKc5INNRiLipOBABLYOJU0AIAAA== X-Env-Sender: prvs=0778a7c12=roger.pau@citrix.com X-Msg-Ref: server-10.tower-27.messagelabs.com!1475489390!63032480!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: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15860 invoked from network); 3 Oct 2016 10:09:51 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-10.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 3 Oct 2016 10:09:51 -0000 X-IronPort-AV: E=Sophos;i="5.31,289,1473120000"; d="scan'208";a="390300099" Date: Mon, 3 Oct 2016 12:09:48 +0200 From: Roger Pau Monne To: Jan Beulich Message-ID: <20161003100948.b4uhjv45urnhttg4@mac> References: <1474991845-27962-1-git-send-email-roger.pau@citrix.com> <1474991845-27962-12-git-send-email-roger.pau@citrix.com> <57EE9AE602000078001145BD@prv-mh.provo.novell.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <57EE9AE602000078001145BD@prv-mh.provo.novell.com> User-Agent: NeoMutt/20160916 (1.7.0) X-DLP: MIA1 Cc: Andrew Cooper , boris.ostrovsky@oracle.com, xen-devel@lists.xenproject.org Subject: Re: [Xen-devel] [PATCH v2 11/30] xen/x86: split Dom0 build into PV and PVHv2 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 On Fri, Sep 30, 2016 at 09:03:34AM -0600, Jan Beulich wrote: > >>> On 27.09.16 at 17:57, wrote: > > --- a/docs/misc/xen-command-line.markdown > > +++ b/docs/misc/xen-command-line.markdown > > @@ -663,6 +663,13 @@ Pin dom0 vcpus to their respective pcpus > > > > Flag that makes a 64bit dom0 boot in PVH mode. No 32bit support at present. > > > > +### dom0hvm > > +> `= ` > > + > > +> Default: `false` > > + > > +Flag that makes a dom0 boot in PVHv2 mode. > > Considering sorting aspects this clearly wants to go at least ahead of > dom0pvh. > > > --- a/xen/arch/x86/setup.c > > +++ b/xen/arch/x86/setup.c > > @@ -75,6 +75,10 @@ unsigned long __read_mostly cr4_pv32_mask; > > static bool_t __initdata opt_dom0pvh; > > boolean_param("dom0pvh", opt_dom0pvh); > > > > +/* Boot dom0 in HVM mode */ > > +static bool_t __initdata opt_dom0hvm; > > Plain bool please. > > > @@ -1495,6 +1499,11 @@ void __init noreturn __start_xen(unsigned long mbi_p) > > if ( opt_dom0pvh ) > > domcr_flags |= DOMCRF_pvh | DOMCRF_hap; > > > > + if ( opt_dom0hvm ) { > > Coding style. Fixed all the above. > > + domcr_flags |= DOMCRF_hvm | (hvm_funcs.hap_supported ? DOMCRF_hap : 0); > > So you mean to support PVHv2 on shadow (including for Dom0) > right away. Are you also testing that? I've added the following patch to my queue, in order to allow the user to select whether they want to use HAP or shadow, I've tested it locally and there seems to be no issues in building a PVHv2 Dom0 using shadow. diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index 80e20fa..17956e2 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -203,13 +203,6 @@ struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0) return setup_dom0_vcpu(dom0, 0, cpumask_first(&dom0_cpus)); } -#ifdef CONFIG_SHADOW_PAGING -static bool_t __initdata opt_dom0_shadow; -boolean_param("dom0_shadow", opt_dom0_shadow); -#else -#define opt_dom0_shadow 0 -#endif - static char __initdata opt_dom0_ioports_disable[200] = ""; string_param("dom0_ioports_disable", opt_dom0_ioports_disable); diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 9272318..252125d 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -79,6 +79,11 @@ boolean_param("dom0pvh", opt_dom0pvh); static bool_t __initdata opt_dom0hvm; boolean_param("dom0hvm", opt_dom0hvm); +#ifdef CONFIG_SHADOW_PAGING +bool __initdata opt_dom0_shadow; +boolean_param("dom0_shadow", opt_dom0_shadow); +#endif + /* **** Linux config option: propagated to domain0. */ /* "acpi=off": Sisables both ACPI table parsing and interpreter. */ /* "acpi=force": Override the disable blacklist. */ @@ -1500,7 +1505,9 @@ void __init noreturn __start_xen(unsigned long mbi_p) domcr_flags |= DOMCRF_pvh | DOMCRF_hap; if ( opt_dom0hvm ) { - domcr_flags |= DOMCRF_hvm | (hvm_funcs.hap_supported ? DOMCRF_hap : 0); + domcr_flags |= DOMCRF_hvm | + (hvm_funcs.hap_supported && !opt_dom0_shadow ? + DOMCRF_hap : 0); config.emulation_flags = XEN_X86_EMU_LAPIC|XEN_X86_EMU_IOAPIC; } diff --git a/xen/include/asm-x86/setup.h b/xen/include/asm-x86/setup.h index c65b79c..888d952 100644 --- a/xen/include/asm-x86/setup.h +++ b/xen/include/asm-x86/setup.h @@ -51,6 +51,12 @@ void microcode_grab_module( extern uint8_t kbd_shift_flags; +#ifdef CONFIG_SHADOW_PAGING +extern bool opt_dom0_shadow; +#else +#define opt_dom0_shadow 0 +#endif + #ifdef NDEBUG # define highmem_start 0 #else