qemu-e2k/include
Murilo Opsfelder Araujo 53adb9d43e mmap-alloc: fix hugetlbfs misaligned length in ppc64
The commit 7197fb4058 ("util/mmap-alloc:
fix hugetlb support on ppc64") fixed Huge TLB mappings on ppc64.

However, we still need to consider the underlying huge page size
during munmap() because it requires that both address and length be a
multiple of the underlying huge page size for Huge TLB mappings.
Quote from "Huge page (Huge TLB) mappings" paragraph under NOTES
section of the munmap(2) manual:

  "For munmap(), addr and length must both be a multiple of the
  underlying huge page size."

On ppc64, the munmap() in qemu_ram_munmap() does not work for Huge TLB
mappings because the mapped segment can be aligned with the underlying
huge page size, not aligned with the native system page size, as
returned by getpagesize().

This has the side effect of not releasing huge pages back to the pool
after a hugetlbfs file-backed memory device is hot-unplugged.

This patch fixes the situation in qemu_ram_mmap() and
qemu_ram_munmap() by considering the underlying page size on ppc64.

After this patch, memory hot-unplug releases huge pages back to the
pool.

Fixes: 7197fb4058
Signed-off-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-02-04 18:44:20 +11:00
..
block qapi: add x-debug-query-block-graph 2019-01-31 00:38:19 +01:00
chardev
crypto Don't talk about the LGPL if the file is licensed under the GPL 2019-01-30 10:51:20 +01:00
disas
exec accel/tcg: Add cluster number to TCG TB hash 2019-01-29 11:46:06 +00:00
fpu include/fpu/softfloat: Fix compilation with Clang on s390x 2019-01-22 20:48:24 +00:00
hw spapr: move the interrupt presenters under machine_data 2019-02-04 18:44:18 +11:00
io
libdecnumber
migration vmstate: constify SaveVMHandlers 2019-01-23 15:51:47 +00:00
monitor
net virtio-net: support RSC v4/v6 tcp traffic for Windows HCK 2019-01-17 21:10:57 -05:00
qapi qapi: Eliminate indirection through qmp_event_get_func_emit() 2019-01-24 10:01:05 +01:00
qemu mmap-alloc: fix hugetlbfs misaligned length in ppc64 2019-02-04 18:44:20 +11:00
qom arm: Clarify the logic of set_pc() 2019-02-01 14:55:46 +00:00
scsi avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
standard-headers
sysemu block: Remove blk_attach_dev_legacy() / legacy_dev code 2019-02-01 13:46:45 +01:00
ui ui: highres logo for sdl and gtk, bugfixes for vnc and egl. 2019-01-23 17:57:47 +00:00
elf.h avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
glib-compat.h glib-compat: add g_spawn_async_with_fds() fallback 2019-01-14 00:44:29 +01:00
qemu-common.h
qemu-io.h
trace-tcg.h