From patchwork Mon Feb 20 18:22:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9583447 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 72CDE604A0 for ; Mon, 20 Feb 2017 18:24:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F475287F2 for ; Mon, 20 Feb 2017 18:24:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6197C28823; Mon, 20 Feb 2017 18:24:41 +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 14E41287F2 for ; Mon, 20 Feb 2017 18:24:39 +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 1cfsbJ-0005kH-Ef; Mon, 20 Feb 2017 18:22:17 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfsbJ-0005kB-1w for xen-devel@lists.xenproject.org; Mon, 20 Feb 2017 18:22:17 +0000 Received: from [85.158.143.35] by server-6.bemta-6.messagelabs.com id 64/1B-15112-8D33BA85; Mon, 20 Feb 2017 18:22:16 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRWlGSWpSXmKPExsVybKJsh+5149U RBivuaFl83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBkfr65mKdgjUrFq3SHmBsa1Al2MXBxCAlMZ JRZtbGeBcHYwSRxuuQjkcHKwCRhK/H2yiQ3EFhGQkNjUsIIJxGYWsJa49+YHO4gtDGRPn3sfr IZFQFXi2O3DYDW8Aq4Sl2eeYgaxJQTkJE4em8wKYWdIzOuZA2V7SSy6cQnKVpO4em4T8wRGng WMDKsY1YtTi8pSi3TN9ZKKMtMzSnITM3N0DQ3M9HJTi4sT01NzEpOK9ZLzczcxAv3OAAQ7GGd e9j/EKMnBpCTKe2fJqgghvqT8lMqMxOKM+KLSnNTiQ4wyHBxKErzXjFZHCAkWpaanVqRl5gAD ECYtwcGjJMLrB5LmLS5IzC3OTIdInWJUlBLnPQqSEABJZJTmwbXBgv4So6yUMC8j0CFCPAWpR bmZJajyrxjFORiVhHn7QabwZOaVwE1/BbSYCWjxTY+VIItLEhFSUg2Ms1f9OcAnv/t30brDUn VrT2gfNjoSc5HZ5vWl/8mnHrfss4grfVb6/mv9urM8kqKiWrMdXzpZP5/tMDeZc5Ou6RWz2FK FCQqmf6Tvs63tEio+5xf13MXYunX9O8uac3Pe1ZyyDVlWUXnIdfqJuROnx4rsPKl4c49o6gqV TJ20tO2TZ76boldro8RSnJFoqMVcVJwIAMc8auF1AgAA X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-6.tower-21.messagelabs.com!1487614934!35593072!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11312 invoked from network); 20 Feb 2017 18:22:15 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-6.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 20 Feb 2017 18:22:15 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2AE5D20263; Mon, 20 Feb 2017 18:22:13 +0000 (UTC) Received: from sstabellini-ThinkPad-X260.hsd1.ca.comcast.net (c-50-131-44-19.hsd1.ca.comcast.net [50.131.44.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2149D2025B; Mon, 20 Feb 2017 18:22:12 +0000 (UTC) From: Stefano Stabellini To: julien.grall@arm.com Date: Mon, 20 Feb 2017 10:22:06 -0800 Message-Id: <1487614926-5383-1-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 X-Virus-Scanned: ClamAV using ClamSMTP Cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org Subject: [Xen-devel] [PATCH] xen/arm: warn if dom0_mem is not specified 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The default dom0_mem is 128M which is not sufficient to boot a Ubuntu based Dom0. It is not clear what a better default value could be. Instead, loudly warn the user when dom0_mem is unspecified and wait 3 secs. Then use 512M. Update the docs to specify that dom0_mem is required on ARM. (The current xen-command-line document does not actually reflect the current behavior of dom0_mem on ARM correctly.) Signed-off-by: Stefano Stabellini --- Changes in v3: - update docs --- docs/misc/xen-command-line.markdown | 8 +++++++- xen/arch/arm/domain_build.c | 22 +++++++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown index a11fdf9..c0106fb 100644 --- a/docs/misc/xen-command-line.markdown +++ b/docs/misc/xen-command-line.markdown @@ -603,7 +603,13 @@ For example, with `dom0_max_vcpus=4-8`: > 8 | 8 > 10 | 8 -### dom0\_mem +### dom0\_mem (ARM) +> `= ` + +Set the amount of memory for the initial domain (dom0). It must be +greater than zero. This parameter is required. + +### dom0\_mem (x86) > `= List of ( min: | max: | )` Set the amount of memory for the initial domain (dom0). If a size is diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index c97a1f5..db7471f 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -31,14 +32,11 @@ integer_param("dom0_max_vcpus", opt_dom0_max_vcpus); int dom0_11_mapping = 1; -#define DOM0_MEM_DEFAULT 0x8000000 /* 128 MiB */ -static u64 __initdata dom0_mem = DOM0_MEM_DEFAULT; +static u64 __initdata dom0_mem; static void __init parse_dom0_mem(const char *s) { dom0_mem = parse_size_and_unit(s, &s); - if ( dom0_mem == 0 ) - dom0_mem = DOM0_MEM_DEFAULT; } custom_param("dom0_mem", parse_dom0_mem); @@ -2125,7 +2123,21 @@ int construct_dom0(struct domain *d) BUG_ON(d->vcpu[0] == NULL); BUG_ON(v->is_initialised); - printk("*** LOADING DOMAIN 0 ***\n"); + if ( dom0_mem > 0 ) + printk("*** LOADING DOMAIN 0 ***\n"); + else + { + int i; + printk("*** PLEASE SPECIFY dom0_mem PARAMETER - USING 512M FOR NOW ***\n"); + for (i = 0; i < 3; i++) + { + printk("%d...", i+1); + mdelay(1000); + } + printk("\n"); + dom0_mem = MB(512); + } + iommu_hwdom_init(d);