xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org
Subject: Re: [PATCH 3/3] xen: arm: rework dom0 initrd and dtb placement
Date: Wed, 09 Apr 2014 14:24:32 +0100	[thread overview]
Message-ID: <53454A10.4040605@linaro.org> (raw)
In-Reply-To: <1397049325.6275.40.camel@kazak.uk.xensource.com>

On 04/09/2014 02:15 PM, Ian Campbell wrote:
> On Wed, 2014-04-09 at 14:09 +0100, Julien Grall wrote:
>> On 04/09/2014 01:57 PM, Ian Campbell wrote:
>>> On Wed, 2014-04-09 at 13:54 +0100, Julien Grall wrote:
>>>> 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/
>>>> s/mopules/modules/
>>>
>>> Gah, fingers not working right today it seems.
>>>
>>>>> 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 :).
>>>
>>> Me too.
>>>
>>>>> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>>>>> ---
>>>>> 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?
>>>
>>> It's passed as a paramter, and it's not possible to round it before
>>> using it here (code before declarations), so I'd have to make kernsize
>>> non-const and initialise it after the rounding. I didn't think it was
>>> worth it.
>>
>> In this case I'm lost... You are mixing kernend and ROUNDUP(kernend, MB(2)).
>>
>> As I understand, we don't need to round up on the second if expression
>> (see code below).
> 
> It ensures that the modules don't start until at least the 2M boundary
> after the kernel's end. The userspace side does the same.

The userspace is consistent with the usage of kernend. It's not the case
here. There is no reason to mix the usage of kernend with and without
ROUNDUP.

In another point, I don't think 2MB-aligned is enough to ensure the
kernel won't decompress on the device tree.

-- 
Julien Grall

  reply	other threads:[~2014-04-09 13:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09 11:50 [PATCH 0/3] xen: arm: fixes for initrd and dtb placement Ian Campbell
2014-04-09 11:51 ` [PATCH 1/3] tools: arm: improve placement of initial modules Ian Campbell
2014-04-09 12:43   ` Julien Grall
2014-04-09 12:46     ` Ian Campbell
2014-04-10 11:38     ` Ian Campbell
2014-04-10 11:39       ` Ian Jackson
2014-05-22 16:07         ` Ian Jackson
2014-04-09 11:51 ` [PATCH 2/3] xen: arm: use same variables as userspace in dom0 builder place_modules() Ian Campbell
2014-04-09 12:45   ` Julien Grall
2014-04-09 12:52     ` Ian Campbell
2014-04-09 13:37       ` Julien Grall
2014-04-09 11:51 ` [PATCH 3/3] xen: arm: rework dom0 initrd and dtb placement Ian Campbell
2014-04-09 12:54   ` Julien Grall
2014-04-09 12:57     ` Ian Campbell
2014-04-09 13:09       ` Julien Grall
2014-04-09 13:15         ` Ian Campbell
2014-04-09 13:24           ` Julien Grall [this message]
2014-04-09 13:28             ` Ian Campbell
2014-04-09 13:35               ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53454A10.4040605@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).