diff options
author | George Dunlap <george.dunlap@eu.citrix.com> | 2013-06-18 10:08:01 +0100 |
---|---|---|
committer | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2013-06-24 12:20:29 +0100 |
commit | c74c1f906a04e110dea7c0b4156ec74b43a3951c (patch) | |
tree | d96d95793879cd60e08c5187a7e8243a0a5bca6d /tools/libxl | |
parent | 6392092e7e04b2c40145743ba1a078499210af9a (diff) | |
download | xen-c74c1f906a04e110dea7c0b4156ec74b43a3951c.tar.gz xen-c74c1f906a04e110dea7c0b4156ec74b43a3951c.tar.bz2 xen-c74c1f906a04e110dea7c0b4156ec74b43a3951c.zip |
libxl,hvmloader: Don't relocate memory for MMIO hole
At the moment, qemu-xen can't handle memory being relocated by
hvmloader. This may happen if a device with a large enough memory
region is passed through to the guest. At the moment, if this
happens, then at some point in the future qemu will crash and the
domain will hang. (qemu-traditional is fine.)
It's too late in the release to do a proper fix, so we try to do
damage control.
hvmloader already has mechanisms to relocate memory to 64-bit space if
it can't make a big enough MMIO hole. By default this is 2GiB; if we
just refuse to make the hole bigger if it will overlap with guest
memory, then the relocation will happen by default.
v5:
- Update comment to not refer to "this series".
v4:
- Wrap long line in libxl_dm.c
- Fix comment
v3:
- Fix polarity of comparison
- Move diagnostic messages to another patch
- Tested with xen platform pci device hacked to have different BAR sizes
{256MiB, 1GiB} x {qemu-xen, qemu-traditional} x various memory
configurations
- Add comment explaining why we default to "allow"
- Remove cast to bool
v2:
- style fixes
- fix and expand comment on the MMIO hole loop
- use "%d" rather than "%s" -> (...)?"1":"0"
- use bool instead of uint8_t
- Move 64-bit bar relocate detection to another patch
- Add more diagnostic messages
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Ian Campbell <ian.campbell@citrix.com>
CC: Stefano Stabellini <stefano.stabellini@citrix.com>
CC: Hanweidong <hanweidong@huawei.com>
CC: Keir Fraser <keir@xen.org>
CC: Keir Fraser <keir@xen.org>
Diffstat (limited to 'tools/libxl')
-rw-r--r-- | tools/libxl/libxl_dm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index ac1f90e531..7e54c02a21 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1154,6 +1154,14 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss) libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/hvmloader/bios", path), "%s", libxl_bios_type_to_string(b_info->u.hvm.bios)); + /* Disable relocating memory to make the MMIO hole larger + * unless we're running qemu-traditional */ + libxl__xs_write(gc, XBT_NULL, + libxl__sprintf(gc, + "%s/hvmloader/allow-memory-relocate", + path), + "%d", + b_info->device_model_version==LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL); free(path); } |