Lines Matching defs:ndom
101 struct nested_domain *ndom;
108 ndom = kzalloc_obj(*ndom);
109 if (!ndom)
112 ret = iommu_copy_struct_from_user(&ndom->gdte, user_data,
118 ret = validate_gdte_nested(&ndom->gdte);
122 ndom->gdom_id = FIELD_GET(DTE_DOMID_MASK, ndom->gdte.dte[1]);
123 ndom->domain.ops = &nested_domain_ops;
124 ndom->domain.type = IOMMU_DOMAIN_NESTED;
125 ndom->viommu = aviommu;
145 ndom->gdom_id, &irqflags);
154 ndom->gdom_info = gdom_info;
158 __func__, ndom->gdom_id, gdom_info->hdom_id);
160 return &ndom->domain;
167 ndom->gdom_id, gdom_info, NULL, GFP_ATOMIC);
174 ndom->gdom_info = gdom_info;
180 __func__, ndom->gdom_id, gdom_info->hdom_id);
182 return &ndom->domain;
187 kfree(ndom);
195 struct nested_domain *ndom = to_ndomain(dom);
196 struct iommu_hwpt_amd_guest *gdte = &ndom->gdte;
204 if (WARN_ON(!ndom->viommu || !ndom->viommu->parent))
207 parent = ndom->viommu->parent;
217 amd_iommu_set_dte_v1(dev_data, parent, ndom->gdom_info->hdom_id,
267 struct nested_domain *ndom __free(kfree) = to_ndomain(dom);
268 struct amd_iommu_viommu *aviommu = ndom->viommu;
272 if (!refcount_dec_and_test(&ndom->gdom_info->users)) {
281 curr = __xa_cmpxchg(&aviommu->gdomid_array, ndom->gdom_id,
282 ndom->gdom_info, NULL, GFP_ATOMIC);
290 __func__, ndom->gdom_id, curr->hdom_id);
292 amd_iommu_pdom_id_free(ndom->gdom_info->hdom_id);