* [pve-devel] [PATCH pve-kernel/master 1/2] fix #5926: cherry-pick ACS-quirk fix from linux-stable/6.11.7
2024-11-26 16:36 [pve-devel] [PATCH pve-kernel/master 0/2] fix two small issues with IOMMU in certain setups Stoiko Ivanov
@ 2024-11-26 16:36 ` Stoiko Ivanov
2024-11-26 16:36 ` [pve-devel] [PATCH pve-kernel/master 2/2] revert Ubuntu patch disabling IOMMU functionality for Skylake iGPU Stoiko Ivanov
2024-11-27 19:24 ` [pve-devel] applied: [PATCH pve-kernel/master 0/2] fix two small issues with IOMMU in certain setups Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Stoiko Ivanov @ 2024-11-26 16:36 UTC (permalink / raw)
To: pve-devel
the latest linux-stable pull I found in ubuntu-oracular was for 6.11.5
- this fix here seems targeted enough. see also the discussion
upstream:
https://lore.kernel.org/all/20241029163317.GA216411@nvidia.com/
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
...nable_acs-support-for-the-ACS-quirks.patch | 68 +++++++++++++++++++
1 file changed, 68 insertions(+)
create mode 100644 patches/kernel/0016-PCI-Fix-pci_enable_acs-support-for-the-ACS-quirks.patch
diff --git a/patches/kernel/0016-PCI-Fix-pci_enable_acs-support-for-the-ACS-quirks.patch b/patches/kernel/0016-PCI-Fix-pci_enable_acs-support-for-the-ACS-quirks.patch
new file mode 100644
index 000000000000..81123616f983
--- /dev/null
+++ b/patches/kernel/0016-PCI-Fix-pci_enable_acs-support-for-the-ACS-quirks.patch
@@ -0,0 +1,68 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jason Gunthorpe <jgg@nvidia.com>
+Date: Wed, 16 Oct 2024 20:52:33 -0300
+Subject: [PATCH] PCI: Fix pci_enable_acs() support for the ACS quirks
+
+[ Upstream commit f3c3ccc4fe49dbc560b01d16bebd1b116c46c2b4 ]
+
+There are ACS quirks that hijack the normal ACS processing and deliver to
+to special quirk code. The enable path needs to call
+pci_dev_specific_enable_acs() and then pci_dev_specific_acs_enabled() will
+report the hidden ACS state controlled by the quirk.
+
+The recent rework got this out of order and we should try to call
+pci_dev_specific_enable_acs() regardless of any actual ACS support in the
+device.
+
+As before command line parameters that effect standard PCI ACS don't
+interact with the quirk versions, including the new config_acs= option.
+
+Link: https://lore.kernel.org/r/0-v1-f96b686c625b+124-pci_acs_quirk_fix_jgg@nvidia.com
+Fixes: 47c8846a49ba ("PCI: Extend ACS configurability")
+Reported-by: Jiri Slaby <jirislaby@kernel.org>
+Closes: https://lore.kernel.org/all/e89107da-ac99-4d3a-9527-a4df9986e120@kernel.org
+Closes: https://bugzilla.suse.com/show_bug.cgi?id=1229019
+Tested-by: Steffen Dirkwinkel <me@steffen.cc>
+Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+(cherry picked from commit 8803132f857d1959f99c6ef98cf74776a52987e4)
+Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
+---
+ drivers/pci/pci.c | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
+index ffaaca0978cbc..a89436d481f07 100644
+--- a/drivers/pci/pci.c
++++ b/drivers/pci/pci.c
+@@ -1067,8 +1067,15 @@ static void pci_std_enable_acs(struct pci_dev *dev, struct pci_acs *caps)
+ static void pci_enable_acs(struct pci_dev *dev)
+ {
+ struct pci_acs caps;
++ bool enable_acs = false;
+ int pos;
+
++ /* If an iommu is present we start with kernel default caps */
++ if (pci_acs_enable) {
++ if (pci_dev_specific_enable_acs(dev))
++ enable_acs = true;
++ }
++
+ pos = dev->acs_cap;
+ if (!pos)
+ return;
+@@ -1077,11 +1084,8 @@ static void pci_enable_acs(struct pci_dev *dev)
+ pci_read_config_word(dev, pos + PCI_ACS_CTRL, &caps.ctrl);
+ caps.fw_ctrl = caps.ctrl;
+
+- /* If an iommu is present we start with kernel default caps */
+- if (pci_acs_enable) {
+- if (pci_dev_specific_enable_acs(dev))
+- pci_std_enable_acs(dev, &caps);
+- }
++ if (enable_acs)
++ pci_std_enable_acs(dev, &caps);
+
+ /*
+ * Always apply caps from the command line, even if there is no iommu.
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] [PATCH pve-kernel/master 2/2] revert Ubuntu patch disabling IOMMU functionality for Skylake iGPU
2024-11-26 16:36 [pve-devel] [PATCH pve-kernel/master 0/2] fix two small issues with IOMMU in certain setups Stoiko Ivanov
2024-11-26 16:36 ` [pve-devel] [PATCH pve-kernel/master 1/2] fix #5926: cherry-pick ACS-quirk fix from linux-stable/6.11.7 Stoiko Ivanov
@ 2024-11-26 16:36 ` Stoiko Ivanov
2024-11-27 19:24 ` [pve-devel] applied: [PATCH pve-kernel/master 0/2] fix two small issues with IOMMU in certain setups Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Stoiko Ivanov @ 2024-11-26 16:36 UTC (permalink / raw)
To: pve-devel
This change breaks passthrough of the iGPU on older Intel Plattforms
(Skylake)
https://forum.proxmox.com/threads/.157266
The patch was orignally applied by Ubuntu upstream for an issue
unrelated to passthrough - flickering of the display with these chips,
where some comments suggest that setting intel_iommu=igfx_off does not
fix the issue, while the patch explicitly says it does the same as
setting intel_iommu=igfx_off - my quick glance at the code agrees with
the patch author, with the downside that with the patch you cannot
enable it again via kernel_cmdline.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2062951
As this is a regression, and our user-base does not seem to have
encountered the issue with flickering displays simply revert the
change for now. A proper fix seems to be in the makings in linux
upstream (according to the launchpad issue)
I tested this on an old machine we had lying around - reverting the
patch suppressed the message:
pci 0000:00:02.0: DMAR: Disabling IOMMU for graphics on this chipset
(also did not notice any flickering in a short graphic session
(wayland+kde)).
I'd suggest pulling this also into our 6.8 kernel (but this can also happen
after we get some feedback that it indeed fixes the issue of the
reporters in the forum)
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
...UCE-iommu-intel-disable-DMAR-for-SKL.patch | 53 +++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 patches/kernel/0017-Revert-UBUNTU-SAUCE-iommu-intel-disable-DMAR-for-SKL.patch
diff --git a/patches/kernel/0017-Revert-UBUNTU-SAUCE-iommu-intel-disable-DMAR-for-SKL.patch b/patches/kernel/0017-Revert-UBUNTU-SAUCE-iommu-intel-disable-DMAR-for-SKL.patch
new file mode 100644
index 000000000000..2c1a265d0d59
--- /dev/null
+++ b/patches/kernel/0017-Revert-UBUNTU-SAUCE-iommu-intel-disable-DMAR-for-SKL.patch
@@ -0,0 +1,53 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Stoiko Ivanov <s.ivanov@proxmox.com>
+Date: Mon, 25 Nov 2024 11:10:35 +0100
+Subject: [PATCH] Revert "UBUNTU: SAUCE: iommu/intel: disable DMAR for SKL
+ integrated gfx"
+
+Some of our users use the iGPU for PCI-passthrough on those
+plattforms, which seems broken with this commit added.
+https://forum.proxmox.com/threads/.157266
+
+This reverts commit b310f5f58c83756fc164f7d391d76f0df9cc65c3.
+---
+ drivers/iommu/intel/iommu.c | 27 ---------------------------
+ 1 file changed, 27 deletions(-)
+
+diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
+index 34c8b02ca7878..a27cbc22148fa 100644
+--- a/drivers/iommu/intel/iommu.c
++++ b/drivers/iommu/intel/iommu.c
+@@ -4766,33 +4766,6 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1632, quirk_iommu_igfx);
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x163A, quirk_iommu_igfx);
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x163D, quirk_iommu_igfx);
+
+-/* SKL */
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1906, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1913, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x190E, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1915, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1902, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x190A, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x190B, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1917, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1916, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1921, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x191E, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1912, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x191A, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x191B, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x191D, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1923, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1926, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1927, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x192A, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x192B, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x192D, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1932, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x193A, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x193B, quirk_iommu_igfx);
+-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x193D, quirk_iommu_igfx);
+-
+ /* disable IPU dmar support */
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_iommu_ipu);
+
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread