Lines Matching refs:vm
19 #define rounded_host_rdmsr(x) ROUND(vcpu_get_msr(vm, 0, x))
78 static void run_vcpu(struct kvm_vm *vm, uint32_t vcpuid, int stage) in run_vcpu() argument
82 vcpu_args_set(vm, vcpuid, 1, vcpuid); in run_vcpu()
84 vcpu_ioctl(vm, vcpuid, KVM_RUN, NULL); in run_vcpu()
86 switch (get_ucall(vm, vcpuid, &uc)) { in run_vcpu()
100 exit_reason_str(vcpu_state(vm, vcpuid)->exit_reason)); in run_vcpu()
106 struct kvm_vm *vm; in main() local
109 vm = vm_create_default(VCPU_ID, 0, guest_code); in main()
110 vcpu_set_cpuid(vm, VCPU_ID, kvm_get_supported_cpuid()); in main()
117 run_vcpu(vm, VCPU_ID, 1); in main()
123 run_vcpu(vm, VCPU_ID, 2); in main()
132 vcpu_set_msr(vm, 0, MSR_IA32_TSC, HOST_ADJUST + val); in main()
135 run_vcpu(vm, VCPU_ID, 3); in main()
138 vcpu_set_msr(vm, 0, MSR_IA32_TSC_ADJUST, UNITY * 123456); in main()
140 ASSERT_EQ(vcpu_get_msr(vm, 0, MSR_IA32_TSC_ADJUST), UNITY * 123456); in main()
143 vcpu_set_msr(vm, 0, MSR_IA32_TSC_ADJUST, val); in main()
151 run_vcpu(vm, VCPU_ID, 4); in main()
160 run_vcpu(vm, VCPU_ID, 5); in main()
165 kvm_vm_free(vm); in main()