]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Apr 2020 11:52:10 +0000 (13:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Apr 2020 11:52:10 +0000 (13:52 +0200)
added patches:
iommu-vt-d-allow-devices-with-rmrrs-to-use-identity-domain.patch

queue-5.4/iommu-vt-d-allow-devices-with-rmrrs-to-use-identity-domain.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/iommu-vt-d-allow-devices-with-rmrrs-to-use-identity-domain.patch b/queue-5.4/iommu-vt-d-allow-devices-with-rmrrs-to-use-identity-domain.patch
new file mode 100644 (file)
index 0000000..d72d230
--- /dev/null
@@ -0,0 +1,72 @@
+From 9235cb13d7d17baba0b3a9277381258361e95c16 Mon Sep 17 00:00:00 2001
+From: Lu Baolu <baolu.lu@linux.intel.com>
+Date: Wed, 15 Jan 2020 11:03:58 +0800
+Subject: iommu/vt-d: Allow devices with RMRRs to use identity domain
+
+From: Lu Baolu <baolu.lu@linux.intel.com>
+
+commit 9235cb13d7d17baba0b3a9277381258361e95c16 upstream.
+
+Since commit ea2447f700cab ("intel-iommu: Prevent devices with
+RMRRs from being placed into SI Domain"), the Intel IOMMU driver
+doesn't allow any devices with RMRR locked to use the identity
+domain. This was added to to fix the issue where the RMRR info
+for devices being placed in and out of the identity domain gets
+lost. This identity maps all RMRRs when setting up the identity
+domain, so that devices with RMRRs could also use it.
+
+Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
+Signed-off-by: Joerg Roedel <jroedel@suse.de>
+Cc: Alan Stern <stern@rowland.harvard.edu>
+Cc: John Donnelly <john.p.donnelly@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iommu/intel-iommu.c |   15 ++-------------
+ 1 file changed, 2 insertions(+), 13 deletions(-)
+
+--- a/drivers/iommu/intel-iommu.c
++++ b/drivers/iommu/intel-iommu.c
+@@ -2762,10 +2762,8 @@ static int __init si_domain_init(int hw)
+       }
+       /*
+-       * Normally we use DMA domains for devices which have RMRRs. But we
+-       * loose this requirement for graphic and usb devices. Identity map
+-       * the RMRRs for graphic and USB devices so that they could use the
+-       * si_domain.
++       * Identity map the RMRRs so that devices with RMRRs could also use
++       * the si_domain.
+        */
+       for_each_rmrr_units(rmrr) {
+               for_each_active_dev_scope(rmrr->devices, rmrr->devices_cnt,
+@@ -2773,9 +2771,6 @@ static int __init si_domain_init(int hw)
+                       unsigned long long start = rmrr->base_address;
+                       unsigned long long end = rmrr->end_address;
+-                      if (device_is_rmrr_locked(dev))
+-                              continue;
+-
+                       if (WARN_ON(end < start ||
+                                   end >> agaw_to_width(si_domain->agaw)))
+                               continue;
+@@ -2914,9 +2909,6 @@ static int device_def_domain_type(struct
+       if (dev_is_pci(dev)) {
+               struct pci_dev *pdev = to_pci_dev(dev);
+-              if (device_is_rmrr_locked(dev))
+-                      return IOMMU_DOMAIN_DMA;
+-
+               /*
+                * Prevent any device marked as untrusted from getting
+                * placed into the statically identity mapping domain.
+@@ -2954,9 +2946,6 @@ static int device_def_domain_type(struct
+                               return IOMMU_DOMAIN_DMA;
+               } else if (pci_pcie_type(pdev) == PCI_EXP_TYPE_PCI_BRIDGE)
+                       return IOMMU_DOMAIN_DMA;
+-      } else {
+-              if (device_has_rmrr(dev))
+-                      return IOMMU_DOMAIN_DMA;
+       }
+       return (iommu_identity_mapping & IDENTMAP_ALL) ?
index e610ea6aa99124b5a6d3b628cb6eb21b7ddcacf4..3bce868fb62a7bd88514cc8fe0d80c87aa093102 100644 (file)
@@ -38,3 +38,4 @@ rdma-cm-update-num_paths-in-cma_resolve_iboe_route-error-flow.patch
 blk-mq-keep-set-nr_hw_queues-and-set-map.nr_queues-in-sync.patch
 fbcon-fix-null-ptr-deref-in-fbcon_switch.patch
 drm-i915-fix-ref-mutex-deadlock-in-i915_active_wait.patch
+iommu-vt-d-allow-devices-with-rmrrs-to-use-identity-domain.patch