xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: Tim Deegan <tim@xen.org>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v2] xen/arm: Fix crash if last memory section is bigger than 1gb
Date: Thu, 02 Oct 2014 15:50:29 +0100	[thread overview]
Message-ID: <542D6635.3050109@linaro.org> (raw)
In-Reply-To: <CAHt6W4cBY4MCciHbBCr4dG8ur_7KzGZSm3Xw-G1jPWxySexVWg@mail.gmail.com>

Hi Frediano,

On 10/02/2014 03:39 PM, Frediano Ziglio wrote:
> setup_xenheap_mappings setup head memory on Arm 32 has a limit of 1gb.
> On system with large memory is possible that there are no blocks of memory
> smaller than 1gb leading xenheap_pages to be more than 1gb.
> This cause memory errors trying to access heap after the 1gb limit.
> 
> Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
> ---
>  xen/arch/arm/setup.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index 446de8a..e223d1b 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -509,6 +509,7 @@ static void __init setup_mm(unsigned long
> dtb_paddr, size_t dtb_size)
>      heap_pages = ram_pages;
>      xenheap_pages = (heap_pages/8 + 0x1fffUL) & ~0x1fffUL;
>      xenheap_pages = max(xenheap_pages, 128UL<<(20-PAGE_SHIFT));
> +    xenheap_pages = min(xenheap_pages, 1UL<<(30-PAGE_SHIFT));
> 
>      do
>      {
> 

You forgot to add my Reviewed-by (gave on the latest version) and
address one thing.

There is a big comment in the code explaining the different constraint
on to find the heap. You have to update it.

I would replace the line "- must be at most 1/8 the total RAM in the
system" by " - must be at most 1GB or 1/8 the total RAM in the system if
less".

Regards,

-- 
Julien Grall

      reply	other threads:[~2014-10-02 14:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02 14:39 [PATCH v2] xen/arm: Fix crash if last memory section is bigger than 1gb Frediano Ziglio
2014-10-02 14:50 ` Julien Grall [this message]

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=542D6635.3050109@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=freddy77@gmail.com \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@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).