From mboxrd@z Thu Jan 1 00:00:00 1970 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=1796393143; b=qEdWowCzNOXxYnshYG53QvTX+aHKT6kty0Zcnyq2rLzJpd+QHj5RJlqpiGWK5S7zSsR4 jgRkbc5oF081ubX/Op07hG+85RX+95JvcUZl4UhlnpHB+Kmqu1XTpt/H0ht9298fNWZ+6 FG7zLERw0MiGyyBb1hZVV1mHWGZs7Z0d1XHHMlnlr8zf3qwhCpXnr1+JoRySC1GbJA74N V1Ur1FHZuX16FjiY5ig6N+SiSS23mSOpVT67PRyy1sqdCJhB686EAettDnX4HKdlRxjk7 nHvxp/8IXuQ0TeFK9w3I4acWmPxM8xFevp1Q79AO6NjRY1UDOP+iUSh7l/e6bd1GXcw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796393143; 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=f7OepcHcBr9v1OBFxzC/dfrqrDrHVYYuPfPPHQnXHfL+bRqHw608h32UJUznyiLuf1uB 09i3uMdEOKdRBjSl409m7RKrgbZGXDxs6+ry5S6QNeCVFg4xgm13Yzr87xU8fIcOO4I5w 4Z7TIGb/WkvCRJE2ttS5PSu1NsqaouIE+e1hvqEdwdpAzxU8N9t4MksRjckCkXflWk3+a rCnR1KK6EXkb5vF9yhb/QWPiOiF5JF11iY7rJBbOpN17dqTFwQNO0CjQOOvrs7WTbWiAs f4QsO2bAuw9w64dCYSKW2XM7vomrWQOeNjBj7jZ3VdRoExRVX7hDoWD+9eC/sdWLKBg== 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=eWNIQJ3z; 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 40096606A322 for ; Fri, 4 Dec 2026 14:05:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 40096606A322 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=eWNIQJ3z; 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=1796393142; 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=eWNIQJ3z1SfN1u8XRE1SXXrHe4qU3i8EiCF/gFCIYE9wltgW3cTgNQF8fyViEafxv/4mRL GwUfOSlEJqw9tPc3rCHD3vaJzux4VeN1PhTqKs17oAw2IimtA0yi1nBaPNFXbP+5jQoNYc A83re5JL1gHSyXH8ZpokYm/kMgmCwsk= Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-81-4u-fO1CSOlqQ6xpqh_oHWA-1; Fri, 4 Dec 2026 14:05:38 +0000 X-MC-Unique: 4u-fO1CSOlqQ6xpqh_oHWA-1 X-Mimecast-MFC-AGG-ID: 4u-fO1CSOlqQ6xpqh_oHWA_1796393137 Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2f0717e54b0so10164415ad.0 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=uwdKOqGSLOclzlJMUoBW4epDbOxa6ud8QILUqHGmzYkkELlDqyrJDYw7w6bDNUI3Ls i4Vh+dGUMQDDp2mSpRzM3KJucrVbnyfNq/r0qAIsWEXHsQ5g+4RjRK38qKEDZkwK7dIu LVeoM8TxI8vt5dSqj4QR/6baWEPV4UdUJNGefrIO3R6ZudtJhxDXct9bsfL0EaVvv4yj Oj5WfKRbxFt1GKqJ91x4tPujehKgRlOt4MpC1Xiyz8zzYrj72nbmu6kgaw7aJZ8HETFD pYbtLE7cTat2NniaZtb+9+9bkU+azTV6TGUWexGTX56iaGowVMF6msRCN7Z3/1Q1924G gc2Q== X-Forwarded-Encrypted: i=1; AL+hErEnCsTo7OMP3jfzyZ/3eo0jaAeCzEgun2oAM1sPv0wmcvIIIdmZhuasH+9PjleYxYwSDNmCW5v2ZrLFc48=@vger.kernel.org X-Gm-Message-State: AB4q+uHjuALU7EDekFCVt3seNi3lSf0TiGi49PsTQToCFVK4Z7mBMDqc aTBk7b62s4VeDY2b+mm5H/HHQjFb46jz9CeFHuTYbzuKXxLWtLQ71ZZhgqe98cQLByCY5papCNO 74L2EnZ95DQuYtaxGQUIbtWPizP0UtAfrAV5tV2r8E/uCTk0miTWddf8tfF4w7TyJwA== X-Gm-Gg: AZFdTZfm1UROcAqomVxy32SwoenCwvyDPh5/WzMaDstKJ6D88buMvZNCqsqvEkhXOJG dr1qI8pCG6WU0wk+qdDnTJp7J8Gv7K01S8DCjKDuhGus9QQGdfnvdng7cYNWkXLpYeTfRD45DYw iAYtyMgEfeXWW8S6KGiRPUAvnfpozxdQ5ehOQa6WO6D3BwqyrMihiztHn6tqwz4co+yS9Rzw7Tq ZATN1mEuLb2HaKct5gby+T+T0chXmS8Ky/QUlwEMOdRJtAqX77NEGmSaRMBptEux2DG2xuH8lWT JLyeWhnmT4j3aUKo57i6R22FlMHrsA2zY4kuvotQWJQHcWCewtoRyPjbo0V0lvCVXQq/gAUcOAH UPxtLz6aWyBUCv1yjM5eqyrVcNTKwSPXtcKNQA+rLgCZZxPriIDGlPN+6NgUFnRH8TOcfLYkPwW UCC5H/V59D4HVgWoz6JSGGJDDn/6RvlNj620bsZWoSfYIrxF2lgWzBMicasrx5tivvTLmYHH4= X-Received: by 2002:a17:902:c409:b0:2f1:70a4:7ce with SMTP id d9443c01a7336-2f1ba1f17a9mr20134425ad.48.1796393137265; 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-kernel@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