]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Adapt vm_userspace_mem_region_add to new helpers
authorYanan Wang <wangyanan55@huawei.com>
Tue, 30 Mar 2021 08:08:55 +0000 (16:08 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 20 Apr 2021 08:18:53 +0000 (04:18 -0400)
commit271531a88b43845b162986ad5d33eae817ae7d01
tree08221a4e0924b924871b8c936dea230fd1e472af
parentc84c96e571a9da2b4e4accac5e0e11d09e58e66e
KVM: selftests: Adapt vm_userspace_mem_region_add to new helpers

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>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-Id: <20210330080856.14940-10-wangyanan55@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/lib/kvm_util.c