Lines Matching refs:vm
97 struct kvm_vm *vm; in main() local
103 vm = vm_create_default(VCPU_ID, 0, guest_code); in main()
105 vcpu_set_cpuid(vm, VCPU_ID, kvm_get_supported_cpuid()); in main()
107 run = vcpu_state(vm, VCPU_ID); in main()
109 vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS, SMRAM_GPA, in main()
111 TEST_ASSERT(vm_phy_pages_alloc(vm, SMRAM_PAGES, SMRAM_GPA, SMRAM_MEMSLOT) in main()
114 memset(addr_gpa2hva(vm, SMRAM_GPA), 0x0, SMRAM_SIZE); in main()
115 memcpy(addr_gpa2hva(vm, SMRAM_GPA) + 0x8000, smi_handler, in main()
118 vcpu_set_msr(vm, VCPU_ID, MSR_IA32_SMBASE, SMRAM_GPA); in main()
122 vcpu_alloc_svm(vm, &nested_gva); in main()
124 vcpu_alloc_vmx(vm, &nested_gva); in main()
130 vcpu_args_set(vm, VCPU_ID, 1, nested_gva); in main()
133 _vcpu_run(vm, VCPU_ID); in main()
140 vcpu_regs_get(vm, VCPU_ID, ®s); in main()
152 state = vcpu_save_state(vm, VCPU_ID); in main()
153 kvm_vm_release(vm); in main()
154 kvm_vm_restart(vm, O_RDWR); in main()
155 vm_vcpu_add(vm, VCPU_ID); in main()
156 vcpu_set_cpuid(vm, VCPU_ID, kvm_get_supported_cpuid()); in main()
157 vcpu_load_state(vm, VCPU_ID, state); in main()
158 run = vcpu_state(vm, VCPU_ID); in main()
163 kvm_vm_free(vm); in main()