Skip to content

Commit 7c20442

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Add domain_alloc_paging support
Add the domain_alloc_paging callback for domain allocation using the iommu_paging_domain_alloc() interface. Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 8e929cb commit 7c20442

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4590,6 +4590,19 @@ static struct iommu_domain identity_domain = {
45904590
},
45914591
};
45924592

4593+
static struct iommu_domain *intel_iommu_domain_alloc_paging(struct device *dev)
4594+
{
4595+
struct dmar_domain *dmar_domain;
4596+
bool first_stage;
4597+
4598+
first_stage = first_level_by_default(0);
4599+
dmar_domain = paging_domain_alloc(dev, first_stage);
4600+
if (IS_ERR(dmar_domain))
4601+
return ERR_CAST(dmar_domain);
4602+
4603+
return &dmar_domain->domain;
4604+
}
4605+
45934606
const struct iommu_ops intel_iommu_ops = {
45944607
.blocked_domain = &blocking_domain,
45954608
.release_domain = &blocking_domain,
@@ -4599,6 +4612,7 @@ const struct iommu_ops intel_iommu_ops = {
45994612
.domain_alloc = intel_iommu_domain_alloc,
46004613
.domain_alloc_user = intel_iommu_domain_alloc_user,
46014614
.domain_alloc_sva = intel_svm_domain_alloc,
4615+
.domain_alloc_paging = intel_iommu_domain_alloc_paging,
46024616
.probe_device = intel_iommu_probe_device,
46034617
.release_device = intel_iommu_release_device,
46044618
.get_resv_regions = intel_iommu_get_resv_regions,

0 commit comments

Comments
 (0)