[{"id":3675315,"web_url":"http://patchwork.ozlabs.org/comment/3675315/","msgid":"<adenGd5d9BxNq_cR@willie-the-truck>","list_archive_url":null,"date":"2026-04-09T13:18:17","subject":"Re: [PATCH v2] iommu: Ensure .iotlb_sync is called correctly","submitter":{"id":76918,"url":"http://patchwork.ozlabs.org/api/people/76918/","name":"Will Deacon","email":"will@kernel.org"},"content":"On Thu, Apr 09, 2026 at 01:59:41PM +0100, Robin Murphy wrote:\n> Many drivers have no reason to use the iotlb_gather mechanism, but do\n> still depend on .iotlb_sync being called to properly complete an unmap.\n> Missing or incomplete TLB maintenance at this point can then wreak all\n> kinds of havoc, particularly in strict DMA mode where IOVAs may be\n> reused right away, if DMA traffic for a subsequent new mapping hits a\n> stale TLB entry and goes to the wrong physical address.\n> \n> Since the core code is now relying on the gather to detect when there\n> is legitimately something to sync, it should also take care of encoding\n> a successful unmap when the driver does not touch the gather itself.\n> \n> Fixes: 90c5def10bea (\"iommu: Do not call drivers for empty gathers\")\n> Reported-by: Jon Hunter <jonathanh@nvidia.com>\n> Closes: https://lore.kernel.org/r/8800a38b-8515-4bbe-af15-0dae81274bf7@nvidia.com\n> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>\n> Tested-by: Jon Hunter <jonathanh@nvidia.com>\n> Tested-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>\n> Signed-off-by: Robin Murphy <robin.murphy@arm.com>\n> ---\n> v2: Add tags, clarify implications in commit message [rmk]\n\nSorry, this raced with me queuing the v1 but I have included some\ncommentary about the implications in the tag.\n\nWill","headers":{"Return-Path":"\n <linux-tegra+bounces-13653-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-tegra@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=jldMy/Rg;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-tegra+bounces-13653-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"jldMy/Rg\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fs0w53R6dz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 23:22:13 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 86FDD3034AF3\n\tfor <incoming@patchwork.ozlabs.org>; Thu,  9 Apr 2026 13:18:23 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 229B33D88FA;\n\tThu,  9 Apr 2026 13:18:23 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id AFDE43C7E0C;\n\tThu,  9 Apr 2026 13:18:22 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 0C9DAC4CEF7;\n\tThu,  9 Apr 2026 13:18:20 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775740702; cv=none;\n b=BxBHfM8jjAWA2m4bQ1MJUU77tbKVzQcvqpWQStsCPE6lsM1LTXywSP9jIJilEfFlakWLA6V0SUr6sPrSQE+9FselWPKW9LhiywKXa0Voi7n91VvfwRDL9IrKosg4Qs6vdsXvVLzS3e5J8dnNxsCj3PA8Mj1g/j5bhB1gT0Xu94Q=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775740702; c=relaxed/simple;\n\tbh=GDPcSa8tnotnEXke8Dmj/8tOBXd3u80we22k4SktPrE=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=GVpP345dtH4kU8TVmUBQxQGymEqdXugwpA4zh/PU+A+dmz9kofXmN996zr07a51QTmuWjiW1NyAMJJIjqiu4EiKT/JFS9nqRoxPmdsTB+4oFyDRicE+PR7feDnW/C1V39MlBMfIT2eGbpkVk0QIDNsw4ss2fi3zm8ZGXJXEAVtY=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=jldMy/Rg; arc=none smtp.client-ip=10.30.226.201","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1775740702;\n\tbh=GDPcSa8tnotnEXke8Dmj/8tOBXd3u80we22k4SktPrE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=jldMy/RgQ9PoozOj7YSNL+9E9O7hoCjMuQfN084OAqb/Ed2tYi5G3TsdvN1xHyAzJ\n\t frymBq+0+imGMDTptONjjPU4FIBYYMecrHJGOZGY7llLM2YHAnh4G5SAaxAd3GONPr\n\t 2SiiHHKwNyfL6oQIJeOXbISJAp6S9YaUwyVa1LMXjeleRK7StisZ87kfeB8R9+T5HB\n\t g9cbqGJG+NRcBwq2XxT3PoddRJyQ3papcMYNkZ3NMbxx91zwqRq1TcxSV9HN7Qp6xm\n\t u8IAnhLNUwy69CeVhY+Ti1+EuEjNGu77NYk0kw0/dCITFb3PwSquz0VWGlwQfeP86i\n\t 5r+DV3RZpR65w==","Date":"Thu, 9 Apr 2026 14:18:17 +0100","From":"Will Deacon <will@kernel.org>","To":"Robin Murphy <robin.murphy@arm.com>","Cc":"joro@8bytes.org, iommu@lists.linux.dev, linux-tegra@vger.kernel.org,\n\tJon Hunter <jonathanh@nvidia.com>, Jason Gunthorpe <jgg@nvidia.com>,\n\tRussell King <rmk+kernel@armlinux.org.uk>","Subject":"Re: [PATCH v2] iommu: Ensure .iotlb_sync is called correctly","Message-ID":"<adenGd5d9BxNq_cR@willie-the-truck>","References":"\n <3eed961d41d3a81460031dee9f1db066f1d2e111.1775739433.git.robin.murphy@arm.com>","Precedence":"bulk","X-Mailing-List":"linux-tegra@vger.kernel.org","List-Id":"<linux-tegra.vger.kernel.org>","List-Subscribe":"<mailto:linux-tegra+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-tegra+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"\n <3eed961d41d3a81460031dee9f1db066f1d2e111.1775739433.git.robin.murphy@arm.com>"}}]