From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: [PATCH 11/11] arm: add dom0_mem command line argument Date: Mon, 19 Mar 2012 17:52:09 +0000 Message-ID: <1332179529-1828-12-git-send-email-david.vrabel@citrix.com> References: <1332179529-1828-1-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: <1332179529-1828-1-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: xen-devel@lists.xensource.com Cc: Ian Campbell , David Vrabel List-Id: xen-devel@lists.xenproject.org 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). 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 963f1cf..cefd693 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -17,6 +17,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); + /* * Amount of extra space required to dom0's device tree. No new nodes * are added (yet) so no additional space is needed. @@ -193,6 +204,8 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo) int new_size; int ret; + kinfo->unassigned_mem = dom0_mem; + fdt = device_tree_flattened; new_size = fdt_totalsize(fdt) + DOM0_FDT_EXTRA_SIZE; @@ -261,8 +274,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; -- 1.7.2.5