From: Chunyan Liu <cyliu@suse.com>
To: qemu-devel@nongnu.org
Cc: stefano.stabellini@eu.citrix.com, george.dunlap@eu.citrix.com,
Chunyan Liu <cyliu@suse.com>
Subject: [Qemu-devel] [PATCH] fix xen hvm direct kernel boot
Date: Fri, 29 Apr 2016 11:43:21 +0800 [thread overview]
Message-ID: <1461901401-6811-1-git-send-email-cyliu@suse.com> (raw)
Since commit a1666142: acpi-build: make ROMs RAM blocks resizeable,
xen HVM direct kernel boot failed. Xen HVM direct kernel boot will
insert a linuxboot.bin or multiboot.bin to /genroms, before this
commit, in acpi_setup, for rom linuxboot.bin/multiboot.bin, it
only needs 0x20000 size; after the commit, it will reserve x16
size for resize, that is 0x200000 size. It causes xen_ram_alloc
failed due to running out of memory.
To resolve it, either:
1. keep using original rom size instead of max size, don't reserve x16 size.
2. guest maxmem needs to be increased. (commit c1d322e6 "xen-hvm: increase
maxmem before calling xc_domain_populate_physmap" solved the problem for
a time, by accident. But then it is reverted in commit ffffbb369 due to
other problem.)
For 2, more discussion is needed about howto. So this patch tries 1, to
use unresizable rom size in xen case in rom_set_mr.
Signed-off-by: Chunyan Liu <cyliu@suse.com>
---
hw/core/loader.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index c049957..5150101 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -55,6 +55,7 @@
#include "exec/address-spaces.h"
#include "hw/boards.h"
#include "qemu/cutils.h"
+#include "hw/xen/xen.h"
#include <zlib.h>
@@ -818,7 +819,10 @@ static void *rom_set_mr(Rom *rom, Object *owner, const char *name)
void *data;
rom->mr = g_malloc(sizeof(*rom->mr));
- memory_region_init_resizeable_ram(rom->mr, owner, name,
+ if (xen_enabled())
+ memory_region_init_ram(rom->mr, owner, name, rom->datasize, &error_fatal);
+ else
+ memory_region_init_resizeable_ram(rom->mr, owner, name,
rom->datasize, rom->romsize,
fw_cfg_resized,
&error_fatal);
--
1.8.5.6
next reply other threads:[~2016-04-29 4:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-29 3:43 Chunyan Liu [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-04-29 3:43 [Qemu-devel] [PATCH] fix xen hvm direct kernel boot Chunyan Liu
2016-04-29 10:59 ` Stefano Stabellini
2016-05-04 5:34 ` Chun Yan Liu
2016-05-30 16:10 ` Stefano Stabellini
2016-06-01 8:44 ` Chun Yan Liu
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=1461901401-6811-1-git-send-email-cyliu@suse.com \
--to=cyliu@suse.com \
--cc=george.dunlap@eu.citrix.com \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@eu.citrix.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).