aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/dirty_log_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/dirty_log_test.c
parentkvm: selftests: vcpu_setup: set cr4.osfxsr (diff)
downloadlinux-dev-14c47b7530e2db1ab1d42ebbe99b2a58b8443ce7.tar.xz
linux-dev-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/dirty_log_test.c')
-rw-r--r--tools/testing/selftests/kvm/dirty_log_test.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/testing/selftests/kvm/dirty_log_test.c b/tools/testing/selftests/kvm/dirty_log_test.c
index 0c2cdc105f96..7cf3e4ae6046 100644
--- a/tools/testing/selftests/kvm/dirty_log_test.c
+++ b/tools/testing/selftests/kvm/dirty_log_test.c
@@ -110,7 +110,7 @@ void *vcpu_worker(void *data)
uint64_t loops, *guest_array, pages_count = 0;
struct kvm_vm *vm = data;
struct kvm_run *run;
- struct guest_args args;
+ struct ucall uc;
run = vcpu_state(vm, VCPU_ID);
@@ -124,9 +124,8 @@ void *vcpu_worker(void *data)
while (!READ_ONCE(host_quit)) {
/* Let the guest to dirty these random pages */
ret = _vcpu_run(vm, VCPU_ID);
- guest_args_read(vm, VCPU_ID, &args);
if (run->exit_reason == KVM_EXIT_IO &&
- args.port == GUEST_PORT_SYNC) {
+ get_ucall(vm, VCPU_ID, &uc) == UCALL_SYNC) {
pages_count += TEST_PAGES_PER_LOOP;
generate_random_array(guest_array, TEST_PAGES_PER_LOOP);
} else {