summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/include/test_util.h
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2021-11-11 00:03:01 +0000
committerPaolo Bonzini <pbonzini@redhat.com>2021-11-16 07:43:25 -0500
commitf4870ef3e15ab889a689f99a579fe0fe7c53a960 (patch)
tree93aab38a2b461063181ac183308013130e265104 /tools/testing/selftests/kvm/include/test_util.h
parentc071ff41e1502990a0902c7c3fcf72a462e46330 (diff)
downloadlinux-f4870ef3e15ab889a689f99a579fe0fe7c53a960.tar.bz2
KVM: selftests: Assert mmap HVA is aligned when using HugeTLB
Manually padding and aligning the mmap region is only needed when using THP. When using HugeTLB, mmap will always return an address aligned to the HugeTLB page size. Add a comment to clarify this and assert the mmap behavior for HugeTLB. [Removed requirement that HugeTLB mmaps must be padded per Yanan's feedback and added assertion that mmap returns aligned addresses when using HugeTLB.] Cc: Ben Gardon <bgardon@google.com> Cc: Yanan Wang <wangyanan55@huawei.com> Cc: Andrew Jones <drjones@redhat.com> Cc: Peter Xu <peterx@redhat.com> Cc: Aaron Lewis <aaronlewis@google.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: David Matlack <dmatlack@google.com> Message-Id: <20211111000310.1435032-4-dmatlack@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/test_util.h')
-rw-r--r--tools/testing/selftests/kvm/include/test_util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h
index 78c06310cc0e..99e0dcdc923f 100644
--- a/tools/testing/selftests/kvm/include/test_util.h
+++ b/tools/testing/selftests/kvm/include/test_util.h
@@ -104,6 +104,7 @@ size_t get_trans_hugepagesz(void);
size_t get_def_hugetlb_pagesz(void);
const struct vm_mem_backing_src_alias *vm_mem_backing_src_alias(uint32_t i);
size_t get_backing_src_pagesz(uint32_t i);
+bool is_backing_src_hugetlb(uint32_t i);
void backing_src_help(const char *flag);
enum vm_mem_backing_src_type parse_backing_src_type(const char *type_name);
long get_run_delay(void);