From: Ian Campbell Subject: Re: [PATCH 8/8] arm: add dom0_mem command line argument Date: Wed, 14 Mar 2012 10:48:14 +0000 Message-ID: <1331722094.23971.393.camel@zakaz.uk.xensource.com> References: <1330448064-32267-1-git-send-email-david.vrabel@citrix.com> <1330448064-32267-9-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1330448064-32267-9-git-send-email-david.vrabel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Tue, 2012-02-28 at 16:54 +0000, David Vrabel wrote: > From: David Vrabel > > Add a simple dom0_mem command line argument. It's not as flexible as > the x86 equivalent (the 'max' and 'min' prefixes are not supported). I presume we'd want to support them in the future. Looks good as it stands though. > > Signed-off-by: David Vrabel > --- > xen/arch/arm/domain_build.c | 15 +++++++++++++-- > 1 files changed, 13 insertions(+), 2 deletions(-) > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > index ca8c706..26f1104 100644 > --- a/xen/arch/arm/domain_build.c > +++ b/xen/arch/arm/domain_build.c > @@ -18,6 +18,17 @@ > static unsigned int __initdata opt_dom0_max_vcpus; > integer_param("dom0_max_vcpus", opt_dom0_max_vcpus); > > +#define DOM0_MEM_DEFAULT 0x8000000 /* 128 MiB */ > +static u64 __initdata dom0_mem = DOM0_MEM_DEFAULT; > + > +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); > + > struct vcpu *__init alloc_dom0_vcpu0(void) > { > dom0->vcpu = xmalloc_array(struct vcpu *, opt_dom0_max_vcpus); > @@ -181,6 +192,8 @@ static int prepare_dtb(struct domain *d, struct kernel_info *dom0) > int new_size; > int ret; > > + dom0->unassigned_mem = dom0_mem; > + > fdt = device_tree_flattened; > > new_size = fdt_totalsize(fdt) + 8192; > @@ -238,8 +251,6 @@ int construct_dom0(struct domain *d) > if ( (rc = p2m_alloc_table(d)) != 0 ) > return rc; > > - kinfo.unassigned_mem = 0x08000000; /* XXX */ > - > rc = prepare_dtb(d, &kinfo); > if (rc < 0) > return rc;