On Tue, Mar 02, 2021 at 08:57:50PM +0800, Yanan Wang wrote:
With VM_MEM_SRC_ANONYMOUS_THP specified in vm_userspace_mem_region_add(), we have to get the transparent hugepage size for HVA alignment. With the new helpers, we can use get_backing_src_pagesz() to check whether THP is configured and then get the exact configured hugepage size.
As different architectures may have different THP page sizes configured, this can get the accurate THP page sizes on any platform.
Signed-off-by: Yanan Wang wangyanan55@huawei.com Reviewed-by: Ben Gardon bgardon@google.com
tools/testing/selftests/kvm/lib/kvm_util.c | 28 +++++++--------------- 1 file changed, 9 insertions(+), 19 deletions(-)
Reviewed-by: Andrew Jones drjones@redhat.com