From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 1/4] tools: arm: report an error if the guest RAM is too large Date: Tue, 08 Apr 2014 15:50:32 +0100 Message-ID: <53440CB8.2090307@linaro.org> References: <1396966739.22845.233.camel@kazak.uk.xensource.com> <1396966760-7752-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1396966760-7752-1-git-send-email-ian.campbell@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: Ian Campbell Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Hi Ian, On 04/08/2014 03:19 PM, Ian Campbell wrote: > Due to the layout of the guest physical address space we cannot support more > than 768M of RAM before overrunning the area set aside for the grant table. Due > to the presence of the magic pages at the end of the RAM region guests are > actually limited to 767M. > > Catch this case during domain build and fail gracefully instead of obscurely > later on. > > Signed-off-by: Ian Campbell > --- > This is the only patch in this series which I consider to be suitable for > backporting to Xen 4.4 Sounds good backport this patch. I'm wondering if patch #2 can also be backported. > --- > tools/libxc/xc_dom_arm.c | 8 ++++++++ > xen/include/public/arch-arm.h | 3 ++- > 2 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c > index 3330f12..c085b4a 100644 > --- a/tools/libxc/xc_dom_arm.c > +++ b/tools/libxc/xc_dom_arm.c > @@ -262,6 +262,14 @@ int arch_setup_meminit(struct xc_dom_image *dom) > const uint64_t modsize = dtb_size + ramdisk_size; > const uint64_t ram128mb = rambase + (128<<20); > > + if ( ramend - 1 > GUEST_RAM_END - NR_MAGIC_PAGES*XC_PAGE_SIZE ) Can you add parenthesis for more readability? Regards, -- Julien Grall