iommu/vt-d: Enhance capability check for nested parent domain allocation
authorYi Liu <yi.l.liu@intel.com>
Tue, 24 Oct 2023 15:00:11 +0000 (08:00 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 26 Oct 2023 14:16:11 +0000 (11:16 -0300)
commita2cdecdf9d234455fdfc8f539bbf5818711bc29d
treecdc9e010626db90fe25ce92e549d7a710d779cb9
parent55a01657cbee07d772b1d3cb144f867a326e4673
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>
drivers/iommu/intel/iommu.c
drivers/iommu/intel/iommu.h