]> git.proxmox.com Git - pve-kernel.git/commitdiff
fix #4707: add override parameter for RMRR relaxation
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 5 Sep 2023 12:31:04 +0000 (14:31 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 6 Sep 2023 06:53:13 +0000 (08:53 +0200)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
patches/kernel/0014-add-relaxable-rmrr.patch [new file with mode: 0644]

diff --git a/patches/kernel/0014-add-relaxable-rmrr.patch b/patches/kernel/0014-add-relaxable-rmrr.patch
new file mode 100644 (file)
index 0000000..43082dd
--- /dev/null
@@ -0,0 +1,35 @@
+From: kiler129 <grzegorz@noflash.pl>
+
+allow opt-in to allow pass-through on broken hardware..
+
+adapted from https://github.com/kiler129/relax-intel-rmrr , licensed under MIT or GPL 2.0+
+
+--- a/drivers/iommu/intel/iommu.c
++++ b/drivers/iommu/intel/iommu.c
+@@ -297,6 +297,7 @@
+ static int dmar_map_ipu = 1;
+ static int intel_iommu_superpage = 1;
+ static int iommu_identity_mapping;
++static int intel_relaxable_rmrr = 0;
+ static int iommu_skip_te_disable;
+ #define IDENTMAP_GFX          2
+@@ -358,6 +359,9 @@
+               } else if (!strncmp(str, "tboot_noforce", 13)) {
+                       pr_info("Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n");
+                       intel_iommu_tboot_noforce = 1;
++              } else if (!strncmp(str, "relax_rmrr", 10)) {
++                      pr_info("Intel-IOMMU: assuming all RMRRs are relaxable. This can lead to instability or data loss\n");
++                      intel_relaxable_rmrr = 1;
+               } else {
+                       pr_notice("Unknown option - '%s'\n", str);
+               }
+@@ -2538,7 +2542,7 @@
+               return false;
+       pdev = to_pci_dev(dev);
+-      if (IS_USB_DEVICE(pdev) || IS_GFX_DEVICE(pdev))
++      if (intel_relaxable_rmrr || IS_USB_DEVICE(pdev) || IS_GFX_DEVICE(pdev))
+               return true;
+       else
+               return false;