mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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 <baolu.lu@linux.intel.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/20241021085125.192333-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
parent
8e929cb546
commit
7c204426b8
1 changed files with 14 additions and 0 deletions
|
@ -4590,6 +4590,19 @@ static struct iommu_domain identity_domain = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct iommu_domain *intel_iommu_domain_alloc_paging(struct device *dev)
|
||||||
|
{
|
||||||
|
struct dmar_domain *dmar_domain;
|
||||||
|
bool first_stage;
|
||||||
|
|
||||||
|
first_stage = first_level_by_default(0);
|
||||||
|
dmar_domain = paging_domain_alloc(dev, first_stage);
|
||||||
|
if (IS_ERR(dmar_domain))
|
||||||
|
return ERR_CAST(dmar_domain);
|
||||||
|
|
||||||
|
return &dmar_domain->domain;
|
||||||
|
}
|
||||||
|
|
||||||
const struct iommu_ops intel_iommu_ops = {
|
const struct iommu_ops intel_iommu_ops = {
|
||||||
.blocked_domain = &blocking_domain,
|
.blocked_domain = &blocking_domain,
|
||||||
.release_domain = &blocking_domain,
|
.release_domain = &blocking_domain,
|
||||||
|
@ -4599,6 +4612,7 @@ const struct iommu_ops intel_iommu_ops = {
|
||||||
.domain_alloc = intel_iommu_domain_alloc,
|
.domain_alloc = intel_iommu_domain_alloc,
|
||||||
.domain_alloc_user = intel_iommu_domain_alloc_user,
|
.domain_alloc_user = intel_iommu_domain_alloc_user,
|
||||||
.domain_alloc_sva = intel_svm_domain_alloc,
|
.domain_alloc_sva = intel_svm_domain_alloc,
|
||||||
|
.domain_alloc_paging = intel_iommu_domain_alloc_paging,
|
||||||
.probe_device = intel_iommu_probe_device,
|
.probe_device = intel_iommu_probe_device,
|
||||||
.release_device = intel_iommu_release_device,
|
.release_device = intel_iommu_release_device,
|
||||||
.get_resv_regions = intel_iommu_get_resv_regions,
|
.get_resv_regions = intel_iommu_get_resv_regions,
|
||||||
|
|
Loading…
Add table
Reference in a new issue