From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad@kernel.org>
Cc: xen-devel@lists.xensource.com, david.vrabel@citrix.com,
christian@holpert.de,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH] xl, e820_host, PV passthrough: Fix guests crashing when memory == maxmem
Date: Fri, 24 May 2013 14:58:24 +0100 [thread overview]
Message-ID: <1369403904.17830.201.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <1369402576-2958-1-git-send-email-konrad.wilk@oracle.com>
On Fri, 2013-05-24 at 09:36 -0400, Konrad Rzeszutek Wilk wrote:
> The code had an obvious bug where it would assume that the balloon
> amount would always be _something_ and add an E820_RAM entry at the
> end of the E820 array. The added E820_RAM would contain the balloon amount
> plus the delta of memory that had to be subtracted b/c of the various
> E820 entries. That assumption is certainly true when maxmem != mem,
> but if guest config has maxmem = memory that is incorrect (as balloon
> value is zero). The end result is that the E820 that is constructed
> is missing a swath of "delta" memory and in most cases ends up with
> only one E820_RAM entry that is of 512MB size on many Intel systems.
>
> Reported-by: Christian Holpert <christian@holpert.de>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> tools/libxl/libxl_x86.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
> index a17f6ae..a78c91d 100644
> --- a/tools/libxl/libxl_x86.c
> +++ b/tools/libxl/libxl_x86.c
> @@ -182,7 +182,7 @@ static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[],
> idx++;
> }
> /* At this point we have the mapped RAM + E820 entries from src. */
> - if (balloon_kb) {
> + if (balloon_kb || delta_kb) {
> /* and if we truncated the RAM region, then add it to the end. */
> e820[idx].type = E820_RAM;
> e820[idx].addr = (uint64_t)(1ULL << 32) > last ?
next prev parent reply other threads:[~2013-05-24 13:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-24 13:36 [PATCH] xl, e820_host, PV passthrough: Fix guests crashing when memory == maxmem Konrad Rzeszutek Wilk
2013-05-24 13:58 ` Ian Campbell [this message]
2013-05-24 14:51 ` Konrad Rzeszutek Wilk
2013-05-24 14:55 ` Ian Campbell
2013-05-24 14:57 ` George Dunlap
2013-05-30 9:01 ` 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=1369403904.17830.201.camel@zakaz.uk.xensource.com \
--to=ian.campbell@citrix.com \
--cc=christian@holpert.de \
--cc=david.vrabel@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=konrad@kernel.org \
--cc=xen-devel@lists.xensource.com \
/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).