summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/vmx_tsc_adjust_test.c
diff options
context:
space:
mode:
authorAndrew Jones <drjones@redhat.com>2018-09-18 19:54:25 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-10-17 00:26:14 +0200
commit14c47b7530e2db1ab1d42ebbe99b2a58b8443ce7 (patch)
tree780a25aaf8db4cacdf7a8a89d7eb6e858a0c3b5f /tools/testing/selftests/kvm/vmx_tsc_adjust_test.c
parent6c930268bcc4cef62194daf151097d2b94f67718 (diff)
downloadtalos-op-linux-14c47b7530e2db1ab1d42ebbe99b2a58b8443ce7.tar.gz
talos-op-linux-14c47b7530e2db1ab1d42ebbe99b2a58b8443ce7.zip
kvm: selftests: introduce ucall
Rework the guest exit to userspace code to generalize the concept into what it is, a "hypercall to userspace", and provide two implementations of it: the PortIO version currently used, but only useable by x86, and an MMIO version that other architectures (except s390) can use. Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/vmx_tsc_adjust_test.c')
-rw-r--r--tools/testing/selftests/kvm/vmx_tsc_adjust_test.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/tools/testing/selftests/kvm/vmx_tsc_adjust_test.c b/tools/testing/selftests/kvm/vmx_tsc_adjust_test.c
index 49bcc68b0235..8d487c78796a 100644
--- a/tools/testing/selftests/kvm/vmx_tsc_adjust_test.c
+++ b/tools/testing/selftests/kvm/vmx_tsc_adjust_test.c
@@ -146,26 +146,25 @@ int main(int argc, char *argv[])
for (;;) {
volatile struct kvm_run *run = vcpu_state(vm, VCPU_ID);
- struct guest_args args;
+ struct ucall uc;
vcpu_run(vm, VCPU_ID);
- guest_args_read(vm, VCPU_ID, &args);
TEST_ASSERT(run->exit_reason == KVM_EXIT_IO,
"Got exit_reason other than KVM_EXIT_IO: %u (%s)\n",
run->exit_reason,
exit_reason_str(run->exit_reason));
- switch (args.port) {
- case GUEST_PORT_ABORT:
- TEST_ASSERT(false, "%s", (const char *) args.arg0);
+ switch (get_ucall(vm, VCPU_ID, &uc)) {
+ case UCALL_ABORT:
+ TEST_ASSERT(false, "%s", (const char *)uc.args[0]);
/* NOT REACHED */
- case GUEST_PORT_SYNC:
- report(args.arg1);
+ case UCALL_SYNC:
+ report(uc.args[1]);
break;
- case GUEST_PORT_DONE:
+ case UCALL_DONE:
goto done;
default:
- TEST_ASSERT(false, "Unknown port 0x%x.", args.port);
+ TEST_ASSERT(false, "Unknown ucall 0x%x.", uc.cmd);
}
}
OpenPOWER on IntegriCloud