diff options
author | Yi Liu <yi.l.liu@intel.com> | 2023-10-24 17:00:11 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2023-10-26 16:16:11 +0200 |
commit | a2cdecdf9d234455fdfc8f539bbf5818711bc29d (patch) | |
tree | cdc9e010626db90fe25ce92e549d7a710d779cb9 /drivers/iommu/intel/iommu.c | |
parent | iommufd/selftest: Add coverage for IOMMU_HWPT_ALLOC with nested HWPTs (diff) | |
download | linux-a2cdecdf9d234455fdfc8f539bbf5818711bc29d.tar.xz linux-a2cdecdf9d234455fdfc8f539bbf5818711bc29d.zip |
iommu/vt-d: Enhance capability check for nested parent domain allocation
This adds the scalable mode check before allocating the nested parent domain
as checking nested capability is not enough. User may turn off scalable mode
which also means no nested support even if the hardware supports it.
Fixes: c97d1b20d383 ("iommu/vt-d: Add domain_alloc_user op")
Link: https://lore.kernel.org/r/20231024150011.44642-1-yi.l.liu@intel.com
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/iommu/intel/iommu.c')
-rw-r--r-- | drivers/iommu/intel/iommu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index fe67f8d77b09..cb64759b3d95 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -4095,7 +4095,7 @@ intel_iommu_domain_alloc_user(struct device *dev, u32 flags, if (!iommu) return ERR_PTR(-ENODEV); - if ((flags & IOMMU_HWPT_ALLOC_NEST_PARENT) && !ecap_nest(iommu->ecap)) + if ((flags & IOMMU_HWPT_ALLOC_NEST_PARENT) && !nested_supported(iommu)) return ERR_PTR(-EOPNOTSUPP); dirty_tracking = (flags & IOMMU_HWPT_ALLOC_DIRTY_TRACKING); |