summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/lib/kvm_util.c
diff options
context:
space:
mode:
authorVishal Annapurve <vannapurve@google.com>2022-11-16 00:38:44 +0300
committerSean Christopherson <seanjc@google.com>2022-11-17 03:58:57 +0300
commite1ab31245c4efe973db4dcd6c82a41c2aec09b27 (patch)
tree721cc7e3fb8ffd09bbc9f6014df9ced40e83965d /tools/testing/selftests/kvm/lib/kvm_util.c
parent197ebb713ad04518ffef6d966954b519a0805100 (diff)
downloadlinux-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/lib/kvm_util.c')
-rw-r--r--tools/testing/selftests/kvm/lib/kvm_util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
index 575a0c38d1c0..db62680d5918 100644
--- a/tools/testing/selftests/kvm/lib/kvm_util.c
+++ b/tools/testing/selftests/kvm/lib/kvm_util.c
@@ -2087,8 +2087,14 @@ void __vm_get_stat(struct kvm_vm *vm, const char *stat_name, uint64_t *data,
}
}
+__weak void kvm_selftest_arch_init(void)
+{
+}
+
void __attribute((constructor)) kvm_selftest_init(void)
{
/* Tell stdout not to buffer its content. */
setbuf(stdout, NULL);
+
+ kvm_selftest_arch_init();
}