]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Assert mmap HVA is aligned when using HugeTLB
authorSean Christopherson <seanjc@google.com>
Thu, 11 Nov 2021 00:03:01 +0000 (00:03 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Nov 2021 12:43:25 +0000 (07:43 -0500)
commit2b4408548337bd79ad96c783940ddde1c5ec1940
tree93aab38a2b461063181ac183308013130e265104
parent0a4147f43d9508df5838dce02c29c65987468d9e
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>
tools/testing/selftests/kvm/include/test_util.h
tools/testing/selftests/kvm/lib/kvm_util.c
tools/testing/selftests/kvm/lib/test_util.c