iommu/vt-d: Check identity map for hot-added devices
mainline inclusion from mainline-5.1-rc1 commit 117266fd category: bugfix bugzilla: 12206 CVE: NA ------------------------------------------------- The Intel IOMMU driver will put devices into a static identity mapped domain during boot if the kernel parameter "iommu=pt" is used. That means the IOMMU hardware will translate a DMA address into the same memory address. Unfortunately, hot-added devices are not subject to this. That results in some devices not working properly after hot added. A quick way to reproduce this issue is to boot a system with iommu=pt and, remove then readd the pci device with echo 1 > /sys/bus/pci/devices/[pci_source_id]/remove echo 1 > /sys/bus/pci/rescan You will find the identity mapped domain was replaced with a normal domain. Cc: Ashok Raj <ashok.raj@intel.com> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: stable@vger.kernel.org Reported-by: NJis Ben <jisben@google.com> Signed-off-by: NLu Baolu <baolu.lu@linux.intel.com> Tested-by: NJames Dong <xmdong@google.com> Fixes: 99dcaded ('intel-iommu: Support PCIe hot-plug') Signed-off-by: NJoerg Roedel <jroedel@suse.de> Conflicts: drivers/iommu/intel-iommu.c (cherry picked from commit 117266fd) Signed-off-by: NZhen Lei <thunder.leizhen@huawei.com> Reviewed-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
想要评论请 注册 或 登录