Lines Matching refs:vm
25 struct acrn_vm *acrn_vm_create(struct acrn_vm *vm, in acrn_vm_create() argument
37 mutex_init(&vm->regions_mapping_lock); in acrn_vm_create()
38 INIT_LIST_HEAD(&vm->ioreq_clients); in acrn_vm_create()
39 spin_lock_init(&vm->ioreq_clients_lock); in acrn_vm_create()
40 vm->vmid = vm_param->vmid; in acrn_vm_create()
41 vm->vcpu_num = vm_param->vcpu_num; in acrn_vm_create()
43 if (acrn_ioreq_init(vm, vm_param->ioreq_buf) < 0) { in acrn_vm_create()
45 vm->vmid = ACRN_INVALID_VMID; in acrn_vm_create()
50 list_add(&vm->list, &acrn_vm_list); in acrn_vm_create()
53 acrn_ioeventfd_init(vm); in acrn_vm_create()
54 acrn_irqfd_init(vm); in acrn_vm_create()
55 dev_dbg(acrn_dev.this_device, "VM %u created.\n", vm->vmid); in acrn_vm_create()
56 return vm; in acrn_vm_create()
59 int acrn_vm_destroy(struct acrn_vm *vm) in acrn_vm_destroy() argument
63 if (vm->vmid == ACRN_INVALID_VMID || in acrn_vm_destroy()
64 test_and_set_bit(ACRN_VM_FLAG_DESTROYED, &vm->flags)) in acrn_vm_destroy()
67 ret = hcall_destroy_vm(vm->vmid); in acrn_vm_destroy()
70 "Failed to destroy VM %u\n", vm->vmid); in acrn_vm_destroy()
71 clear_bit(ACRN_VM_FLAG_DESTROYED, &vm->flags); in acrn_vm_destroy()
77 list_del_init(&vm->list); in acrn_vm_destroy()
80 acrn_ioeventfd_deinit(vm); in acrn_vm_destroy()
81 acrn_irqfd_deinit(vm); in acrn_vm_destroy()
82 acrn_ioreq_deinit(vm); in acrn_vm_destroy()
84 if (vm->monitor_page) { in acrn_vm_destroy()
85 put_page(vm->monitor_page); in acrn_vm_destroy()
86 vm->monitor_page = NULL; in acrn_vm_destroy()
89 acrn_vm_all_ram_unmap(vm); in acrn_vm_destroy()
91 dev_dbg(acrn_dev.this_device, "VM %u destroyed.\n", vm->vmid); in acrn_vm_destroy()
92 vm->vmid = ACRN_INVALID_VMID; in acrn_vm_destroy()
104 int acrn_msi_inject(struct acrn_vm *vm, u64 msi_addr, u64 msi_data) in acrn_msi_inject() argument
120 ret = hcall_inject_msi(vm->vmid, virt_to_phys(msi)); in acrn_msi_inject()
123 "Failed to inject MSI to VM %u!\n", vm->vmid); in acrn_msi_inject()