From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D26936CDE5 for ; Wed, 19 Nov 2025 19:31:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763580686; cv=none; b=V+QB/G+2xiIEc5e0gUuHTCGMqO3/YmPWuSYxWgcKzxy76ibCl2i8CefA+qJqJRL7jCNCc8iZUVzRJ45fhg+i++44Bf36hIW0L3E0MHKzIOykpBkCZU0ni0EDbQ4fyarZbYiWi9FIEiryDTVZqmVT2i7/2NUVfIJW5gMA6VJFfVo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763580686; c=relaxed/simple; bh=31o43Jiq7+42iBKuCHD0EJijctYU11Xzmoh7F9+p7aA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qKG/47cY8buwLziRsGz7LCTXujiLUhJWGT5nBl4SGc7pBxBwlCOkoSg7RvZ7oeCwY/OcVJUKjEx82/whJe/IRK7mbmsiGkXrC3meMF1zAGYLm9hi8HibJnDhG66f+TpghJWidUFC1aMinX/xqTiQ3oDfm+DiZVG0ZjaRPAm2V+o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=XdlJDak+; arc=none smtp.client-ip=209.85.160.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="XdlJDak+" Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-4ee1fca7a16so796781cf.3 for ; Wed, 19 Nov 2025 11:31:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1763580676; x=1764185476; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=h7MnLKcAx1SQL4BtR2OdhLpsdZ14wJj1fNMBVXMaHpI=; b=XdlJDak+5BK913SU3JuefgTys0Pu3jagmK7yJRyg0hso6vBbEnNWrP/4T4ol0frYeQ v72slbgWiUzUkvc5J9nruxngr4U8bjd49BPaZVmvFk3nVkQeWMFAA9u86tKqv9X1hNhK MlqYYLa9OWUP32XsBcZxKrfLx3/P5R6PJ+h5hBO1AY350/0bZcNA4a3VB+Mm2EZq+tuy 2zW8VsnOjICqJWrFFskAlkKYKVrHI+m3LVPh9ZWULCzK0B6ii9jOvGUvNr+rAbET5gKT aIqFqtGZMVR1/oWhdLlQH/aHK4RI3YFZ+ToY0lGX/NpOTOSRqsVtdilqIlqws45I3kGI vpCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763580676; x=1764185476; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=h7MnLKcAx1SQL4BtR2OdhLpsdZ14wJj1fNMBVXMaHpI=; b=BcUEtrtK+h+mC9dcKGv/+pX/NWEnusMseWT2qB2YqVXsuZUh+cAlsvbmmQ0euHlSK4 cnqGOuWZ1zFNWw1hT/RsF6oi46mxrcZ9YlAKkjoTyIRtMStuYzv6ewgBgrmWaUeiPqV/ lhDc30ESzkwMB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HWixw== X-Received: by 2002:ac8:7e4c:0:b0:4ee:4a3a:bd18 with SMTP id d75a77b69052e-4ee4a3abe64mr1136891cf.76.1763580675980; Wed, 19 Nov 2025 11:31:15 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-47-55-120-4.dhcp-dynamic.fibreop.ns.bellaliant.net. [47.55.120.4]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4ee48e46ed0sm2807721cf.20.2025.11.19.11.31.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 11:31:15 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1vLnta-00000000bWq-3r3x; Wed, 19 Nov 2025 15:31:14 -0400 Date: Wed, 19 Nov 2025 15:31:14 -0400 From: Jason Gunthorpe To: Christian =?utf-8?B?S8O2bmln?= Cc: Leon Romanovsky , Bjorn Helgaas , Logan Gunthorpe , Jens Axboe , Robin Murphy , Joerg Roedel , Will Deacon , Marek Szyprowski , Andrew Morton , Jonathan Corbet , Sumit Semwal , Kees Cook , "Gustavo A. R. Silva" , Ankit Agrawal , Yishai Hadas , Shameer Kolothum , Kevin Tian , Alex Williamson , Krishnakant Jaju , Matt Ochs , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, iommu@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, kvm@vger.kernel.org, linux-hardening@vger.kernel.org, Alex Mastro , Nicolin Chen Subject: Re: [Linaro-mm-sig] [PATCH v8 06/11] dma-buf: provide phys_vec to scatter-gather mapping routine Message-ID: <20251119193114.GP17968@ziepe.ca> References: <20251111-dmabuf-vfio-v8-0-fd9aa5df478f@nvidia.com> <20251111-dmabuf-vfio-v8-6-fd9aa5df478f@nvidia.com> <8a11b605-6ac7-48ac-8f27-22df7072e4ad@amd.com> <20251119132511.GK17968@ziepe.ca> <69436b2a-108d-4a5a-8025-c94348b74db6@amd.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <69436b2a-108d-4a5a-8025-c94348b74db6@amd.com> On Wed, Nov 19, 2025 at 02:42:18PM +0100, Christian König wrote: > >>> + case PCI_P2PDMA_MAP_THRU_HOST_BRIDGE: > >>> + dma->state = kzalloc(sizeof(*dma->state), GFP_KERNEL); > >>> + if (!dma->state) { > >>> + ret = -ENOMEM; > >>> + goto err_free_dma; > >>> + } > >>> + > >>> + dma_iova_try_alloc(attach->dev, dma->state, 0, size); > >> > >> Oh, that is a clear no-go for the core DMA-buf code. > >> > >> It's intentionally up to the exporter how to create the DMA > >> addresses the importer can work with. > > > > I can't fully understand this remark? > > The exporter should be able to decide if it actually wants to use > P2P when the transfer has to go through the host bridge (e.g. when > IOMMU/bridge routing bits are enabled). Sure, but this is a simplified helper for exporters that don't have choices where the memory comes from. I fully expet to see changes to this to support more use cases, including the one above. We should do those changes along with users making use of them so we can evaluate what works best. > But only take that as Acked-by, I would need at least a day (or > week) of free time to wrap my head around all the technical details > again. And that is something I won't have before January or even > later. Sure, it is alot, and I think DRM community in general should come up to speed on the new DMA API and how we are pushing to see P2P work within Linux. So thanks, we can take the Acked-by and progress here. Interested parties can pick it up from this point when time allows. We can also have a mini-community call to give a summary/etc on these topics. Thanks, Jason