1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * timer test specific header 4 * 5 * Copyright (C) 2018, Google LLC 6 */ 7 8 #ifndef SELFTEST_KVM_TIMER_TEST_H 9 #define SELFTEST_KVM_TIMER_TEST_H 10 11 #include "kvm_util.h" 12 13 #define NR_VCPUS_DEF 4 14 #define NR_TEST_ITERS_DEF 5 15 #define TIMER_TEST_PERIOD_MS_DEF 10 16 #define TIMER_TEST_ERR_MARGIN_US 100 17 #define TIMER_TEST_MIGRATION_FREQ_MS 2 18 19 /* Timer test cmdline parameters */ 20 struct test_args { 21 uint32_t nr_vcpus; 22 uint32_t nr_iter; 23 uint32_t timer_period_ms; 24 uint32_t migration_freq_ms; 25 uint32_t timer_err_margin_us; 26 /* TODO: Change arm specific type to a common one */ 27 struct kvm_arm_counter_offset offset; 28 }; 29 30 /* Shared variables between host and guest */ 31 struct test_vcpu_shared_data { 32 uint32_t nr_iter; 33 int guest_stage; 34 uint64_t xcnt; 35 }; 36 37 extern struct test_args test_args; 38 extern struct kvm_vcpu *vcpus[]; 39 extern struct test_vcpu_shared_data vcpu_shared_data[]; 40 41 struct kvm_vm *test_vm_create(void); 42 void test_vm_cleanup(struct kvm_vm *vm); 43 44 #endif /* SELFTEST_KVM_TIMER_TEST_H */ 45