]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/vt-d: Refactor iommu information of each domain
authorLu Baolu <baolu.lu@linux.intel.com>
Tue, 12 Jul 2022 00:09:05 +0000 (08:09 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 15 Jul 2022 08:21:41 +0000 (10:21 +0200)
commit6a982529d1197071a443ee83c115779061e6f49a
tree96b7897e53c3057ae03fc0959a1d57689d4b4a66
parentd417efd00f2ebb03c3f6c0671ba8bf60d03fd973
iommu/vt-d: Refactor iommu information of each domain

When a DMA domain is attached to a device, it needs to allocate a domain
ID from its IOMMU. Currently, the domain ID information is stored in two
static arrays embedded in the domain structure. This can lead to memory
waste when the driver is running on a small platform.

This optimizes these static arrays by replacing them with an xarray and
consuming memory on demand.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Steve Wahl <steve.wahl@hpe.com>
Link: https://lore.kernel.org/r/20220702015610.2849494-4-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/pasid.c
drivers/iommu/intel/svm.c