Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1217347rdb; Mon, 2 Oct 2023 02:57:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyt//9IffxJGJ3uJwRC0uRhkt8FYXY6yNdbEhIRR7ZTxQAgZPgADSlU9DPjE52+JEwIqDJ X-Received: by 2002:a05:620a:4708:b0:775:8338:a605 with SMTP id bs8-20020a05620a470800b007758338a605mr12782848qkb.52.1696240666616; Mon, 02 Oct 2023 02:57:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696240666; cv=none; d=google.com; s=arc-20160816; b=ktjS95voOKbFhGv8Smc+R1aFDqobb7znKw0FM80uc3Z+F4XNwgzVuQ3963OzmfFmgp EBiBENnw0UcpMNOHd+Z0EfKYn2nS2Xmm0oDU50FHB0GUcS5tnAApmWfmRZufon7QTTw4 R0TZvXlugpX0GA6kZYp4sAv3WgFAsTfCtdET9gm1OC6JPuWXh0HE7G0NkxSWyEdcd+Xy yRo5QMMZBssPCIFUmi48gW/P1gGJ8lN8d1xWtFrD8+se5UuXOowptvxytmE5SafDiSdU tWu4BZQaL3sYAaxcODHgoP6yxbe3v/7u6IjcdEfxX1Miuy4nJGeTfnysBT47bYTrzDQ5 9vFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XKqktRgZJ9kzBiEPkUUVphTY5hbUfnFM86CuOM3EvbY=; fh=UlixiN3B7OxLoPZaqwGXoeJWmZNdpXCUJbTHSWGOOSg=; b=eYHeMKC1afvN2N7TRMpqyFQf/+Q+48ZBvk/YWBy0R8CKpon5vnt7YBYEFRc8h5Ijhv nySQpwtOJIXI4aMGg6UCYMu7m8orYAm2LNgLRrHZuKvB0Hy7HepEb8ApMA6xP2YGmqKB i2riVLg5H8OzM2p6ZCcOJXSl9YbpqdD+vjbf+67OzGzSrtGwPb8HwkkqDYkG52rVZfpN IdQAhvjhkFVviy+j1FdOBm6368MbSOd66svJVOIH2rCRBOb/9drGNHcQjwvwTT3rEAbZ OwKDmMUCgk+eTZEZfaR2+NYXQTELA6xGZx3lBfWXnj6j3RthBs6wsXzIjfw0cOClgdSx y61w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=bGmIi2Rb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id k20-20020a637b54000000b0056959099f46si15708185pgn.856.2023.10.02.02.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 02:57:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=bGmIi2Rb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 411B280842C6; Sun, 1 Oct 2023 23:30:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235495AbjJBGaW (ORCPT + 99 others); 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 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 01 Oct 2023 23:30:37 -0700 (PDT) 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.