All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>,
	ian.campbell@citrix.com, patches@linaro.org,
	stefano.stabellini@eu.citrix.com, tim@xen.org,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH V2] xen: Check if the range is valid in init_domheap_pages
Date: Wed, 13 Nov 2013 13:34:08 +0000	[thread overview]
Message-ID: <52837FD0.2030303@linaro.org> (raw)
In-Reply-To: <52838BFC0200007800102DBE@nat28.tlf.novell.com>



On 11/13/2013 01:26 PM, Jan Beulich wrote:
>>>> On 13.11.13 at 14:15, Julien Grall <julien.grall@linaro.org> 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 <julien.grall@linaro.org>
>> CC: Keir Fraser <keir@xen.org>
>> CC: Jan Beulich <jbeulich@suse.com>
>>
>> ---
>>      Changes in v2:
>>          - Change commit title
>>          - Move the check in init_domheap_pages
>
> ... who and why suggested to move it here. 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).

if ps == pe, then emfn == (smfn - 1). This will result to the number of 
pages of -1.

There is a similar check in init_xenheap_pages, it doesn't seem harmfull 
to let it here.

-- 
Julien Grall

  reply	other threads:[~2013-11-13 13:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 13:15 [PATCH V2] xen: Check if the range is valid in init_domheap_pages Julien Grall
2013-11-13 13:23 ` Ian Campbell
2013-11-13 13:34   ` Julien Grall
2013-11-13 13:26 ` Jan Beulich
2013-11-13 13:34   ` Julien Grall [this message]
2013-11-13 14:12     ` Jan Beulich
2013-11-13 14:18       ` Ian Campbell
2013-11-13 14:32         ` Jan Beulich
2013-11-13 14:40           ` Ian Campbell
2013-11-13 14:33       ` Julien Grall
2013-11-13 13:38   ` Ian Campbell

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=52837FD0.2030303@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=JBeulich@suse.com \
    --cc=ian.campbell@citrix.com \
    --cc=keir@xen.org \
    --cc=patches@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.