Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Limiting Memory assigned to Xen
I'm trying to get Xen to leave 1MB or so at the top of memory that can be used outside of Xen, Dom0, or guests. Think R5 or or a PL master that needs some memory to use independent of the rest of the system.  How can this be accomplished?

I see the mem= command line option, but when I specify that to be 2047M, xl info still shows a full 2GB of memory listed in "total_memory" - I would expect total_memory to be 2047 instead of 2048. 

Here is the output of xl info:

root@Xilinx-ZCU102-2016_1:~# xl info
host                   : Xilinx-ZCU102-2016_1
release                : 4.4.0
version                : #2 SMP Thu Aug 4 16:07:59 EDT 2016
machine                : aarch64
nr_cpus                : 4
max_cpu_id             : 127
nr_nodes               : 1
cores_per_socket       : 1
threads_per_core       : 1
cpu_mhz                : 100
hw_caps                : 00000000:00000000:00000000:00000000:00000000:00000000:00000000:00000000
virt_caps              :
total_memory           : 2048
free_memory            : 1506
sharing_freed_memory   : 0
sharing_used_memory    : 0
outstanding_claims     : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 7
xen_extra              : -unstable
xen_version            : 4.7-unstable
xen_caps               : xen-3.0-aarch64 xen-3.0-armv7l
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0x200000
xen_changeset          :
xen_commandline        : console=dtuart dtuart=serial0 mem=2047M dom0_mem=512M bootscrub=0 maxcpus=1 timer_slop=0 dom0_vcpus_pin dom0_max_vcpus=1
cc_compiler            : aarch64-linux-gnu-gcc (crosstool-NG linaro-1.13.1-4.9-2014.09 -
cc_compile_by          : xilinxfae
cc_compile_domain      :
cc_compile_date        : Thu Aug  4 15:52:32 EDT 2016
xend_config_format     : 4

Does anyone see what I'm doing wrong, or is this command line option not supported?


How I've done this in the past is to modify the "memory" node in the device tree to leave that gap. However, the versions of u-boot packaged with Petalinux (2016.1, 2016.2) overwrite that node with 2GB, regardless of how you want it configured, so you'll need to make that change and re-build your u-boot.

u-boot-xlnx/common/fdt_common.c, fdt_fixup_memory_banks(), comment out the call to fdt_setprop(). Alternately, comment out the entire contents of the function and just return 0.


Thanks Jarvis - I was hoping to use the Xen command line to get past the need to modify u-boot. I was hoping mem option would do the trick - do you know if that works or not? Have you ever tried this?

Looking at the code, I would said it would not, because it seems to be an x86-only parameter.
Yes, is was confirmed on Xen mailing list that mem= is not yet supported for ARM. 

Thanks for the confirmation Terry!

Forum Jump:

Users browsing this thread: 1 Guest(s)