Lines Matching refs:host_kvm
114 static int __pkvm_create_hyp_vm(struct kvm *host_kvm) in __pkvm_create_hyp_vm() argument
123 if (host_kvm->created_vcpus < 1) in __pkvm_create_hyp_vm()
126 pgd_sz = kvm_pgtable_stage2_pgd_size(host_kvm->arch.vtcr); in __pkvm_create_hyp_vm()
140 host_kvm->created_vcpus))); in __pkvm_create_hyp_vm()
148 ret = kvm_call_hyp_nvhe(__pkvm_init_vm, host_kvm, hyp_vm, pgd); in __pkvm_create_hyp_vm()
154 host_kvm->arch.pkvm.handle = handle; in __pkvm_create_hyp_vm()
158 kvm_for_each_vcpu(idx, host_vcpu, host_kvm) { in __pkvm_create_hyp_vm()
184 pkvm_destroy_hyp_vm(host_kvm); in __pkvm_create_hyp_vm()
193 int pkvm_create_hyp_vm(struct kvm *host_kvm) in pkvm_create_hyp_vm() argument
197 mutex_lock(&host_kvm->lock); in pkvm_create_hyp_vm()
198 if (!host_kvm->arch.pkvm.handle) in pkvm_create_hyp_vm()
199 ret = __pkvm_create_hyp_vm(host_kvm); in pkvm_create_hyp_vm()
200 mutex_unlock(&host_kvm->lock); in pkvm_create_hyp_vm()
205 void pkvm_destroy_hyp_vm(struct kvm *host_kvm) in pkvm_destroy_hyp_vm() argument
207 if (host_kvm->arch.pkvm.handle) { in pkvm_destroy_hyp_vm()
209 host_kvm->arch.pkvm.handle)); in pkvm_destroy_hyp_vm()
212 host_kvm->arch.pkvm.handle = 0; in pkvm_destroy_hyp_vm()
213 free_hyp_memcache(&host_kvm->arch.pkvm.teardown_mc); in pkvm_destroy_hyp_vm()
216 int pkvm_init_host_vm(struct kvm *host_kvm) in pkvm_init_host_vm() argument
218 mutex_init(&host_kvm->lock); in pkvm_init_host_vm()