From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: kiler129 Date: Mon, 18 Sep 2023 15:19:26 +0200 Subject: [PATCH] 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+ --- drivers/iommu/intel/iommu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index 1c5ba4dbfe78..887667218e3b 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -297,6 +297,7 @@ static int dmar_map_gfx = 1; 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 @@ static int __init intel_iommu_setup(char *str) } 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 @@ static bool device_rmrr_is_relaxable(struct device *dev) 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;