KVM: selftests: Move setting a vCPU's entry point to a dedicated API
authorSean Christopherson <seanjc@google.com>
Thu, 8 Feb 2024 20:48:39 +0000 (21:48 +0100)
committerSean Christopherson <seanjc@google.com>
Wed, 28 Feb 2024 20:58:05 +0000 (20:58 +0000)
commit53a43dd48f8e5e9cc046f14506a11250efc46bf6
tree43752a24331bbfb534b2fc73409f9d1e10e396dd
parent221d65449453846bbf6801d0ecf7dfdf4f413ad9
KVM: selftests: Move setting a vCPU's entry point to a dedicated API

Extract the code to set a vCPU's entry point out of vm_arch_vcpu_add() and
into a new API, vcpu_arch_set_entry_point().  Providing a separate API
will allow creating a KVM selftests hardness that can handle tests that
use different entry points for sub-tests, whereas *requiring* the entry
point to be specified at vCPU creation makes it difficult to create a
generic harness, e.g. the boilerplate setup/teardown can't easily create
and destroy the VM and vCPUs.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/r/20240208204844.119326-4-thuth@redhat.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/include/kvm_util_base.h
tools/testing/selftests/kvm/lib/aarch64/processor.c
tools/testing/selftests/kvm/lib/riscv/processor.c
tools/testing/selftests/kvm/lib/s390x/processor.c
tools/testing/selftests/kvm/lib/x86_64/processor.c