2023-09-18 16:19:28 +03:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2023-09-05 15:31:04 +03:00
|
|
|
From: kiler129 <grzegorz@noflash.pl>
|
2023-09-18 16:19:28 +03:00
|
|
|
Date: Mon, 18 Sep 2023 15:19:26 +0200
|
|
|
|
Subject: [PATCH] allow opt-in to allow pass-through on broken hardware..
|
2023-09-05 15:31:04 +03:00
|
|
|
|
|
|
|
adapted from https://github.com/kiler129/relax-intel-rmrr , licensed under MIT or GPL 2.0+
|
2023-10-13 16:27:50 +03:00
|
|
|
|
|
|
|
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
2023-09-18 16:19:28 +03:00
|
|
|
---
|
|
|
|
drivers/iommu/intel/iommu.c | 6 +++++-
|
|
|
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
2023-09-05 15:31:04 +03:00
|
|
|
|
2023-09-18 16:19:28 +03:00
|
|
|
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
|
2023-10-13 16:27:50 +03:00
|
|
|
index a377f8e0a414..3be334d34317 100644
|
2023-09-05 15:31:04 +03:00
|
|
|
--- a/drivers/iommu/intel/iommu.c
|
|
|
|
+++ b/drivers/iommu/intel/iommu.c
|
2023-10-13 16:27:50 +03:00
|
|
|
@@ -298,6 +298,7 @@ static int dmar_map_gfx = 1;
|
2023-09-05 15:31:04 +03:00
|
|
|
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
|
2023-10-13 16:27:50 +03:00
|
|
|
@@ -359,6 +360,9 @@ static int __init intel_iommu_setup(char *str)
|
2023-09-05 15:31:04 +03:00
|
|
|
} 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);
|
|
|
|
}
|
2023-10-13 16:27:50 +03:00
|
|
|
@@ -2503,7 +2507,7 @@ static bool device_rmrr_is_relaxable(struct device *dev)
|
2023-09-05 15:31:04 +03:00
|
|
|
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;
|