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=1795634767; b=ka6LmTvCFVtJm2YlJkNd8tfUtJZb3qgkcJJFwYtZd8SKXTy1K+0Wb+Kw+nABhSExJ3ca mB88IWvxe+N41DtBSCVT0LBXP1Ar7hUeBSvJWB9ygTszgtye1sFesLkaP33Sgw8gcamDh g3SD7AGqLg0DdeLQVK+taxdiQmUbNMB2K+BeE4YKQ/RhzsjfNZlyCaLV8ciAsWlZUf4PD okzhwWfaoHImqfz8IR6+Vx8t4tLmuEAB1bsjBbQl0/Zuncso9XMw85tjBGbr0dq4pvnF0 MHg/IKPqoqDIsRyI+0/lOhTtSGFb4xhEXe19kgXRphWqN60foaz7P0z40++ZvlE3yIg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795634767; 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=v6NmbSBdWpSm2uVrOp8tpZ65xhznrbrVh6qn8OyPhJ8=; b=SEB2CX/6XppRlCEfaS43LizWL20/TVC9p7/gnfZeze1hLZGNIUGnWOf/rA+K82YJOjPN u8ptZQ1XMVfi0t7XUvU0Ph/XfYhOzkEjYzBJh4I/uioihiNwp9RWVPsRjew6VHW7q9JK/ JtLDn0VVvEaoj81dHtOW3K6kgEhvI8Zz54DVTY64mKBKrC71CQlN54wimgYZ+cFEqTCzw WTBF6PNVlrmZtzlA1tnxrlYFJeUxo1nXWpYv7X+X8wGwtwS+Wjn2ixvFGzc9M5bEtGajO gFiwqzKLcaV4yegYirp+lgiFtb7ds/RkI+PQFuJIpUbKSOCSmnqiGrQCG5NM/lDXWwg== 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=O+VUfJBu; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=h05KInbD; 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 8105A606A326 for ; Wed, 25 Nov 2026 19:26:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8105A606A326 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=O+VUfJBu; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=h05KInbD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795634765; 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=v6NmbSBdWpSm2uVrOp8tpZ65xhznrbrVh6qn8OyPhJ8=; b=O+VUfJBuUwvfCTh6UMFrjpPdFelDUWFhfNRQrnQDvTRgdFV5i4JOlyugv/ls/77E1ZNloZ fxMe8v5LQWA//MDvIl7oR1a+cnowRAjsCwF81GJpD8wVthmBs8+KKqabfqEpFuG08/Xycx UVqd/isMtyXcQiZpYbXdpntUWdZVpfg= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-157-WHsfp2A1Pn6PTo9zhaK6Cg-1; Wed, 25 Nov 2026 19:26:03 +0000 X-MC-Unique: WHsfp2A1Pn6PTo9zhaK6Cg-1 X-Mimecast-MFC-AGG-ID: WHsfp2A1Pn6PTo9zhaK6Cg_1795634763 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-93cb7f9bb86so1175826885a.2 for ; Wed, 25 Nov 2026 11:26:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1795634763; x=1796239563; 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=v6NmbSBdWpSm2uVrOp8tpZ65xhznrbrVh6qn8OyPhJ8=; b=h05KInbD86wfThg4dMAc096QIRLQ5/B7awsf5C2xH+PwlMMalzRWcFw4lh1Fs4P6ed gK5tgJKkOjF49Ec04S/4skSHFhwePE7JT29OUQhUyA5+o7+AhIPsetEEils4g4+dpErg BWEBF5ZbnAXHw3kpSiKaU6Fll8YtkbyMBdenz53JXa1+2RxL8IrcLMIP4eMpj1Xe6Yn2 FuKXhp85tnaeXojCtdaJp+x7iOEQkt36kokNGQP2yDGtfxEeSXr3L1PI60/qybTlfP5F Tl006Elxdt4DFhnEgR79rKatGOvTpcCceYyaDUqbjBhJ25b0XCsi2u1GPvc402tSG6/6 9w8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795634763; x=1796239563; 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=v6NmbSBdWpSm2uVrOp8tpZ65xhznrbrVh6qn8OyPhJ8=; b=OUTajrG7H18Oz8LdrIqenZsRv+74SfLj2f6HgdwwW8wDH9EFHPk6jp7NYRYqBD3APN hl7YZAwy40SWC5MEDetup0dyluCwLVyL+an8qzQwd/Ju5kNse4dbrmIMVBUaDlQoIUhD 6yC35eUu2tbul0aYedj708YWxTlrJpmEhbgQzO0g3v68rtORzGssNZl11+4zxoH2ijs/ uzv4rfw1SA/mAQ+mNDWG4FRvsYfbrXp/197+y5Md367nwccGeJQrT27QpN4Jxp4rDdZb G4dvzxD6zxkiWx9p5vJKMxQ3sZIiQII/Upsah6j+EXFvpHHEJDg2Xgeexgv56v1Eh8EJ +6kQ== X-Forwarded-Encrypted: i=1; AL+hErEgdQIKW8GPL7dj3TB6CmCKeDnv3RxDs7ejWyJFhHT3qLe5nMtfJAXN34Pi0mEczjeZMYb9TQgMxLB9tVE=@vger.kernel.org X-Gm-Message-State: APuU4Z9x02aHRGy7osW0HCen8iWWPHYxtvWmCMtFByW9yUUbvQamdYyb XKS7DYdMos933zKixfWn2mCRwHGUCHXePBqOsgPEsS8vy6whidyfEtK/KKXf9FUk8/m/B++f1Ys SW0v44RD2Xe+YWFenLvtISf2F12Vp71ZHTcEqvThxiUMT7ayHT76SEuT6n3M//FgKZQ== X-Gm-Gg: AZFdTZfoMt9tziVKEdMDStEY2KFYtynE5l1l6U8E6/S+sn91N/hYZ2TSN3Np/7Sgtnq RurBVirsae0nYmb1JANawOi/jrIN7fJkBJeSo5Xp3ZK4VsS2qFxLIIjP9KiK+TKBxIcUaP+eQ07 qvpYsJ7AD70CFAsOVkNteZLaO2mpthfbojEsRZ9BBqhA3bGjDUTjjthIPxUuFJMNmhW/w+Igyl7 Lax7r+xZVOOR1IubnthGqw+lO3wLT1mwhCyLSBGAs05Enq5aFxD4HgApXX4kQFYyIEpWeje6VTP /qjxgOxVHBWJVqDGKkBrg2Wt+xGNPz+zd277xDLrbO5O4ifoS1kzbJOdS/q4YNCvJ9CPLkYndHz 0DhwUOIiM5ZC0oC3ha4ogw5dQG9SlHVD1wFQJkdOUvdypRFxTWqhxCe2H8lxFPqd55NyY6cf7gB cGRX8rX83SzQnPFy/M9vfc5fyTltvwW7Y0WE0gnX8Z8kBPR6BSm0Kxr+4UgSFaipgB9QRSODg= X-Received: by 2002:a05:620a:462a:b0:949:3302:1d9f with SMTP id af79cd13be357-949bab350e3mr3218670885a.78.1795634762631; Wed, 25 Nov 2026 11:26:02 -0800 (PST) X-Received: by 2002:a05:620a:462a:b0:949:3302:1d9f with SMTP id af79cd13be357-949bab350e3mr3218663985a.78.1795634761937; Wed, 25 Nov 2026 11:26:01 -0800 (PST) Received: from loberman-thinkpadp16gen3.rmtusma.csb ([2600:6c65:2440:d8c:aa2b:ddff:fe88:da74]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-9213515f467sm168088266d6.41.2026.11.25.11.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2026 11:26:01 -0800 (PST) Message-ID: <2adaf0ef9e1a2fa18590f7d8dbf203c0f7de2be7.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 , Thorsten Leemhuis , Tobias Laas Cc: 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 , Lu Baolu , Joerg Roedel , Will Deacon , Niklas Cassel , 70sp <70sp@protonmail.com> Date: Wed, 25 Nov 2026 14:26:00 -0500 In-Reply-To: References: <5ad27a97aafbc08a8702d5b90d09cd59@posteo.de> <87b1bbd8-8113-4890-8623-738b19a9cc7b@leemhuis.info> 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 Wed, 2026-11-25 at 10:29 -0800, Bart Van Assche wrote: > On 11/25/26 12:52 AM, Thorsten Leemhuis wrote: > > For completeness, =C5=A0imon Posp=C3=ADchal (now CCed) shared findings = and a > > WIP > > fix (both with the help of a LLM) meanwhile here: > >=20 > > https://lore.kernel.org/all/QISmXFlpPMgvFUKmdIBDwqn4JHHXt2NZeJzerMLHF_5= icLo0lPKVlN0Ig9v8Vb52NmCeSFdyrao4x8KoN1DCXtDlnZS7eRIClC6vZyu-hPU%3D@protonm= ail.com/ >=20 > 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. >=20 > Bart. >=20 >=20 > Subject: [PATCH] iommu/vt-d: Disable superpages on Haswell with=20 > integrated graphics >=20 > 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). >=20 > 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=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 > 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. >=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 | 53 > +++++++++++++++++++++++++++++++++++++ > =C2=A0 1 file changed, 53 insertions(+) >=20 > 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 @@ > =C2=A0 #include > =C2=A0 #include >=20 > +#include > + > =C2=A0 #include "iommu.h" > =C2=A0 #include "../dma-iommu.h" > =C2=A0 #include "../irq_remapping.h" > @@ -43,6 +45,7 @@ >=20 > =C2=A0 #define DEFAULT_DOMAIN_ADDRESS_WIDTH 57 >=20 > +static void __init check_haswell_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 +2765,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_haswell_igfx_superpage(); >=20 > =C2=A0=C2=A0 ret =3D init_dmars(); > =C2=A0=C2=A0 if (ret) { > @@ -4266,6 +4270,55 @@ 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 > +static const struct x86_cpu_id haswell_cpu_ids[] __initconst =3D { > + 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) || > + =C2=A0=C2=A0=C2=A0 !x86_match_cpu(haswell_cpu_ids)) > + 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; > + } > + pci_dev_put(pdev); > + > + for_each_active_iommu(iommu, drhd) { > + if (cap_super_page_val(iommu->cap)) { > + intel_iommu_superpage =3D 0; > + pr_info("Disabling superpages on Haswell > with integrated graphics\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 Hi Bart, Tested-by: Laurence Oberman Tested on a non-affected platform to check the quirk does not misfire: Coffee Lake i7-8700, Cannon Lake PCH AHCI, both DRHDs report SLLPS =3D 2M|1G (dmar0 cap 1c0000c40660462, dmar1 cap d2008c40660462), 7.4.0-rc1 with intel_iommu=3Don. The quirk does not trigger, superpages remain in use (2 MiB leaf PDEs, e.g. 0x000000018f400082, confirmed via domain_translation_struct during 2M O_DIRECT reads), and there are no DMAR or ATA errors. I don't have Haswell hardware, so Tobias's test is the one that confirms the fix itself. The Fixes: tag looks right to me. c376a3456d8b is the commit that stopped intersecting superpage support across IOMMUs at attach time. In my earlier mail I pointed at 5bdd86ec5d19, which only removed the remaining hotplug user of domain_update_iommu_superpage(); both are in v6.13-rc1. Regards, Laurence