summaryrefslogtreecommitdiffstats
path: root/exec.c
diff options
context:
space:
mode:
authorAurelien Jarno2011-05-23 22:33:39 +0200
committerAurelien Jarno2011-05-23 22:33:39 +0200
commit05c8a1e423736006580e4dd2bd94d0faafc9afdc (patch)
tree490e0cb3eb784244bba388cb1890584a32dbf160 /exec.c
parentDelete unused tb_invalidate_page_range (diff)
parents390x: complain when allocating ram fails (diff)
downloadqemu-05c8a1e423736006580e4dd2bd94d0faafc9afdc.tar.gz
qemu-05c8a1e423736006580e4dd2bd94d0faafc9afdc.tar.xz
qemu-05c8a1e423736006580e4dd2bd94d0faafc9afdc.zip
Merge branch 's390-next' of git://repo.or.cz/qemu/agraf
* 's390-next' of git://repo.or.cz/qemu/agraf: s390x: complain when allocating ram fails s390x: fix memory detection for guests > 64GB s390x: change mapping base to allow guests > 2GB s390x: Fix debugging for unknown sigp order codes s390x: build s390x by default s390x: remove compatibility cc field s390x: Adjust GDB stub s390x: translate engine for s390x CPU s390x: Adjust internal kvm code s390x: Implement opcode helpers s390x: helper functions for system emulation s390x: Shift variables in CPUState for memset(0) s390x: keep hint on virtio managing size s390x: make kvm exported functions conditional on kvm s390x: s390x-linux-user support tcg: extend max tcg opcodes when using 64-on-32bit s390x: fix smp support for kvm
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/exec.c b/exec.c
index a6df2d6139..a4785b25f8 100644
--- a/exec.c
+++ b/exec.c
@@ -2910,10 +2910,18 @@ ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, const char *name,
#endif
} else {
#if defined(TARGET_S390X) && defined(CONFIG_KVM)
- /* XXX S390 KVM requires the topmost vma of the RAM to be < 256GB */
- new_block->host = mmap((void*)0x1000000, size,
+ /* S390 KVM requires the topmost vma of the RAM to be smaller than
+ an system defined value, which is at least 256GB. Larger systems
+ have larger values. We put the guest between the end of data
+ segment (system break) and this value. We use 32GB as a base to
+ have enough room for the system break to grow. */
+ new_block->host = mmap((void*)0x800000000, size,
PROT_EXEC|PROT_READ|PROT_WRITE,
- MAP_SHARED | MAP_ANONYMOUS, -1, 0);
+ MAP_SHARED | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
+ if (new_block->host == MAP_FAILED) {
+ fprintf(stderr, "Allocating RAM failed\n");
+ abort();
+ }
#else
if (xen_mapcache_enabled()) {
xen_ram_alloc(new_block->offset, size);