Re: [REGRESSION] DMAR fault by Intel H97 SATA controller since "block: Increase BLK_DEF_MAX_SECTORS_CAP" (6.17-rc1)
From: Bart Van Assche
Date: Wed Nov 25 2026 - 13:30:09 EST
On 11/25/26 12:52 AM, Thorsten Leemhuis wrote:
For completeness, Šimon Pospíchal (now CCed) shared findings and a WIP
fix (both with the help of a LLM) meanwhile here:
https://lore.kernel.org/all/QISmXFlpPMgvFUKmdIBDwqn4JHHXt2NZeJzerMLHF_5icLo0lPKVlN0Ig9v8Vb52NmCeSFdyrao4x8KoN1DCXtDlnZS7eRIClC6vZyu-hPU%3D@xxxxxxxxxxxxxx/
Thanks Thorsten for having shared that link. The LLM I'm using doesn't
like that patch and came up with the patch shown below. Untested.
Bart.
Subject: [PATCH] iommu/vt-d: Disable superpages on Haswell with integrated graphics
Disable Intel VT-d superpages on bare-metal Haswell client systems when
integrated graphics (0000:00:02.0) is enabled and an active remapping
unit advertises superpage support (CAP.SLLPS).
Per the 4th Generation Intel Core Processor Family datasheets (document
328897, section 3.1.2), the integrated graphics VT-d engine does not
support super-pages and BIOS must disable super-pages in the default
VT-d engine when integrated graphics is enabled. Several Haswell BIOSes
leave CAP.SLLPS set on the default engine (dmar1). Whenever Linux installs
a 2 MiB or 1 GiB leaf entry (PS=1) on dmar1, hardware aborts DMA with
fault reason 0x0c ("non-zero reserved fields in PTE"), breaking VFIO
passthrough, discrete GPUs, audio, and AHCI storage (exposed by default
once BLK_DEF_MAX_SECTORS_CAP increased to 4 MiB in v6.17).
Prior to commit c376a3456d8b ("iommu/vt-d: Remove
domain_update_iommu_cap()"), domain_update_iommu_superpage() intersected
superpage support across all active IOMMUs, so the IGD unit (SLLPS=0)
masked off superpages on dmar1. After that commit, dmar1 domains started
honoring dmar1's advertised CAP.SLLPS.
Detect bare-metal Haswell client CPUs (INTEL_HASWELL, INTEL_HASWELL_L,
INTEL_HASWELL_G), verify that the Intel integrated graphics device at
0000:00:02.0 is present and not on an untrusted PCI link, and clear
intel_iommu_superpage during intel_iommu_init() before allocating any
paging domains if an active IOMMU advertises CAP.SLLPS.
Fixes: c376a3456d8b ("iommu/vt-d: Remove domain_update_iommu_cap()")
Reported-by: Tobias Laas <tobias.laas@xxxxxxxxx>
Closes: https://lore.kernel.org/linux-block/5ad27a97aafbc08a8702d5b90d09cd59@xxxxxxxxx/
Reported-by: Šimon Pospíchal <70sp@xxxxxxxxxxxxxx>
Closes: https://lore.kernel.org/r/HYhMd0Klo0XE_yiVY7XmsgyKKFDwKHfKRy22KrycLcYd0V_ykA4xdbBMJXkA07YX3os6qK-NhMIVi6ITo-CkNIIF0e-GcI0UwwZmdDhAJ0I=@protonmail.com
Cc: stable@xxxxxxxxxxxxxxx
---
drivers/iommu/intel/iommu.c | 53 +++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 5a2e705a2f2e..dd37aa25e287 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -24,6 +24,8 @@
#include <linux/tboot.h>
#include <uapi/linux/iommufd.h>
+#include <asm/cpu_device_id.h>
+
#include "iommu.h"
#include "../dma-iommu.h"
#include "../irq_remapping.h"
@@ -43,6 +45,7 @@
#define DEFAULT_DOMAIN_ADDRESS_WIDTH 57
+static void __init check_haswell_igfx_superpage(void);
static void __init check_tylersburg_isoch(void);
static int intel_iommu_set_dirty_tracking(struct iommu_domain *domain,
bool enable);
@@ -2762,6 +2765,7 @@ int __init intel_iommu_init(void)
pr_info("No SATC found\n");
init_no_remapping_devices();
+ check_haswell_igfx_superpage();
ret = init_dmars();
if (ret) {
@@ -4266,6 +4270,55 @@ static void __init check_tylersburg_isoch(void)
vtisochctrl);
}
+static const struct x86_cpu_id haswell_cpu_ids[] __initconst = {
+ X86_MATCH_VFM(INTEL_HASWELL, NULL),
+ X86_MATCH_VFM(INTEL_HASWELL_L, NULL),
+ X86_MATCH_VFM(INTEL_HASWELL_G, NULL),
+ {}
+};
+
+/*
+ * Per the 4th Generation Intel Core Processor Family datasheets (e.g.
+ * document 328897, section 3.1.2), the integrated graphics VT-d engine
+ * does not support super-pages and BIOS must disable super-pages in the
+ * default VT-d engine when integrated graphics is enabled. Some Haswell
+ * BIOSes leave CAP.SLLPS set on the default engine, causing fault reason
+ * 0x0c (non-zero reserved fields in PTE) when a 2 MiB or 1 GiB superpage
+ * mapping is used.
+ */
+static void __init check_haswell_igfx_superpage(void)
+{
+ struct dmar_drhd_unit *drhd;
+ struct intel_iommu *iommu;
+ struct pci_dev *pdev;
+
+ if (!intel_iommu_superpage)
+ return;
+
+ if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR) ||
+ !x86_match_cpu(haswell_cpu_ids))
+ return;
+
+ pdev = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(2, 0));
+ if (!pdev)
+ return;
+
+ if (pdev->vendor != PCI_VENDOR_ID_INTEL || !IS_GFX_DEVICE(pdev) ||
+ risky_device(pdev)) {
+ pci_dev_put(pdev);
+ return;
+ }
+ pci_dev_put(pdev);
+
+ for_each_active_iommu(iommu, drhd) {
+ if (cap_super_page_val(iommu->cap)) {
+ intel_iommu_superpage = 0;
+ pr_info("Disabling superpages on Haswell with integrated graphics\n");
+ break;
+ }
+ }
+}
+
/*
* Here we deal with a device TLB defect where device may inadvertently issue ATS
* invalidation completion before posted writes initiated with translated address