1
0

timer_test.h 1.0 KB

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