Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796393142; b=zX8sCLTE7HuEUuhHLxW0iJ52DhGIrUTaKEz9SiTf7uxR+VxvYVpl0QISw4eNFXBISPWj FzxrlRA0IlEm26WAKCvSUbeaTDfyURt21fQp0IS+P6PfqlOOD6ZEk0UWMZA5fhQ/276NH 3AlOfN5rR8af+lz4Zci0n6otUPPRF9beBRuNOy2cF86m6BeomHDFSwRvTNXPJDKiWFC4x rlo3pQW0LZWhmwuEWp5qAHNfwHfFhEqP24E5j1WB/zvdmZGSljdmfC3TjoQO/BvQFisQk rha9Km6lmZXQ+RERkjCJFyMMJZA9ICO0JhHaAMZLl3tqYpe7zZ+H3MzMRxgUPcytw0g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796393142; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received: X-Received:Received:Message-ID:Subject:From:To:Cc:Date:In-Reply-To: References:Content-Type:Content-Transfer-Encoding:User-Agent: MIME-Version; bh=/dZzOZZHXjgpm/NxX/vth0jWmDCwcNIlvOcen25n0h4=; b=Jr1/Qm2b4N+RrZ5pL1YvMYj/cNnMf/Hl6v06AZ/e9E9mF9doOjL9fK5X1EA0vcpAQPxy 5+Ir97r04MMru6keInh8mEw8Ez+mw4bKUbaM3dJSxWNiTgxBvFjVbar/5ojrLJ3GpwKyS 1GvLFdeLZWKzmeTaoPO2quRmJ0+moGXPX5BKsY9Gd6XHY9YQbKy3BdNfMEBBHYfomikVU 53p9jLRHQ9BEGT6tzq2HwOL8FIFInnnBx2ZVmDr5nfBH/lxZ4NfmtNjx423mnDeUOTz0y C5QwVrIZ8SGUA7nIbqbksMQ6V6gqdYW4Mo5EXOR6Z2bWWWjiuabF5uQT5o1PIXHgcGA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ie9yEWdu; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=HzbCf4NM; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70EFA606A32C for ; Fri, 4 Dec 2026 14:05:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 70EFA606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ie9yEWdu; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=HzbCf4NM DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796393140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/dZzOZZHXjgpm/NxX/vth0jWmDCwcNIlvOcen25n0h4=; b=ie9yEWduU42H8kB+shrOmbLgjvsePVrXowv6OdNmliAyu8fhYqY2SuPiDTgovp/zL9eqjH 9Dpz4KcnpY2scNJwGYbmz3JiGyhdg30qDKqt8fjoX5t9XeZvxVTTQ5ValtEnukSHpcCqCZ aGNQq31G8YsTTMTSb3xmGLTKdgY9Lho= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-179-W0DezsrhP9OdvHLIkDQB-w-1; Fri, 4 Dec 2026 14:05:38 +0000 X-MC-Unique: W0DezsrhP9OdvHLIkDQB-w-1 X-Mimecast-MFC-AGG-ID: W0DezsrhP9OdvHLIkDQB-w_1796393137 Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2f08196b148so9771145ad.1 for ; Fri, 04 Dec 2026 06:05:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796393137; x=1796997937; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to:content-type; bh=/dZzOZZHXjgpm/NxX/vth0jWmDCwcNIlvOcen25n0h4=; b=HzbCf4NMUEx7dO1G+yWezY/0ns28Yzg7Eic4wHJogaoYns+1B0Z3Dyq2rQMm0vuEsB Sczzv3l2rMSP/yOEAKhMhc8avpGhXMnmwdAgmyZfTsAJIkgd9oSpsaRttX7GSSGf65xM GcDcLbaIHTaONQNakQECt3aliG6pXGMeggEJf7pLxN+RBJphHIiAx40PrdU03piUoUcb /zMZOV6Ss3WPnaUzlo7hEIfNcQfkK5eAE2vkd9uZ0L9HKdm+syQ61jaeiJdzYGJl0i95 mgHkBPTGdpoZLlYy0cmqzAy/tP3mOB6TwNF9AHAbOejH/NYurPkKg4D4OJDKMOCcwxXM ol0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796393137; x=1796997937; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/dZzOZZHXjgpm/NxX/vth0jWmDCwcNIlvOcen25n0h4=; b=IRztJ5dQpkmwUXALakF+1ORi/flgbbfxqSeLks1M9U94akiPmActCNK/WekaRAqaae 9UTadcnnnjTH0cTLecp8huTdX2oUuJwOocDfQlSOkCMMYQkO21ydvTKFqM6BNLJxORZk Csl+rQGABzbXhhiJ1E/lj+3F4FG3UQktZhE6FYSxMZXo2tp89JHdARWYCyx1gkRcg7f8 sA3BxW52xkcXMaHr6WpHqw/qX7wHmwIudLugkmSchwZzYG4cnzTqPayfEXApCUwaPDyN fShj+3r76OAs71Z09uns2b4T6OqZIw42aOLuxni2Wd6ImYLM1GR4BswQoVbT7Xw2cdTx pEog== X-Forwarded-Encrypted: i=1; AL+hErEiM9IdhZmFW7WW19mW5kIHfx9HVSfSsv+CM8Q+H/agV9j6+toZGcDq/mGNcsGxA87Px9L/J/sEry4=@vger.kernel.org X-Gm-Message-State: AB4q+uENfHRbXow6i2GTxO2HQEHlIrw037sg5NYb526sHtb2cpR7Yjyo oVHNtbOCxwN9298pLtLUosk+9HBALTmlLmjxK55V9SZUFgoJ3AbEq7ATBJL3w5XFeicNbfxtuUw aOK2PU2WoqTzmVvFGi4Ny7XPaZG1M2pCZf/JWIT0hjBFqZLkkNMupli8SrcuvJBCoLLh3vw== X-Gm-Gg: AZFdTZcKXyOF+4y5I3kxoWl3TMcHFCzJdHu92R1LYGoIRvNbZ41ks/BLKEHC85I+YlT 4xLIFanumL1rTJsgfzplJtkGuTb/yR+va8GpbDy4RcfLjUYC2sBQHiFqrRX7jeCHoBwqxzr1Qb6 DZ81PrgKIQWvyxwzyDPpTpuImh+zIpbt7U1usbOD7eBFqp+in2F3AGWEmWPQ3oMy/vUglpDdEOp 7rN/mh0gkxn+ZPOd+d8UPtqP8QFfZpDJ3jRLWfElTcrxw/GWwb/CfXmJKqyqkUbEgsw7MNGvuRO 1YNGKqfmyHrK6eHRhpAqyWatIMgnaDiiTjb+bgCTH8I4H/wVH5PfXsLLdsvQi6EmKo30PfvyPl9 nRKNdTteQ5SPxm8eYv+9qxWm8iNNf+7LPRvWUb0iV+SPV7Kbe8i5zH9ciKOowfUbWPnWHm2qsj+ vck5WBSJkEFlUxNx2kWiKG+vhOGaGLkbRSw+12XZ3WbuW56csD6yXkXJzvsAB1AUZUwKFHNCk= X-Received: by 2002:a17:902:c409:b0:2f1:70a4:7ce with SMTP id d9443c01a7336-2f1ba1f17a9mr20134475ad.48.1796393137272; Fri, 04 Dec 2026 06:05:37 -0800 (PST) X-Received: by 2002:a17:902:c409:b0:2f1:70a4:7ce with SMTP id d9443c01a7336-2f1ba1f17a9mr20133985ad.48.1796393136701; Fri, 04 Dec 2026 06:05:36 -0800 (PST) Received: from loberman-thinkpadp16gen3.rmtusma.csb ([2600:6c65:2440:d8c:aa2b:ddff:fe88:da74]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f1b791d292sm12396255ad.38.2026.12.04.06.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 06:05:35 -0800 (PST) Message-ID: <988593f8f1fd0936d145895ed06b2de34f63225c.camel@redhat.com> Subject: Re: [REGRESSION] DMAR fault by Intel H97 SATA controller since "block: Increase BLK_DEF_MAX_SECTORS_CAP" (6.17-rc1) From: Laurence Oberman To: Bart Van Assche , 70sp <70sp@protonmail.com> Cc: Lu Baolu , Jason Gunthorpe , Joerg Roedel , Thorsten Leemhuis , Tobias Laas , Damien Le Moal , Jens Axboe , regressions@lists.linux.dev, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, David Woodhouse , Will Deacon , Niklas Cassel Date: Fri, 04 Dec 2026 09:05:28 -0500 In-Reply-To: <0318408a-20b8-4237-85b2-e522883f5436@acm.org> References: <5ad27a97aafbc08a8702d5b90d09cd59@posteo.de> <87b1bbd8-8113-4890-8623-738b19a9cc7b@leemhuis.info> <2adaf0ef9e1a2fa18590f7d8dbf203c0f7de2be7.camel@redhat.com> <0edb9525-5068-42e6-b6c3-a1dcebcbcea7@acm.org> <0318408a-20b8-4237-85b2-e522883f5436@acm.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.2 (3.60.2-3.fc44) X-Mailing-List: linux-ide@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 On Fri, 2026-11-27 at 07:56 -0800, Bart Van Assche wrote: > On 11/27/26 5:57 AM, 70sp wrote: > > I have taken a look at the patches and the entire problem much more > > in depth, and there probably isn't a significantly better variant > > to > > do this. > >=20 > > 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. > >=20 > > 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. > >=20 > > I was told to repost my patch formally by Lu Baolu ( https:// > > lore.kernel.org/regressions/d931a389-c143-4a6a-931c- > > bc7025bcefb9@linux.intel.com/ ), probably because it fixes at least > > my case. > >=20 > > I think we should wait for confirmation from Tobias and if it's > > positive, we can send out the final patch closing both cases. > My LLM came up with the (entirely untested) patch below after I asked > it to generalize an earlier patch: >=20 > Subject: [PATCH] iommu/vt-d: Disable superpages when legacy IGD > engine=20 > lacks them >=20 > 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 =3D=3D 0 while an > active remapping unit advertises superpage support. >=20 > 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=3D1) 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). >=20 > 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=3D0) > masked off superpages on dmar1. After that commit, dmar1 domains > started > honoring dmar1's advertised CAP.SLLPS. >=20 > 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 =3D=3D 0) without > superpage support (CAP.SLLPS =3D=3D 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. >=20 > Fixes: c376a3456d8b ("iommu/vt-d: Remove domain_update_iommu_cap()") > Reported-by: Tobias Laas > Closes:=20 > https://lore.kernel.org/linux-block/5ad27a97aafbc08a8702d5b90d09cd59@post= eo.de/ > Reported-by: =C5=A0imon Posp=C3=ADchal <70sp@protonmail.com> > Closes:=20 > https://lore.kernel.org/r/HYhMd0Klo0XE_yiVY7XmsgyKKFDwKHfKRy22KrycLcYd0V_= ykA4xdbBMJXkA07YX3os6qK-NhMIVi6ITo-CkNIIF0e-GcI0UwwZmdDhAJ0I=3D@protonmail.= com > Cc: stable@vger.kernel.org > --- > =C2=A0 drivers/iommu/intel/iommu.c | 48 > +++++++++++++++++++++++++++++++++++++ > =C2=A0 1 file changed, 48 insertions(+) >=20 > 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 @@ >=20 > =C2=A0 #define DEFAULT_DOMAIN_ADDRESS_WIDTH 57 >=20 > +static void __init check_igfx_superpage(void); > =C2=A0 static void __init check_tylersburg_isoch(void); > =C2=A0 static int intel_iommu_set_dirty_tracking(struct iommu_domain > *domain, > =C2=A0=C2=A0 =C2=A0 bool enable); > @@ -2762,6 +2763,7 @@ int __init intel_iommu_init(void) > =C2=A0=C2=A0 pr_info("No SATC found\n"); >=20 > =C2=A0=C2=A0 init_no_remapping_devices(); > + check_igfx_superpage(); >=20 > =C2=A0=C2=A0 ret =3D init_dmars(); > =C2=A0=C2=A0 if (ret) { > @@ -4266,6 +4268,52 @@ static void __init > check_tylersburg_isoch(void) > =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 vtisochctrl); > =C2=A0 } >=20 > +/* > + * Per Intel Core processor datasheets (e.g. document 328897, > section=20 > 3.1.2), > + * when the integrated graphics VT-d engine does not support super- > pages > + * (CAP.SLLPS =3D=3D 0), BIOS must disable super-pages in the default > VT-d=20 > engine > + * while integrated graphics is enabled. Some BIOSes leave CAP.SLLPS > set on > + * the default engine, causing fault reason 0x0c (non-zero reserved=20 > 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 || > + =C2=A0=C2=A0=C2=A0 cpu_feature_enabled(X86_FEATURE_HYPERVISOR)) > + return; > + > + pdev =3D pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(2, 0)); > + if (!pdev) > + return; > + > + if (pdev->vendor !=3D PCI_VENDOR_ID_INTEL || > !IS_GFX_DEVICE(pdev) || > + =C2=A0=C2=A0=C2=A0 risky_device(pdev)) { > + pci_dev_put(pdev); > + return; > + } > + > + igfx_drhd =3D 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) || > + =C2=A0=C2=A0=C2=A0 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 =3D 0; > + pr_info("Disabling superpages because > integrated graphics VT-d=20 > engine lacks superpage support\n"); > + break; > + } > + } > +} > + > =C2=A0 /* > =C2=A0=C2=A0 * Here we deal with a device TLB defect where device may=20 > inadvertently issue ATS > =C2=A0=C2=A0 * invalidation completion before posted writes initiated wit= h=20 > translated address >=20 >=20 >=20 Hi Bart, Tested-by: Laurence Oberman Tested your generalized version (check_igfx_superpage) on v7.4-rc5 on a non-affected platform, to check it does not misfire: Coffee Lake i7-8700, Cannon Lake PCH AHCI, intel_iommu=3Don. dmar0 (igfx): cap 1c0000c40660462 ecap 19e2ff0505e (SLLPS =3D 2M|1G) dmar1: cap d2008c40660462 ecap f050da (SLLPS =3D 2M|1G) As expected, the quirk does not trigger (the igfx DRHD reports superpage support, so it returns early). Superpages remain in use: domain_translation_struct shows 2 MiB leaf PDEs (e.g. 0x0000000136a00082) during 2M O_DIRECT reads from hugepage-backed buffers against a SATA SSD, with no DMAR or ATA errors. I don't have affected hardware, so Tobias's results (iGPU enabled and disabled) are what confirm the fix itself. Regards, Laurence