Lines Matching refs:vmx

78 	struct vmx_pages *vmx = addr_gva2hva(vm, vmx_gva);  in vcpu_alloc_vmx()  local
81 vmx->vmxon = (void *)vm_vaddr_alloc_page(vm); in vcpu_alloc_vmx()
82 vmx->vmxon_hva = addr_gva2hva(vm, (uintptr_t)vmx->vmxon); in vcpu_alloc_vmx()
83 vmx->vmxon_gpa = addr_gva2gpa(vm, (uintptr_t)vmx->vmxon); in vcpu_alloc_vmx()
86 vmx->vmcs = (void *)vm_vaddr_alloc_page(vm); in vcpu_alloc_vmx()
87 vmx->vmcs_hva = addr_gva2hva(vm, (uintptr_t)vmx->vmcs); in vcpu_alloc_vmx()
88 vmx->vmcs_gpa = addr_gva2gpa(vm, (uintptr_t)vmx->vmcs); in vcpu_alloc_vmx()
91 vmx->msr = (void *)vm_vaddr_alloc_page(vm); in vcpu_alloc_vmx()
92 vmx->msr_hva = addr_gva2hva(vm, (uintptr_t)vmx->msr); in vcpu_alloc_vmx()
93 vmx->msr_gpa = addr_gva2gpa(vm, (uintptr_t)vmx->msr); in vcpu_alloc_vmx()
94 memset(vmx->msr_hva, 0, getpagesize()); in vcpu_alloc_vmx()
97 vmx->shadow_vmcs = (void *)vm_vaddr_alloc_page(vm); in vcpu_alloc_vmx()
98 vmx->shadow_vmcs_hva = addr_gva2hva(vm, (uintptr_t)vmx->shadow_vmcs); in vcpu_alloc_vmx()
99 vmx->shadow_vmcs_gpa = addr_gva2gpa(vm, (uintptr_t)vmx->shadow_vmcs); in vcpu_alloc_vmx()
102 vmx->vmread = (void *)vm_vaddr_alloc_page(vm); in vcpu_alloc_vmx()
103 vmx->vmread_hva = addr_gva2hva(vm, (uintptr_t)vmx->vmread); in vcpu_alloc_vmx()
104 vmx->vmread_gpa = addr_gva2gpa(vm, (uintptr_t)vmx->vmread); in vcpu_alloc_vmx()
105 memset(vmx->vmread_hva, 0, getpagesize()); in vcpu_alloc_vmx()
107 vmx->vmwrite = (void *)vm_vaddr_alloc_page(vm); in vcpu_alloc_vmx()
108 vmx->vmwrite_hva = addr_gva2hva(vm, (uintptr_t)vmx->vmwrite); in vcpu_alloc_vmx()
109 vmx->vmwrite_gpa = addr_gva2gpa(vm, (uintptr_t)vmx->vmwrite); in vcpu_alloc_vmx()
110 memset(vmx->vmwrite_hva, 0, getpagesize()); in vcpu_alloc_vmx()
113 vmx->vp_assist = (void *)vm_vaddr_alloc_page(vm); in vcpu_alloc_vmx()
114 vmx->vp_assist_hva = addr_gva2hva(vm, (uintptr_t)vmx->vp_assist); in vcpu_alloc_vmx()
115 vmx->vp_assist_gpa = addr_gva2gpa(vm, (uintptr_t)vmx->vp_assist); in vcpu_alloc_vmx()
118 vmx->enlightened_vmcs = (void *)vm_vaddr_alloc_page(vm); in vcpu_alloc_vmx()
119 vmx->enlightened_vmcs_hva = in vcpu_alloc_vmx()
120 addr_gva2hva(vm, (uintptr_t)vmx->enlightened_vmcs); in vcpu_alloc_vmx()
121 vmx->enlightened_vmcs_gpa = in vcpu_alloc_vmx()
122 addr_gva2gpa(vm, (uintptr_t)vmx->enlightened_vmcs); in vcpu_alloc_vmx()
125 return vmx; in vcpu_alloc_vmx()
128 bool prepare_for_vmx_operation(struct vmx_pages *vmx) in prepare_for_vmx_operation() argument
165 *(uint32_t *)(vmx->vmxon) = vmcs_revision(); in prepare_for_vmx_operation()
166 if (vmxon(vmx->vmxon_gpa)) in prepare_for_vmx_operation()
172 bool load_vmcs(struct vmx_pages *vmx) in load_vmcs() argument
176 *(uint32_t *)(vmx->vmcs) = vmcs_revision(); in load_vmcs()
177 if (vmclear(vmx->vmcs_gpa)) in load_vmcs()
180 if (vmptrld(vmx->vmcs_gpa)) in load_vmcs()
184 *(uint32_t *)(vmx->shadow_vmcs) = in load_vmcs()
186 if (vmclear(vmx->shadow_vmcs_gpa)) in load_vmcs()
189 if (evmcs_vmptrld(vmx->enlightened_vmcs_gpa, in load_vmcs()
190 vmx->enlightened_vmcs)) in load_vmcs()
211 static inline void init_vmcs_control_fields(struct vmx_pages *vmx) in init_vmcs_control_fields() argument
220 if (vmx->eptp_gpa) { in init_vmcs_control_fields()
226 .address = vmx->eptp_gpa >> PAGE_SHIFT_4K, in init_vmcs_control_fields()
261 vmwrite(MSR_BITMAP, vmx->msr_gpa); in init_vmcs_control_fields()
262 vmwrite(VMREAD_BITMAP, vmx->vmread_gpa); in init_vmcs_control_fields()
263 vmwrite(VMWRITE_BITMAP, vmx->vmwrite_gpa); in init_vmcs_control_fields()
380 void prepare_vmcs(struct vmx_pages *vmx, void *guest_rip, void *guest_rsp) in prepare_vmcs() argument
382 init_vmcs_control_fields(vmx); in prepare_vmcs()
419 void __nested_pg_map(struct vmx_pages *vmx, struct kvm_vm *vm, in __nested_pg_map() argument
423 struct eptPageTableEntry *pt = vmx->eptp_hva, *pte; in __nested_pg_map()
470 void nested_pg_map(struct vmx_pages *vmx, struct kvm_vm *vm, in nested_pg_map() argument
473 __nested_pg_map(vmx, vm, nested_paddr, paddr, PG_LEVEL_4K); in nested_pg_map()
493 void __nested_map(struct vmx_pages *vmx, struct kvm_vm *vm, in __nested_map() argument
504 __nested_pg_map(vmx, vm, nested_paddr, paddr, level); in __nested_map()
510 void nested_map(struct vmx_pages *vmx, struct kvm_vm *vm, in nested_map() argument
513 __nested_map(vmx, vm, nested_paddr, paddr, size, PG_LEVEL_4K); in nested_map()
519 void nested_map_memslot(struct vmx_pages *vmx, struct kvm_vm *vm, in nested_map_memslot() argument
533 nested_map(vmx, vm, in nested_map_memslot()
541 void nested_identity_map_1g(struct vmx_pages *vmx, struct kvm_vm *vm, in nested_identity_map_1g() argument
544 __nested_map(vmx, vm, addr, addr, size, PG_LEVEL_1G); in nested_identity_map_1g()
563 void prepare_eptp(struct vmx_pages *vmx, struct kvm_vm *vm, in prepare_eptp() argument
568 vmx->eptp = (void *)vm_vaddr_alloc_page(vm); in prepare_eptp()
569 vmx->eptp_hva = addr_gva2hva(vm, (uintptr_t)vmx->eptp); in prepare_eptp()
570 vmx->eptp_gpa = addr_gva2gpa(vm, (uintptr_t)vmx->eptp); in prepare_eptp()
573 void prepare_virtualize_apic_accesses(struct vmx_pages *vmx, struct kvm_vm *vm) in prepare_virtualize_apic_accesses() argument
575 vmx->apic_access = (void *)vm_vaddr_alloc_page(vm); in prepare_virtualize_apic_accesses()
576 vmx->apic_access_hva = addr_gva2hva(vm, (uintptr_t)vmx->apic_access); in prepare_virtualize_apic_accesses()
577 vmx->apic_access_gpa = addr_gva2gpa(vm, (uintptr_t)vmx->apic_access); in prepare_virtualize_apic_accesses()