summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/lib/x86_64/vmx.c
diff options
context:
space:
mode:
authorDavid Matlack <dmatlack@google.com>2022-11-16 23:46:31 +0300
committerSean Christopherson <seanjc@google.com>2022-11-17 03:59:07 +0300
commit5c107f7085f45e071bbcf13006fffccd8e5de0e1 (patch)
tree3f48203a822b60f2ee20f3b2744f3635d9f94b00 /tools/testing/selftests/kvm/lib/x86_64/vmx.c
parentecb89a51724b3cd89c13ba7364e82f9879b68dcf (diff)
downloadlinux-5c107f7085f45e071bbcf13006fffccd8e5de0e1.tar.xz
KVM: selftests: Assert in prepare_eptp() that nEPT is supported
Now that a VM isn't needed to check for nEPT support, assert that KVM supports nEPT in prepare_eptp() instead of skipping the test, and push the TEST_REQUIRE() check out to individual tests. The require+assert are somewhat redundant and will incur some amount of ongoing maintenance burden, but placing the "require" logic in the test makes it easier to find/understand a test's requirements and in this case, provides a very strong hint that the test cares about nEPT. Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: David Matlack <dmatlack@google.com> Link: https://lore.kernel.org/r/20220927165209.930904-1-dmatlack@google.com [sean: rebase on merged code, write changelog] Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/lib/x86_64/vmx.c')
-rw-r--r--tools/testing/selftests/kvm/lib/x86_64/vmx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/lib/x86_64/vmx.c b/tools/testing/selftests/kvm/lib/x86_64/vmx.c
index 6800fc9aeef0..3e4ea846366c 100644
--- a/tools/testing/selftests/kvm/lib/x86_64/vmx.c
+++ b/tools/testing/selftests/kvm/lib/x86_64/vmx.c
@@ -559,7 +559,7 @@ bool kvm_cpu_has_ept(void)
void prepare_eptp(struct vmx_pages *vmx, struct kvm_vm *vm,
uint32_t eptp_memslot)
{
- TEST_REQUIRE(kvm_cpu_has_ept());
+ TEST_ASSERT(kvm_cpu_has_ept(), "KVM doesn't support nested EPT");
vmx->eptp = (void *)vm_vaddr_alloc_page(vm);
vmx->eptp_hva = addr_gva2hva(vm, (uintptr_t)vmx->eptp);