• Home
  • Raw
  • Download

Lines Matching refs:vm

63 static void steal_time_init(struct kvm_vm *vm)  in steal_time_init()  argument
76 vcpu_set_cpuid(vm, i, kvm_get_supported_cpuid()); in steal_time_init()
80 sync_global_to_guest(vm, st_gva[i]); in steal_time_init()
82 ret = _vcpu_set_msr(vm, i, MSR_KVM_STEAL_TIME, (ulong)st_gva[i] | KVM_STEAL_RESERVED_MASK); in steal_time_init()
85 vcpu_set_msr(vm, i, MSR_KVM_STEAL_TIME, (ulong)st_gva[i] | KVM_MSR_ENABLED); in steal_time_init()
89 static void steal_time_dump(struct kvm_vm *vm, uint32_t vcpuid) in steal_time_dump() argument
91 struct kvm_steal_time *st = addr_gva2hva(vm, (ulong)st_gva[vcpuid]); in steal_time_dump()
172 static void steal_time_init(struct kvm_vm *vm) in steal_time_init() argument
180 ret = _vcpu_ioctl(vm, 0, KVM_HAS_DEVICE_ATTR, &dev); in steal_time_init()
189 vcpu_ioctl(vm, i, KVM_HAS_DEVICE_ATTR, &dev); in steal_time_init()
195 sync_global_to_guest(vm, st_gva[i]); in steal_time_init()
198 ret = _vcpu_ioctl(vm, i, KVM_SET_DEVICE_ATTR, &dev); in steal_time_init()
202 vcpu_ioctl(vm, i, KVM_SET_DEVICE_ATTR, &dev); in steal_time_init()
204 ret = _vcpu_ioctl(vm, i, KVM_SET_DEVICE_ATTR, &dev); in steal_time_init()
210 static void steal_time_dump(struct kvm_vm *vm, uint32_t vcpuid) in steal_time_dump() argument
212 struct st_time *st = addr_gva2hva(vm, (ulong)st_gva[vcpuid]); in steal_time_dump()
252 static void run_vcpu(struct kvm_vm *vm, uint32_t vcpuid) in run_vcpu() argument
256 vcpu_args_set(vm, vcpuid, 1, vcpuid); in run_vcpu()
258 vcpu_ioctl(vm, vcpuid, KVM_RUN, NULL); in run_vcpu()
260 switch (get_ucall(vm, vcpuid, &uc)) { in run_vcpu()
269 exit_reason_str(vcpu_state(vm, vcpuid)->exit_reason)); in run_vcpu()
275 struct kvm_vm *vm; in main() local
295 vm = vm_create_default(0, 0, guest_code); in main()
297 vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS, ST_GPA_BASE, 1, gpages, 0); in main()
298 virt_map(vm, ST_GPA_BASE, ST_GPA_BASE, gpages, 0); in main()
299 ucall_init(vm, NULL); in main()
303 vm_vcpu_add_default(vm, i, guest_code); in main()
305 steal_time_init(vm); in main()
310 run_vcpu(vm, i); in main()
313 run_vcpu(vm, i); in main()
314 sync_global_from_guest(vm, guest_stolen_time[i]); in main()
334 run_vcpu(vm, i); in main()
335 sync_global_from_guest(vm, guest_stolen_time[i]); in main()
347 steal_time_dump(vm, i); in main()