powerpc/pseries: Add support for hash table resizing
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 9 Dec 2016 00:07:36 +0000 (11:07 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 10 Feb 2017 02:27:55 +0000 (13:27 +1100)
commitdbcf929c0062b758fbb6312ccaf30716c0c0a608
tree35c79f694f29e935bc7952357313862f8edc57ba
parent64b40ffbc83029f035571cad9727e34e69dbf6d0
powerpc/pseries: Add support for hash table resizing

This adds support for using two hypercalls to change the size of the
main hash page table while running as a PAPR guest. For now these
hypercalls are only in experimental qemu versions.

The interface is two part: first H_RESIZE_HPT_PREPARE is used to
allocate and prepare the new hash table. This may be slow, but can be
done asynchronously. Then, H_RESIZE_HPT_COMMIT is used to switch to the
new hash table. This requires that no CPUs be concurrently updating the
HPT, and so must be run under stop_machine().

This also adds a debugfs file which can be used to manually control
HPT resizing or testing purposes.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Paul Mackerras <paulus@samba.org>
[mpe: Rename the debugfs file to "hpt_order"]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/book3s/64/mmu-hash.h
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/platforms/pseries/lpar.c