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: Fri Nov 27 2026 - 10:56:33 EST
On 11/27/26 5:57 AM, 70sp wrote:
I have taken a look at the patches and the entire problem much moreMy LLM came up with the (entirely untested) patch below after I asked
in depth, and there probably isn't a significantly better variant to
do this.
In the state before the regression, the kernel was assigning smaller
page sizes for some cases, so it wasn't ideal as I thought. I also
haven't found a better place for the quirk to belong as there are
already exemptions for specific platforms in the code (I thought
there weren't). This one is probably fine.
I am sorry to Bart and Laurence who had to handle this. I thought my
patch was bad, so I thought the same about Barts, but it looks like
it's the correct way to approach it.
I was told to repost my patch formally by Lu Baolu ( https://
lore.kernel.org/regressions/d931a389-c143-4a6a-931c-
bc7025bcefb9@xxxxxxxxxxxxxxx/ ), probably because it fixes at least
my case.
I think we should wait for confirmation from Tobias and if it's
positive, we can send out the final patch closing both cases.
it to generalize an earlier patch:
Subject: [PATCH] iommu/vt-d: Disable superpages when legacy IGD engine lacks them
Disable Intel VT-d superpages on bare-metal systems when the Intel
integrated graphics device (0000:00:02.0) is behind a dedicated legacy
(non-scalable-mode) VT-d engine that reports CAP.SLLPS == 0 while an
active remapping unit advertises superpage support.
Per Intel Core processor datasheets (e.g. document 328897, section 3.1.2
for 4th Generation Core / Haswell), the integrated graphics VT-d engine
does not support super-pages and BIOS must disable super-pages in the
default VT-d engine while integrated graphics is enabled. Several 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.
Check the hardware capability directly instead of matching hardcoded CPU
model IDs. During intel_iommu_init(), look up the Intel integrated
graphics device at 0000:00:02.0, find its matched non-INCLUDE_ALL DRHD
unit, and clear intel_iommu_superpage before allocating any paging
domains if that unit is a legacy engine (ECAP.SMTS == 0) without
superpage support (CAP.SLLPS == 0) while an active IOMMU advertises
CAP.SLLPS. Skip virtualized guests, untrusted PCI devices, systems
without integrated graphics, and newer generations whose IGD VT-d engine
supports superpages or scalable mode.
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 | 48 +++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 5a2e705a2f2e..d2c03bec22e9 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -43,6 +43,7 @@
#define DEFAULT_DOMAIN_ADDRESS_WIDTH 57
+static void __init check_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 +2763,7 @@ int __init intel_iommu_init(void)
pr_info("No SATC found\n");
init_no_remapping_devices();
+ check_igfx_superpage();
ret = init_dmars();
if (ret) {
@@ -4266,6 +4268,52 @@ static void __init check_tylersburg_isoch(void)
vtisochctrl);
}
+/*
+ * Per Intel Core processor datasheets (e.g. document 328897, section 3.1.2),
+ * when the integrated graphics VT-d engine does not support super-pages
+ * (CAP.SLLPS == 0), BIOS must disable super-pages in the default VT-d engine
+ * while integrated graphics is enabled. Some 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_igfx_superpage(void)
+{
+ struct dmar_drhd_unit *drhd, *igfx_drhd;
+ struct intel_iommu *iommu;
+ struct pci_dev *pdev;
+
+ if (!intel_iommu_superpage ||
+ cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
+ 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;
+ }
+
+ igfx_drhd = dmar_find_matched_drhd_unit(pdev);
+ pci_dev_put(pdev);
+ if (!igfx_drhd || !igfx_drhd->iommu || igfx_drhd->include_all)
+ return;
+
+ if (ecap_smts(igfx_drhd->iommu->ecap) ||
+ cap_super_page_val(igfx_drhd->iommu->cap))
+ return;
+
+ for_each_active_iommu(iommu, drhd) {
+ if (cap_super_page_val(iommu->cap)) {
+ intel_iommu_superpage = 0;
+ pr_info("Disabling superpages because integrated graphics VT-d engine lacks superpage support\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