diff options
author | Oliver Upton <oupton@google.com> | 2021-09-16 18:15:48 +0000 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-10-18 14:43:45 -0400 |
commit | 61fb1c54853dda9a95b785f36220fa8ff39bac20 (patch) | |
tree | 5b5b5316965de4df3a9f489aa3b043d32845d66c /tools/testing/selftests/kvm/include/kvm_util.h | |
parent | 500065393400fc88d20c6d655717c00efc07dc52 (diff) | |
download | linux-61fb1c54853dda9a95b785f36220fa8ff39bac20.tar.bz2 |
selftests: KVM: Add test for KVM_{GET,SET}_CLOCK
Add a selftest for the new KVM clock UAPI that was introduced. Ensure
that the KVM clock is consistent between userspace and the guest, and
that the difference in realtime will only ever cause the KVM clock to
advance forward.
Cc: Andrew Jones <drjones@redhat.com>
Signed-off-by: Oliver Upton <oupton@google.com>
Message-Id: <20210916181555.973085-3-oupton@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/kvm_util.h')
-rw-r--r-- | tools/testing/selftests/kvm/include/kvm_util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h index 010b59b13917..a8ac5d52e17b 100644 --- a/tools/testing/selftests/kvm/include/kvm_util.h +++ b/tools/testing/selftests/kvm/include/kvm_util.h @@ -19,6 +19,8 @@ #define KVM_DEV_PATH "/dev/kvm" #define KVM_MAX_VCPUS 512 +#define NSEC_PER_SEC 1000000000L + /* * Callers of kvm_util only have an incomplete/opaque description of the * structure kvm_util is using to maintain the state of a VM. |