From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A338FE7849A for ; Mon, 2 Oct 2023 06:30:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235505AbjJBGaW (ORCPT ); Mon, 2 Oct 2023 02:30:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229832AbjJBGaV (ORCPT ); Mon, 2 Oct 2023 02:30:21 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53DA19B for ; Sun, 1 Oct 2023 23:30:19 -0700 (PDT) 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=XKqktRgZJ9kzBiEPkUUVphTY5hbUfnFM86CuOM3EvbY=; b=bGmIi2RbBBQ68IW4awuPgghjA0 bg8A7VVnJrSg+QryNVBhMjSFHVLEDLilkMlWK/XOxYwpItZgilPWVvlc8/A5gwXDcGGLRuGZaZW8v vNqCWakUQfMlVR6v0vtK/VZ1Lt7drz38jnH3hRShMwLP3Eaz9P8HL53bvtZGz5MOvpbdmo2nfvapB HQrxlpJ7N+Nqxj3JdDVoFKPLPQXghoy4nPUXAxwW9FtGK63+NcsdxgxJvrLGV73NoQCG4JtrgAsp5 1/xAqbbDF7wmI/iUVdzrEmNZSwYSqAH7AsrWtw0Pt0lNRZimVP3E4mJokzPrqtcvXgZelfiESPQsw JY7D3eQw==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qnCRY-00C1mG-0L; Mon, 02 Oct 2023 06:30:12 +0000 Date: Sun, 1 Oct 2023 23:30:12 -0700 From: Christoph Hellwig To: Kelly Devilliv Cc: Christian =?iso-8859-1?Q?K=F6nig?= , Robin Murphy , "joro@8bytes.org" , "will@kernel.org" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" Subject: Re: dma_map_resource() has a bad performance in pcie peer to peer transactions when iommu enabled in Linux Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org FYI, dma_map_resources must never be used for PCIe P2P mappings, you absolutely must use dma_map_sg as only that handles all the corner cases correctly. And we need to figure out a way to put a check into dma_map_resources so that people stop abusing it.