diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-02-19 14:07:23 +0800 |
---|---|---|
committer | Joerg Roedel <joro@8bytes.org> | 2014-03-04 17:51:00 +0100 |
commit | 7e7dfab71af851a7350ab47b1c01a2f84deacc12 (patch) | |
tree | c5a0483bf3fb65cf61739892a2002d60cab4c39e /include | |
parent | 816997d03bca9fabcee65f3481eb0297103eceb7 (diff) | |
download | linux-7e7dfab71af851a7350ab47b1c01a2f84deacc12.tar.gz linux-7e7dfab71af851a7350ab47b1c01a2f84deacc12.tar.bz2 linux-7e7dfab71af851a7350ab47b1c01a2f84deacc12.zip |
iommu/vt-d: Avoid caching stale domain_device_info when hot-removing PCI device
Function device_notifier() in intel-iommu.c only remove domain_device_info
data structure associated with a PCI device when handling PCI device
driver unbinding events. If a PCI device has never been bound to a PCI
device driver, there won't be BUS_NOTIFY_UNBOUND_DRIVER event when
hot-removing the PCI device. So associated domain_device_info data
structure may get lost.
On the other hand, if iommu_pass_through is enabled, function
iommu_prepare_static_indentify_mapping() will create domain_device_info
data structure for each PCIe to PCIe bridge and PCIe endpoint,
no matter whether there are drivers associated with those PCIe devices
or not. So those domain_device_info data structures will get lost when
hot-removing the assocated PCIe devices if they have never bound to
any PCI device driver.
To be even worse, it's not only an memory leak issue, but also an
caching of stale information bug because the memory are kept in
device_domain_list and domain->devices lists.
Fix the bug by trying to remove domain_device_info data structure when
handling BUS_NOTIFY_DEL_DEVICE event.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions