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