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
|
2024-04-02 19:14:21 +03:00
|
|
|
index a788062820df..4020c5336369 100644
|
2023-09-05 15:31:04 +03:00
|
|
|
--- a/drivers/iommu/intel/iommu.c
|
|
|
|
+++ b/drivers/iommu/intel/iommu.c
|
2024-04-02 19:14:21 +03:00
|
|
|
@@ -159,6 +159,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
|
2024-04-02 19:14:21 +03:00
|
|
|
@@ -221,6 +222,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);
|
|
|
|
}
|
2024-04-02 19:14:21 +03:00
|
|
|
@@ -2395,7 +2399,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;
|