xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86: consider modules when cutting off memory
Date: Mon, 18 Nov 2013 03:32:42 -0800	[thread overview]
Message-ID: <CEAF3ADA.6594F%keir.xen@gmail.com> (raw)
In-Reply-To: <5289DFCB0200007800103E6F@nat28.tlf.novell.com>

On 18/11/2013 00:37, "Jan Beulich" <JBeulich@suse.com> wrote:

> The code in question runs after module ranges got already removed from
> the E820 table, so when determining the new maximum page/PDX we need to
> explicitly take them into account.
> 
> Furthermore we need to round up the ending addresses here, in order to
> fully cover eventual partial trailing pages.

Is rounding up the right thing to do? We round down in find_max_pfn()?

> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -1013,9 +1013,17 @@ void __init __start_xen(unsigned long mb
>                      ASSERT(j);
>                  }
>                  map_e = boot_e820.map[j].addr + boot_e820.map[j].size;
> -                if ( (map_e >> PAGE_SHIFT) < max_page )
> +                for ( j = 0; j < mbi->mods_count; ++j )
>                  {
> -                    max_page = map_e >> PAGE_SHIFT;
> +                    uint64_t end = pfn_to_paddr(mod[j].mod_start) +
> +                                   mod[j].mod_end;
> +
> +                    if ( map_e < end )
> +                        map_e = end;
> +                }
> +                if ( PFN_UP(map_e) < max_page )
> +                {
> +                    max_page = PFN_UP(map_e);
>                      max_pdx = pfn_to_pdx(max_page - 1) + 1;
>                  }
>                  printk(XENLOG_WARNING "Ignoring inaccessible memory range"
> 
> 
> 

  reply	other threads:[~2013-11-18 11:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18  8:37 [PATCH] x86: consider modules when cutting off memory Jan Beulich
2013-11-18 11:32 ` Keir Fraser [this message]
2013-11-18 12:11   ` Jan Beulich
2013-11-18 12:26     ` Keir Fraser

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=CEAF3ADA.6594F%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=JBeulich@suse.com \
    --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 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).