iommu/vt-d: Track nested domains in parent
authorYi Liu <yi.l.liu@intel.com>
Mon, 19 Feb 2024 11:15:52 +0000 (19:15 +0800)
committerJoerg Roedel <jroedel@suse.de>
Wed, 21 Feb 2024 09:28:42 +0000 (10:28 +0100)
commit85ce8e1d6d73e8d54cb244d10dd4021771231746
tree6e66930599588ea56821d988b4abb21be44b81a3
parentb401b621758e46812da61fa58a67c3fd8d91de0d
iommu/vt-d: Track nested domains in parent

Today the parent domain (s2_domain) is unaware of which DID's are
used by and which devices are attached to nested domains (s1_domain)
nested on it. This leads to a problem that some operations (flush
iotlb/devtlb and enable dirty tracking) on parent domain only apply to
DID's and devices directly tracked in the parent domain hence are
incomplete.

This tracks the nested domains in list in parent domain. With this,
operations on parent domain can loop the nested domains and refer to
the devices and iommu_array to ensure the operations on parent domain
take effect on all the affected devices and iommus.

Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20240208082307.15759-2-yi.l.liu@intel.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c
drivers/iommu/intel/iommu.h
drivers/iommu/intel/nested.c