From: Ian Campbell Subject: Re: [PATCH V2] xen: Check if the range is valid in init_domheap_pages Date: Wed, 13 Nov 2013 13:38:24 +0000 Message-ID: <1384349904.5406.112.camel@kazak.uk.xensource.com> References: <1384348525-3230-1-git-send-email-julien.grall@linaro.org> <52838BFC0200007800102DBE@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VgaeL-0000f9-O7 for xen-devel@lists.xenproject.org; Wed, 13 Nov 2013 13:38:29 +0000 In-Reply-To: <52838BFC0200007800102DBE@nat28.tlf.novell.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: Jan Beulich Cc: Keir Fraser , patches@linaro.org, Julien Grall , tim@xen.org, xen-devel@lists.xenproject.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Wed, 2013-11-13 at 13:26 +0000, Jan Beulich wrote: > >>> On 13.11.13 at 14:15, Julien Grall wrote: > > On ARM, when an initrd is given to xen by U-boot, it will reserve the memory > > in the device tree. > > In this case, when xen decides to free unused memory, dt_unreserved_regions > > will call init_domheap_pages with the start and the end of range equals. But > > the latter assumes that (start > end), if not Xen will hang because the > > number of pages is equals to (unsigned)-1. > > The change is simple enough, so I don't really mind it going in, but > I wonder ... > > > Signed-off-by: Julien Grall > > CC: Keir Fraser > > CC: Jan Beulich > > > > --- > > Changes in v2: > > - Change commit title > > - Move the check in init_domheap_pages > > ... who and why suggested to move it here. Me in response to "xen/arm: Don't call init_domheap_page with an empty range". > After all, I'm considering > it an error to call the function with non-page-aligned addresses and/ > or end < start (I take it that page-aligned, but start == end is not a > problem without your change). Since init_xenheap_page does the right thing it seemed reasonable to me to make domheap do the same. Ian,