Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1002668lqm; Thu, 2 May 2024 02:12:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW1EjXr2zSVvVXRfWQcIXi0+J+CoqNWgojhjA8Qvt8yaoigEJy4U6wczaMmifmDRqoqgskrBHK7vu6LpoTHTpC2q9pPtBGH4SBZigUReA== X-Google-Smtp-Source: AGHT+IGGdrzQYa7ZVGgR8AfrvxXz0FhJV8CS8ajAJ6zm9duJFyidY/X1o8twP7tGo4jh6VATeON3 X-Received: by 2002:a17:90b:ecd:b0:2ab:eff6:e2ce with SMTP id gz13-20020a17090b0ecd00b002abeff6e2cemr5670515pjb.0.1714641153569; Thu, 02 May 2024 02:12:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714641153; cv=pass; d=google.com; s=arc-20160816; b=VlutZcDi8CFZwMAIFDoLm/Qt5H3JP3HIPzw8a1VPIbNTZQP78uxFm5QKQpQBscRwEN gJ5v1AnvHEd9mSmBUWOYqs6tMnQADrpl2tYkI/lLmQhbC/SZkMKKnGaDHRqK9cRVKYW8 cKc1hkYjFbzhMMsuBlBO1yx3a35H0ilCKMTIYTyBDm06OTrMyZnI1JxlE4JUdOr3MSq3 2/lL8RNJ9rhk7V2gaugFUeoVVhNgrw/NsmASWkZeIBetzjUc49MwR4pvzgCi5uJJlVx1 fgN5jrHT/lhIHqmU0ZiiPenXswK0VLXXCxvKndaRX8eJXsF/SaVWpZKuysScN8wLIuzl vwFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5amkvJXIOOx9Ih8Muv99+02q4fS2kw8BvMZGGjfEC+g=; fh=+xFis93u0IZImwT/oXBwvF53AIRQQj+rNU8q/f1hOhk=; b=v7abQ2h3/zYGuj4sgR85Egtkp3j/J+l+1ZtxMLUWC8qUUJgVUANAx/jVAmKBghvHMD stFbw5NJ3dJJ8UT1xdCt1pDkf/YcNv+l2Qpp/Ix75Qbylk1bGqCZMRS4vsFdP/7K3huR CWZpxSLPXJtJfKeS2xFUGoKn1FU3PAZg9z/32qx1MNPuLyAImBqlqTE1IXyFUTgQStXa q9FY65eWPGd/1s/tHc2JCPdM4zL3I2q1aS4m5jNzISmuKAIY3GGMi5Rux814XREcswTb UqRFeCxP7GM0aSQSKwGtchUpYSqnXMmbB3YttSpmTDOUNv/MIHLHzOpK9l1S6WqA8HRu 1ivA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=PAwC3HGz; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-165976-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165976-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id cm3-20020a17090afa0300b002b328adc3d0si667907pjb.41.2024.05.02.02.12.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 02:12:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165976-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=PAwC3HGz; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-165976-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165976-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D3572B20E63 for ; Thu, 2 May 2024 05:07:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92CEF1F95E; Thu, 2 May 2024 05:07:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="PAwC3HGz" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A54451CD2D; Thu, 2 May 2024 05:07:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714626460; cv=none; b=t4XmXykYh1fdk64f9sqksl4SEqJwSOJauhMwIcfFMOtqZO3PIpWjMVDRM2ZM2pNIZ96umh+zPpSNHz071XM3sMtYuyMnz1YTkWGHpBJIxwQ4rRvQ8zsll7Kiin/ca962FWaHcXeJA2amkysOU+eI+qcABqwxuFS8jqINkyGPonk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714626460; c=relaxed/simple; bh=5amkvJXIOOx9Ih8Muv99+02q4fS2kw8BvMZGGjfEC+g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oDtOc49hCopIN17HIhpENpSjJckt06YrTg3ywnzdlXaQx/aVZkJL1pVwrK4Y/axIwsGO5mFrwNMlS7FxlpnU13w5dC/cDD3ATTnFsVsD0hJuDD0pgwXV/dYDLQgqH3/vCb/UspuJhWASC+meET5p92ydyb6sth0h0bH+iv9WsfM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=PAwC3HGz; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5amkvJXIOOx9Ih8Muv99+02q4fS2kw8BvMZGGjfEC+g=; b=PAwC3HGzIePWCQ0yHyz8Bb+PhF FqB2JAjzpMjOl51lbRLUYcHVwT+HzhbkR5zgW7jgdslvznS6S/gC1rnNBbMP6OTIjDXrFJmYYImtA FU9OhWDPruICJEBrU008uW+W5j0mhCVn6O2XxRULjN1pn7+wPyQt2eenzsiSTZZ8CW4jDJhMORiwQ Izq/NNYzoXIjkwU6Ut0yDfTr/n+kpFw07YmATMN4qcD+18wOkiQ8dyeams8en1F9ElCFTR8k4Tvef T2umHYKSjWnHTSnHFTgQHJLNWmCWsjrpY49PeFyd36XgkJa4pfIQY+xMhRtQvzVU9zGhvpB14zvpV BH6dDqXg==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2OfP-0000000BUUU-36bi; Thu, 02 May 2024 05:07:35 +0000 Date: Wed, 1 May 2024 22:07:35 -0700 From: Christoph Hellwig To: "T.J. Mercier" Cc: Robin Murphy , Joerg Roedel , Will Deacon , Andrew Morton , Catalin Marinas , isaacmanjarres@google.com, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iommu/dma: Respect SWIOTLB force_bounce Message-ID: References: <20240501201319.586289-1-tjmercier@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240501201319.586289-1-tjmercier@google.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Wed, May 01, 2024 at 08:13:18PM +0000, T.J. Mercier wrote: > iommu_dma_map_page and iommu_dma_map_sg conditionally use SWIOTLB, but > checking if force_bounce is set for the device is not part of that > condition. Check if devices have requested to force SWIOTLB use as part > of deciding to take the existing SWIOTLB paths. This fails to explain why you'd want this somewhat surprising behavior, and why you consider it a bug fix.