summaryrefslogtreecommitdiff
path: root/drivers/iommu/intel/iommu.h
diff options
context:
space:
mode:
authorYi Liu <yi.l.liu@intel.com>2023-10-24 08:00:11 -0700
committerJason Gunthorpe <jgg@nvidia.com>2023-10-26 11:16:11 -0300
commita2cdecdf9d234455fdfc8f539bbf5818711bc29d (patch)
treecdc9e010626db90fe25ce92e549d7a710d779cb9 /drivers/iommu/intel/iommu.h
parent55a01657cbee07d772b1d3cb144f867a326e4673 (diff)
downloadlinux-a2cdecdf9d234455fdfc8f539bbf5818711bc29d.tar.gz
linux-a2cdecdf9d234455fdfc8f539bbf5818711bc29d.tar.bz2
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.h')
-rw-r--r--drivers/iommu/intel/iommu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iommu/intel/iommu.h b/drivers/iommu/intel/iommu.h
index 3bb569146229..cc7301579773 100644
--- a/drivers/iommu/intel/iommu.h
+++ b/drivers/iommu/intel/iommu.h
@@ -544,6 +544,8 @@ enum {
ecap_pasid((iommu)->ecap))
#define ssads_supported(iommu) (sm_supported(iommu) && \
ecap_slads((iommu)->ecap))
+#define nested_supported(iommu) (sm_supported(iommu) && \
+ ecap_nest((iommu)->ecap))
struct pasid_entry;
struct pasid_state_entry;