* [PATCH v4] xen/arm: warn if dom0_mem is not specified
@ 2017-02-27 23:14 Stefano Stabellini
2017-02-28 10:21 ` Wei Liu
2017-02-28 15:47 ` Julien Grall
0 siblings, 2 replies; 3+ messages in thread
From: Stefano Stabellini @ 2017-02-27 23:14 UTC (permalink / raw)
To: julien.grall; +Cc: xen-devel, sstabellini, wei.liu2
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 <sstabellini@kernel.org>
---
Changes in v4:
- use warning_add
Changes in v3:
- update docs
---
docs/misc/xen-command-line.markdown | 8 +++++++-
xen/arch/arm/domain_build.c | 15 ++++++++++-----
2 files changed, 17 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)
+> `= <size>`
+
+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:<size> | max:<size> | <size> )`
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..7949b2b 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -13,6 +13,7 @@
#include <xen/guest_access.h>
#include <xen/iocap.h>
#include <xen/acpi.h>
+#include <xen/warning.h>
#include <acpi/actables.h>
#include <asm/device.h>
#include <asm/setup.h>
@@ -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,14 @@ 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
+ {
+ warning_add("PLEASE SPECIFY dom0_mem PARAMETER - USING 512M FOR NOW\n");
+ dom0_mem = MB(512);
+ }
+
iommu_hwdom_init(d);
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v4] xen/arm: warn if dom0_mem is not specified
2017-02-27 23:14 [PATCH v4] xen/arm: warn if dom0_mem is not specified Stefano Stabellini
@ 2017-02-28 10:21 ` Wei Liu
2017-02-28 15:47 ` Julien Grall
1 sibling, 0 replies; 3+ messages in thread
From: Wei Liu @ 2017-02-28 10:21 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: xen-devel, julien.grall, wei.liu2
On Mon, Feb 27, 2017 at 03:14:07PM -0800, Stefano Stabellini wrote:
> 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 <sstabellini@kernel.org>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v4] xen/arm: warn if dom0_mem is not specified
2017-02-27 23:14 [PATCH v4] xen/arm: warn if dom0_mem is not specified Stefano Stabellini
2017-02-28 10:21 ` Wei Liu
@ 2017-02-28 15:47 ` Julien Grall
1 sibling, 0 replies; 3+ messages in thread
From: Julien Grall @ 2017-02-28 15:47 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: xen-devel, nd, wei.liu2
Hi Stefano,
On 27/02/17 23:14, Stefano Stabellini wrote:
> 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 <sstabellini@kernel.org>
> ---
> Changes in v4:
> - use warning_add
>
> Changes in v3:
> - update docs
> ---
> docs/misc/xen-command-line.markdown | 8 +++++++-
> xen/arch/arm/domain_build.c | 15 ++++++++++-----
> 2 files changed, 17 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)
> +> `= <size>`
> +
> +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:<size> | max:<size> | <size> )`
>
> 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..7949b2b 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -13,6 +13,7 @@
> #include <xen/guest_access.h>
> #include <xen/iocap.h>
> #include <xen/acpi.h>
> +#include <xen/warning.h>
> #include <acpi/actables.h>
> #include <asm/device.h>
> #include <asm/setup.h>
> @@ -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,14 @@ 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");
warning_add will not print the message until Xen has boot so we have no
way to know when DOM0 is getting loaded when dom0_mem is not set.
So I would keep this printk in all the case.
With that:
Reviewed-by: Julien Grall <julien.grall@arm.com>
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-28 15:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-27 23:14 [PATCH v4] xen/arm: warn if dom0_mem is not specified Stefano Stabellini
2017-02-28 10:21 ` Wei Liu
2017-02-28 15:47 ` Julien Grall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).