OSDN Git Service

KVM: selftests: Don't require THP to run tests
authorAndrew Jones <drjones@redhat.com>
Thu, 29 Oct 2020 20:17:00 +0000 (21:17 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 31 Oct 2020 14:35:50 +0000 (10:35 -0400)
commit0f55b67e5ad8dcdfb9ae2aaed75dd9fbb2bd92b2
treef6e77496a39c3b7132f5bd6a0ecc5ff4545762c4
parent064eedf2c50f692088e1418c553084bf9c1432f8
KVM: selftests: Don't require THP to run tests

Unless we want to test with THP, then we shouldn't require it to be
configured by the host kernel. Unfortunately, even advising with
MADV_NOHUGEPAGE does require it, so check for THP first in order
to avoid madvise failing with EINVAL.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Message-Id: <20201029201703.102716-2-drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/lib/kvm_util.c