From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 3/3] xen: arm: rework dom0 initrd and dtb placement Date: Wed, 09 Apr 2014 13:54:49 +0100 Message-ID: <53454319.9060204@linaro.org> References: <1397044259.6275.15.camel@kazak.uk.xensource.com> <1397044276-30185-3-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: <1397044276-30185-3-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/09/2014 12:51 PM, Ian Campbell wrote: > This now uses the same decision tree as libxc (which is much easier to test). > > The main change is to explictly handle the placement at 128MB or end of RAM as s/explictly/explicitly/ > two cases, rather than combining with MIN. The effect is the same but the code > is clearer. > > Secondly the attempt to place the mopules right after the kernel is removed, s/mopules/modules/ > since it is redundant with the case where placing them at the end of RAM ends > up abutting the kernel. > > Also round the kernel size up to a 2MB boundary. A bit surprised that it was not done before :). > > Signed-off-by: Ian Campbell > --- > I'm sure to regret playing with this yet again... > --- > xen/arch/arm/kernel.c | 22 ++++++++++++---------- > 1 file changed, 12 insertions(+), 10 deletions(-) > > diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c > index bc625a4..1102392 100644 > --- a/xen/arch/arm/kernel.c > +++ b/xen/arch/arm/kernel.c > @@ -77,7 +77,7 @@ static void place_modules(struct kernel_info *info, > const paddr_t rambase = info->mem.bank[0].start; > const paddr_t ramsize = info->mem.bank[0].size; > const paddr_t ramend = rambase + ramsize; > - const paddr_t kernsize = kernend - kernbase; > + const paddr_t kernsize = ROUNDUP(kernend, MB(2)) - kernbase; You are using ROUNDUP(kernend, MB(2)) in few places, why didn't you roundup directly kernend? -- Julien Grall