osdep: powerpc64 align memory to allow 2MB radix THP page tables
PATCH 1/1 osdep: powerpc64 align memory to allow 2MB radix THP page tables
This allows KVM with the Book3S radix MMU mode to take advantage of THP and install larger pages in the partition scope page tables (the host translation).
Signed-off-by Nicholas Piggin <[email protected]>
--- include/qemu/osdep.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/qemu/osdep.h +2 -1
@@ -357,7 +357,8 @@ void qemu_anon_ram_free(void *ptr, size_t size);#endif #if defined(__linux__) && \ - (defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)) + (defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) \ + || defined(__powerpc64__))/* Use 2 MiB alignment so transparent hugepages can be used by KVM. Valgrind does not support alignments larger than 1 MiB, therefore we need special code which handles running on Valgrind. */
Signature · 1 line
2.17.0
Quoted 5 lines · Nicholas Piggin
This allows KVM with the Book3S radix MMU mode to take advantage of THP and install larger pages in the partition scope page tables (the host translation).
Signed-off-by Nicholas Piggin <[email protected]>
I've applied this to my ppc-for-3.0 tree. It's not strictly within the code I maintain, but since it only affects ppc, it seems reasonable to go through my tree.
Quoted 18 lines
--- include/qemu/osdep.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)include/qemu/osdep.h +2
-1@@ -357,7 +357,8 @@ void qemu_anon_ram_free(void *ptr, size_t size);#endif #if defined(__linux__) && \ - (defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)) + (defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) \ + || defined(__powerpc64__))/* Use 2 MiB alignment so transparent hugepages can be used by KVM. Valgrind does not support alignments larger than 1 MiB, therefore we need special code which handles running on Valgrind. */
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson