diff options
| author | Lu Baolu <[email protected]> | 2024-11-04 01:40:23 +0000 |
|---|---|---|
| committer | Joerg Roedel <[email protected]> | 2024-11-05 12:32:16 +0000 |
| commit | a98db518dde246e01ead53617dc0a30d6aaa3752 (patch) | |
| tree | 697febcf29984ac783a9299f9ff4af5027359d2c /drivers/iommu/intel/nested.c | |
| parent | iommu/vt-d: Remove unused domain_alloc callback (diff) | |
| download | kernel-a98db518dde246e01ead53617dc0a30d6aaa3752.tar.gz kernel-a98db518dde246e01ead53617dc0a30d6aaa3752.zip | |
iommu/vt-d: Enhance compatibility check for paging domain attach
The driver now supports domain_alloc_paging, ensuring that a valid device
pointer is provided whenever a paging domain is allocated. Additionally,
the dmar_domain attributes are set up at the time of allocation.
Consistent with the established semantics in the IOMMU core, if a domain is
attached to a device and found to be incompatible with the IOMMU hardware
capabilities, the operation will return an -EINVAL error. This implicitly
advises the caller to allocate a new domain for the device and attempt the
domain attachment again.
Rename prepare_domain_attach_device() to a more meaningful name.
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]>
Diffstat (limited to 'drivers/iommu/intel/nested.c')
| -rw-r--r-- | drivers/iommu/intel/nested.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/intel/nested.c b/drivers/iommu/intel/nested.c index 433c58944401..96016bc40f94 100644 --- a/drivers/iommu/intel/nested.c +++ b/drivers/iommu/intel/nested.c @@ -40,7 +40,7 @@ static int intel_nested_attach_dev(struct iommu_domain *domain, * The s2_domain will be used in nested translation, hence needs * to ensure the s2_domain is compatible with this IOMMU. */ - ret = prepare_domain_attach_device(&dmar_domain->s2_domain->domain, dev); + ret = paging_domain_compatible(&dmar_domain->s2_domain->domain, dev); if (ret) { dev_err_ratelimited(dev, "s2 domain is not compatible\n"); return ret; |
