Patch "iommu/vt-d: Use BUS_NOTIFY_REMOVED_DEVICE in hotplug path" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
iommu/vt-d: Use BUS_NOTIFY_REMOVED_DEVICE in hotplug path
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
iommu-vt-d-use-bus_notify_removed_device-in-hotplug-path.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
e6a8c9b337eed56eb481e1b4dd2180c25a1e5310Mon Sep 17 00:00:00 2001
From: Joerg Roedel <[email protected]>
Date: Mon, 29 Feb 2016 23:49:47 +0100
Subject: iommu/vt-d: Use BUS_NOTIFY_REMOVED_DEVICE in hotplug path
From: Joerg Roedel <[email protected]>
commit e6a8c9b337eed56eb481e1b4dd2180c25a1e5310 upstream.
In the PCI hotplug path of the Intel IOMMU driver, replace the usage of the BUS_NOTIFY_DEL_DEVICE notifier, which is executed before the driver is unbound from the device, with BUS_NOTIFY_REMOVED_DEVICE, which runs after that.
This fixes a kernel BUG being triggered in the VT-d code when the device driver tries to unmap DMA buffers and the VT-d driver already destroyed all mappings.
--- drivers/iommu/dmar.c | 5 +++-- drivers/iommu/intel-iommu.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/iommu/dmar.c +3 -2
@@ -329,7 +329,8 @@ static int dmar_pci_bus_notifier(struct/* Only care about add/remove events for physical functions */ if (pdev->is_virtfn)return NOTIFY_DONE ; -if (action !=BUS_NOTIFY_ADD_DEVICE && action !=BUS_NOTIFY_DEL_DEVICE ) +if (action !=BUS_NOTIFY_ADD_DEVICE && + action !=BUS_NOTIFY_REMOVED_DEVICE )return NOTIFY_DONE ; info =dmar_alloc_pci_notify_info (pdev, action);
@@ -339,7 +340,7 @@ static int dmar_pci_bus_notifier(structdown_write (&dmar_global_lock);if (action ==BUS_NOTIFY_ADD_DEVICE )dmar_pci_bus_add_dev (info); -else if (action ==BUS_NOTIFY_DEL_DEVICE ) +else if (action ==BUS_NOTIFY_REMOVED_DEVICE )dmar_pci_bus_del_dev (info);up_write (&dmar_global_lock);
drivers/iommu/intel-iommu.c +2 -2
@@ -4367,7 +4367,7 @@ int dmar_iommu_notify_scope_dev(struct d rmrru->devices_cnt);if (ret <0 )return ret; - }else if (info->event ==BUS_NOTIFY_DEL_DEVICE ) { + }else if (info->event ==BUS_NOTIFY_REMOVED_DEVICE ) {dmar_remove_dev_scope (info, rmrr->segment, rmrru->devices, rmrru->devices_cnt); }
@@ -4387,7 +4387,7 @@ int dmar_iommu_notify_scope_dev(struct dbreak ; else if(ret < 0) return ret; - }else if (info->event ==BUS_NOTIFY_DEL_DEVICE ) { + }else if (info->event ==BUS_NOTIFY_REMOVED_DEVICE ) {if (dmar_remove_dev_scope (info, atsr->segment, atsru->devices, atsru->devices_cnt))break ;
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/iommu-vt-d-use-bus_notify_removed_device-in-hotplug-path.patch queue-4.4/iommu-amd-fix-boot-warning-when-device-00-00.0-is-not-iommu-covered.patch queue-4.4/iommu-amd-apply-workaround-for-ats-write-permission-check.patch