diff options
author | Vishal Annapurve <vannapurve@google.com> | 2022-11-16 00:38:44 +0300 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2022-11-17 03:58:57 +0300 |
commit | e1ab31245c4efe973db4dcd6c82a41c2aec09b27 (patch) | |
tree | 721cc7e3fb8ffd09bbc9f6014df9ced40e83965d /tools/testing/selftests/kvm/include/kvm_util_base.h | |
parent | 197ebb713ad04518ffef6d966954b519a0805100 (diff) | |
download | linux-e1ab31245c4efe973db4dcd6c82a41c2aec09b27.tar.xz |
KVM: selftests: Add arch specific initialization
Introduce arch specific API: kvm_selftest_arch_init to allow each arch to
handle initialization before running any selftest logic.
Suggested-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Reviewed-by: Peter Gonda <pgonda@google.com>
Signed-off-by: Vishal Annapurve <vannapurve@google.com>
Link: https://lore.kernel.org/r/20221115213845.3348210-3-vannapurve@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/kvm_util_base.h')
-rw-r--r-- | tools/testing/selftests/kvm/include/kvm_util_base.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/include/kvm_util_base.h b/tools/testing/selftests/kvm/include/kvm_util_base.h index a7047e0767d3..c58eec6d44a7 100644 --- a/tools/testing/selftests/kvm/include/kvm_util_base.h +++ b/tools/testing/selftests/kvm/include/kvm_util_base.h @@ -857,4 +857,11 @@ static inline int __vm_disable_nx_huge_pages(struct kvm_vm *vm) return __vm_enable_cap(vm, KVM_CAP_VM_DISABLE_NX_HUGE_PAGES, 0); } +/* + * Arch hook that is invoked via a constructor, i.e. before exeucting main(), + * to allow for arch-specific setup that is common to all tests, e.g. computing + * the default guest "mode". + */ +void kvm_selftest_arch_init(void); + #endif /* SELFTEST_KVM_UTIL_BASE_H */ |