summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/system_counter_offset_test.c
Commit message (Collapse)AuthorAgeFilesLines
* KVM: selftests: Convert system_counter_offset_test away from VCPU_IDSean Christopherson2022-06-111-14/+14
| | | | | | | | Convert system_counter_offset_test to use vm_create_with_one_vcpu() and pass around a 'struct kvm_vcpu' object instead of using a global VCPU_ID. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* KVM: selftests: Split get/set device_attr helpersSean Christopherson2022-06-111-2/+2
| | | | | | | | | | | Split the get/set device_attr helpers instead of using a boolean param to select between get and set. Duplicating upper level wrappers is a very, very small price to pay for improved readability, and having constant (at compile time) inputs will allow the selftests framework to sanity check ioctl() invocations. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* KVM: selftests: Rename KVM_HAS_DEVICE_ATTR helpers for consistencySean Christopherson2022-06-111-1/+1
| | | | | | | | | Rename kvm_device_check_attr() and its variants to kvm_has_device_attr() to be consistent with the ioctl names and with other helpers in the KVM selftests framework. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* selftests: KVM: Introduce system counter offset testOliver Upton2021-10-181-0/+132
Introduce a KVM selftest to verify that userspace manipulation of the TSC (via the new vCPU attribute) results in the correct behavior within the guest. Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Oliver Upton <oupton@google.com> Message-Id: <20210916181555.973085-6-oupton@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>