qemu-irix/include/qemu
Michael S. Tsirkin 7197fb4058 util/mmap-alloc: fix hugetlb support on ppc64
Since commit 8561c9244d "exec: allocate PROT_NONE pages on top of
RAM", it is no longer possible to back guest RAM with hugepages on ppc64
hosts:

mmap(NULL, 285212672, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x3fff57000000
mmap(0x3fff57000000, 268435456, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED, 19, 0) = -1 EBUSY (Device or resource busy)

This is because on ppc64, Linux fixes a page size for a virtual address
at mmap time, so we can't switch a range of memory from anonymous
small pages to hugetlbs with MAP_FIXED.

See commit d0f13e3c20b6fb73ccb467bdca97fa7cf5a574cd
("[POWERPC] Introduce address space "slices"") in Linux
history for the details.

Detect this and create the PROT_NONE mapping using the same fd.

Naturally, this makes the guard page bigger with hugetlbfs.

Based on patch by Greg Kurz.

Acked-by: Rik van Riel <riel@redhat.com>
Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Tested-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-12-02 22:38:23 +02:00
..
acl.h
atomic.h
bitmap.h
bitops.h
bswap.h
buffer.h buffer: allow a buffer to shrink gracefully 2015-11-05 09:09:58 +01:00
compatfd.h
compiler.h
config-file.h
coroutine.h coroutine: move into libqemuutil.a library 2015-10-20 14:59:04 +01:00
coroutine_int.h coroutine: move into libqemuutil.a library 2015-10-20 14:59:04 +01:00
crc32c.h
envlist.h
error-report.h
event_notifier.h util: const event_notifier_get_fd() argument 2015-10-24 18:02:49 +02:00
fifo8.h
fprintf-fn.h
hbitmap.h
host-utils.h
int128.h
iov.h
log.h qemu-log: remove -d ioport 2015-11-04 15:02:30 +01:00
main-loop.h
memfd.h vhost: add migration block if memfd failed 2015-10-22 14:34:49 +03:00
mmap-alloc.h util/mmap-alloc: fix hugetlb support on ppc64 2015-12-02 22:38:23 +02:00
module.h
notify.h
option.h
option_int.h
osdep.h osdep: Change default value of qemu_hw_version() to "2.5+" 2015-11-25 13:42:37 +02:00
queue.h block: Remove bdrv_swap() 2015-10-16 15:34:30 +02:00
range.h
ratelimit.h
rcu.h
rcu_queue.h
readline.h
rfifolock.h
seqlock.h
sockets.h sockets: move qapi_copy_SocketAddress into qemu-sockets.c 2015-10-20 14:15:48 +01:00
thread-posix.h
thread-win32.h
thread.h
throttle.h
timed-average.h block: Add average I/O queue depth to BlockDeviceTimedStats 2015-11-12 16:22:46 +01:00
timer.h
typedefs.h migration_completion: Take current state 2015-11-10 15:00:27 +01:00
uri.h
xattr.h