Lines Matching refs:host_kvm

104 static void __pkvm_destroy_hyp_vm(struct kvm *host_kvm)  in __pkvm_destroy_hyp_vm()  argument
106 if (host_kvm->arch.pkvm.handle) { in __pkvm_destroy_hyp_vm()
108 host_kvm->arch.pkvm.handle)); in __pkvm_destroy_hyp_vm()
111 host_kvm->arch.pkvm.handle = 0; in __pkvm_destroy_hyp_vm()
112 free_hyp_memcache(&host_kvm->arch.pkvm.teardown_mc); in __pkvm_destroy_hyp_vm()
125 static int __pkvm_create_hyp_vm(struct kvm *host_kvm) in __pkvm_create_hyp_vm() argument
134 if (host_kvm->created_vcpus < 1) in __pkvm_create_hyp_vm()
137 pgd_sz = kvm_pgtable_stage2_pgd_size(host_kvm->arch.mmu.vtcr); in __pkvm_create_hyp_vm()
151 host_kvm->created_vcpus))); in __pkvm_create_hyp_vm()
159 ret = kvm_call_hyp_nvhe(__pkvm_init_vm, host_kvm, hyp_vm, pgd); in __pkvm_create_hyp_vm()
165 host_kvm->arch.pkvm.handle = handle; in __pkvm_create_hyp_vm()
169 kvm_for_each_vcpu(idx, host_vcpu, host_kvm) { in __pkvm_create_hyp_vm()
195 __pkvm_destroy_hyp_vm(host_kvm); in __pkvm_create_hyp_vm()
204 int pkvm_create_hyp_vm(struct kvm *host_kvm) in pkvm_create_hyp_vm() argument
208 mutex_lock(&host_kvm->arch.config_lock); in pkvm_create_hyp_vm()
209 if (!host_kvm->arch.pkvm.handle) in pkvm_create_hyp_vm()
210 ret = __pkvm_create_hyp_vm(host_kvm); in pkvm_create_hyp_vm()
211 mutex_unlock(&host_kvm->arch.config_lock); in pkvm_create_hyp_vm()
216 void pkvm_destroy_hyp_vm(struct kvm *host_kvm) in pkvm_destroy_hyp_vm() argument
218 mutex_lock(&host_kvm->arch.config_lock); in pkvm_destroy_hyp_vm()
219 __pkvm_destroy_hyp_vm(host_kvm); in pkvm_destroy_hyp_vm()
220 mutex_unlock(&host_kvm->arch.config_lock); in pkvm_destroy_hyp_vm()
223 int pkvm_init_host_vm(struct kvm *host_kvm) in pkvm_init_host_vm() argument