From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arianna Avanzini Subject: Re: Xen on ARM: "Failed to allocate contiguous memory for dom0" with dom0_mem greater than 256MB Date: Fri, 24 Jan 2014 17:17:37 +0100 Message-ID: <52E29221.2080804@gmail.com> References: <52E239AB.8040906@gmail.com> <1390558450.2124.24.camel@kazak.uk.xensource.com> Reply-To: Arianna Avanzini Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1390558450.2124.24.camel@kazak.uk.xensource.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: Ian Campbell Cc: Paolo Gai , Paolo Valente , Stefano Stabellini , Dario Faggioli , Claudio Scordino , xen-devel , Julien Grall , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org On 01/24/2014 11:14 AM, Ian Campbell wrote: > On Fri, 2014-01-24 at 11:00 +0100, Arianna Avanzini wrote: >> I noticed that Xen 4.4 fails to boot the dom0 if more than 256MB of RAM are >> assigned to it by providing the dom0_mem boot option. The error message produced >> during the boot process is the following. > > This is an unfortunate side effect of the use of the 1:1 mapping. The > threads: > "Master not working on Allwinner A20" > "create multiple banks for dom0 in 1:1 mapping if necessary" > Have some more details, but in short the allocation of dom0 memory needs > to be done in a single chunk and because of the way the Xen allocator > works it will also be aligned to its own size -- this creates some > limitations on the size of the region vs what memory is free at start of > day > > I'm afraid this probably won't be solved for Xen 4.4, since the change > is likely to be rather intrusive. > I see, thank you for the explanation. > As a workaround you could try changing the load addresses of Xen and the > kernel, dtb etc used by u-boot to pack them towards the top of RAM. This > *should* result in the entire lower half of RAM being available which > will make it more likely to achieve the necessary alignment constraints > for a dom0 taking up to half of the system RAM. I've not actually tried > this but I'd recommend trying the following addresses from the top of > RAM: > -2M: Leave free for Xen to relocate to > -4M: dom0 kernel > -6M: DTB > -8M: Initial Xen load address > > If you have an initrd then put it between dom0 kernel and dtb and bump > everything else down, likewise if anything is bigger than 2M then round > up to 2M and push everything down to accommodate it. > > Also consider that for a Xen system it is common to only give dom0 a > fairly small fraction of the system RAM in order to leave as much as > possible for guest domains. What target amount of dom0 memory are you > aiming for? 256M or even 128M is probably plenty if you are going to run > a few domains. > So far, 256MB of RAM are actually enough for a dom0 in my use-case. Thank you again for the info and hints, and for taking the time to test both the failing scenario and the workaround. > Ian. > -- /* * Arianna Avanzini * avanzini.arianna@gmail.com * 73628@studenti.unimore.it */