iommu/vt-d: Check device list of domain in domain free path
authorLu Baolu <baolu.lu@linux.intel.com>
Tue, 12 Jul 2022 00:08:59 +0000 (08:08 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 15 Jul 2022 08:21:38 +0000 (10:21 +0200)
commit79d82ce4027f30c4d40fdf377888203f76b7ddcc
treef2bfb25d0b387258fe002c4b78aab9b4d67f6f13
parent8430fd3f3287013cb3f04b465c0686c41c86a8c8
iommu/vt-d: Check device list of domain in domain free path

When the IOMMU domain is about to be freed, it should not be set on any
device. Instead of silently dealing with some bug cases, it's better to
trigger a warning to report and fix any potential bugs at the first time.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20220706025524.2904370-9-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c