]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0010-allow-opt-in-to-allow-pass-through-on-broken-hardwar.patch
bump version to 6.2.16-19
[pve-kernel.git] / patches / kernel / 0010-allow-opt-in-to-allow-pass-through-on-broken-hardwar.patch
CommitLineData
8ff596f2 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
1acfcad2 2From: kiler129 <grzegorz@noflash.pl>
8ff596f2
TL
3Date: Mon, 18 Sep 2023 15:19:26 +0200
4Subject: [PATCH] allow opt-in to allow pass-through on broken hardware..
1acfcad2
FG
5
6adapted from https://github.com/kiler129/relax-intel-rmrr , licensed under MIT or GPL 2.0+
8ff596f2
TL
7---
8 drivers/iommu/intel/iommu.c | 6 +++++-
9 1 file changed, 5 insertions(+), 1 deletion(-)
1acfcad2 10
8ff596f2
TL
11diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
12index 1c5ba4dbfe78..887667218e3b 100644
1acfcad2
FG
13--- a/drivers/iommu/intel/iommu.c
14+++ b/drivers/iommu/intel/iommu.c
8ff596f2 15@@ -297,6 +297,7 @@ static int dmar_map_gfx = 1;
1acfcad2
FG
16 static int dmar_map_ipu = 1;
17 static int intel_iommu_superpage = 1;
18 static int iommu_identity_mapping;
19+static int intel_relaxable_rmrr = 0;
20 static int iommu_skip_te_disable;
21
22 #define IDENTMAP_GFX 2
8ff596f2 23@@ -358,6 +359,9 @@ static int __init intel_iommu_setup(char *str)
1acfcad2
FG
24 } else if (!strncmp(str, "tboot_noforce", 13)) {
25 pr_info("Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n");
26 intel_iommu_tboot_noforce = 1;
27+ } else if (!strncmp(str, "relax_rmrr", 10)) {
28+ pr_info("Intel-IOMMU: assuming all RMRRs are relaxable. This can lead to instability or data loss\n");
29+ intel_relaxable_rmrr = 1;
30 } else {
31 pr_notice("Unknown option - '%s'\n", str);
32 }
8ff596f2 33@@ -2538,7 +2542,7 @@ static bool device_rmrr_is_relaxable(struct device *dev)
1acfcad2
FG
34 return false;
35
36 pdev = to_pci_dev(dev);
37- if (IS_USB_DEVICE(pdev) || IS_GFX_DEVICE(pdev))
38+ if (intel_relaxable_rmrr || IS_USB_DEVICE(pdev) || IS_GFX_DEVICE(pdev))
39 return true;
40 else
41 return false;