From: Juergen Gross <jgross@suse.com>
To: David Vrabel <david.vrabel@citrix.com>, xen-devel@lists.xenproject.org
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH 2/3] x86/xen: add extra memory for remapped frames during setup
Date: Wed, 07 Jan 2015 16:12:08 +0100 [thread overview]
Message-ID: <54AD4CC8.9050403@suse.com> (raw)
In-Reply-To: <1420642048-12236-3-git-send-email-david.vrabel@citrix.com>
On 01/07/2015 03:47 PM, David Vrabel wrote:
> If the non-RAM regions in the e820 memory map are larger than the size
> of the initial balloon, a BUG was triggered as the frames are remaped
> beyond the limit of the linear p2m. The frames are remapped into the
> initial balloon area (xen_extra_mem) but not enough of this is
> available.
>
> Ensure enough extra memory regions are added for these remapped
> frames.
>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
> ---
> arch/x86/xen/setup.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index 664dffc..feb6d86 100644
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -366,7 +366,7 @@ static void __init xen_do_set_identity_and_remap_chunk(
> static unsigned long __init xen_set_identity_and_remap_chunk(
> const struct e820entry *list, size_t map_size, unsigned long start_pfn,
> unsigned long end_pfn, unsigned long nr_pages, unsigned long remap_pfn,
> - unsigned long *released)
> + unsigned long *released, unsigned long *remapped)
> {
> unsigned long pfn;
> unsigned long i = 0;
> @@ -404,6 +404,7 @@ static unsigned long __init xen_set_identity_and_remap_chunk(
> /* Update variables to reflect new mappings. */
> i += size;
> remap_pfn += size;
> + *remapped += size;
> }
>
> /*
> @@ -420,12 +421,13 @@ static unsigned long __init xen_set_identity_and_remap_chunk(
>
> static void __init xen_set_identity_and_remap(
> const struct e820entry *list, size_t map_size, unsigned long nr_pages,
> - unsigned long *released)
> + unsigned long *released, unsigned long *remapped)
> {
> phys_addr_t start = 0;
> unsigned long last_pfn = nr_pages;
> const struct e820entry *entry;
> unsigned long num_released = 0;
> + unsigned long num_remapped = 0;
> int i;
>
> /*
> @@ -452,12 +454,13 @@ static void __init xen_set_identity_and_remap(
> last_pfn = xen_set_identity_and_remap_chunk(
> list, map_size, start_pfn,
> end_pfn, nr_pages, last_pfn,
> - &num_released);
> + &num_released, &num_remapped);
> start = end;
> }
> }
>
> *released = num_released;
> + *remapped = num_remapped;
>
> pr_info("Released %ld page(s)\n", num_released);
> }
> @@ -577,6 +580,7 @@ char * __init xen_memory_setup(void)
> struct xen_memory_map memmap;
> unsigned long max_pages;
> unsigned long extra_pages = 0;
> + unsigned long remapped_pages;
> int i;
> int op;
>
> @@ -626,9 +630,10 @@ char * __init xen_memory_setup(void)
> * underlying RAM.
> */
> xen_set_identity_and_remap(map, memmap.nr_entries, max_pfn,
> - &xen_released_pages);
> + &xen_released_pages, &remapped_pages);
>
> extra_pages += xen_released_pages;
> + extra_pages += remapped_pages;
>
> /*
> * Clamp the amount of extra memory to a EXTRA_MEM_RATIO
>
next prev parent reply other threads:[~2015-01-07 15:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-07 14:47 [PATCHv1 0/3] x86/xen: fixes and improvements to linear p2m David Vrabel
2015-01-07 14:47 ` [PATCH 1/3] x86/xen: don't count how many PFNs are identity mapped David Vrabel
2015-01-07 15:10 ` Juergen Gross
2015-01-07 14:47 ` [PATCH 2/3] x86/xen: add extra memory for remapped frames during setup David Vrabel
2015-01-07 15:12 ` Juergen Gross [this message]
2015-01-07 14:47 ` [PATCH 3/3] x86/xen: optimize get_phys_to_machine() David Vrabel
2015-01-07 15:18 ` Juergen Gross
2015-01-07 15:24 ` David Vrabel
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=54AD4CC8.9050403@suse.com \
--to=jgross@suse.com \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.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 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.