From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (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 3021F2EC097 for ; Wed, 19 Nov 2025 19:36:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763581004; cv=none; b=C0dwdp+5T0sP0PM+IdnCqGGQSw5poBmpkn4XyF0nUwagyWvB2PA1CGl0swMkMBD1ISZiVDqf469Q4XYfbcUmrJaZCb3p7bBttYPOC8tab3D3VnvfoR3ivCLn9hoSFlP6s3wSAFAXVS+mFopvbp01FQiaVr9yyPpXk/s1qMFLq9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763581004; c=relaxed/simple; bh=sztelLlBrONBmM282viGyh6kz65i94yYxCWrYWozdqM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=E03fG0Ub8CKCd22rSRqwJHPv7r8Fby/hn3E/99/z8ti723u55hsv66n/v0wjdBbdAs43CYcY1bMekAC6uaRtAgrRWX8RMcObMsjS3N2CfRcP6TQ1nIrP2iquzEw6jnqvN+W6YaRm9nW9FO8WDqt2uznY+FovO/dJpb5dXCk9Mr8= 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=jBqa/z5s; arc=none smtp.client-ip=209.85.160.175 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="jBqa/z5s" Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-4ee05b2b1beso783331cf.2 for ; Wed, 19 Nov 2025 11:36:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1763580999; x=1764185799; 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=sztelLlBrONBmM282viGyh6kz65i94yYxCWrYWozdqM=; b=jBqa/z5s9CGp5RICxeKSJrdO5l3megJVr81FnjM4RHwVEKCUb4xEQ8NaoiOBOhnzcZ bMxWoyoMgmSdI5ISZhu0sMMq/bhX6xdwOzl9EI+joXijVlgSlY/nZpUwpWnn/B0Ui1n3 W1cP0IRwL+kjK02u1dFunMpg85hYN05Dj9YAOL9GP3DccFBflwbNZyVBV7hJoxkN969L WGavQPhrCgEO9MrysbD9xVHbtHHSiRc7gCv2T2zrxkr+wtl5uM6DDuTpWX8LCAjj2xlp FMsXVMjmkR4zOh3um/QXeOnX47MD5GU5Nvj7Dyi23HwJxfdQIj3H8yE3t+KQbYckONLZ +Lxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763580999; x=1764185799; 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=sztelLlBrONBmM282viGyh6kz65i94yYxCWrYWozdqM=; b=SDggH9bS+q/47HmM5V50BfAfOmYoPPKubcsJxwu4Bkgo/3OQ01ze9S5pnTSgZ72Yev 4dAgQT1OXEm2yk4cRvoTMRQX4PKbT5TVixPa/+f7Lsl7SCZECs0L2HraYOiM86SYHIne L/sTZk61n79ti8+8nTzTu7Qm0Xvl/+6pOIdiu7a4HG9XgOCA5PmRVxTf3e6F2a0j7luU NlZCQvAESjgWK9HDgzdDzwzLl8LxmvmPjJQ0ijqdP06kamQXAdUP2HaxFaFSxH5JDES1 2RO3iHev0DYwxQ5CXg8D63r3Uczdm0Mh6K/a/waszv5TVz5wApL9J9O598d/BJtmLn5h 0RCQ== X-Forwarded-Encrypted: i=1; AJvYcCVzEKIbhIxMfQQhqHwbheVTKpUdf9U3ulLU8OzAEUYENBmeYZoxzbkUEts+4dznxnj31mZ9MyoIidwaG6k=@vger.kernel.org X-Gm-Message-State: AOJu0Ywnc2Itjx5KH65nxzVnc3ynE4Gz1O3NkEsYe9LJ3caQc1Nup/aH iYPht8/A7a0NR6AU37csw6Ovu6vWxXTp8exlrPDG7oJcI6swkJ3JZniJfsVy/kVPiRM= X-Gm-Gg: ASbGncsU0tojXzCInynFl9qNHsC69AQAP82VG0KTDTeeSvLTe1ltjVGVu+eykzngf93 QbPwMxtecM1uzxChZzsZxjSti6BMSbctGafNSlr17D09DqRYF7jGqC/J+ZJGKLeQctkcw6XKmco MAEyeAdeNea9wAOIFMxv/5Yqc7QUXP7PhRmYCIFZfXtNpw2g1C7wDvwy08c87YpVoLxKbqAKRCz gwrPg+LXOHFiogI3wEFqdobRFBl6Wx1nEe/96t/kWINi1vNx2Amk1bjtwfmd5IMEGmfJhf71FAu P/yoosM3OK0sZqJ1UJfIz23JvaS4vEfxWayTi3oDQ7RBmVnCm24LjhDPXPZRQKBskc29gyjH5SR /B7b9iRgjTdlDY+x1vYZfTheNRsi8QuCl5qFof2GZuy2uFlPzMpO7ujd5+D2yLgsyLU8gBYTgL9 za5AuFrvvXRMae/AV8ZqkiqcvjTSQPNr4XHK/mm/8ewmvhaK0bShDw+JCq X-Google-Smtp-Source: AGHT+IEogkhlTHFcyAE9/u1UuBQV+X3tukog/nHIoHavB/ndnYOWZGPWrkYoYNh/EOln2cA+Kp4KoA== X-Received: by 2002:a05:622a:310:b0:4ee:1d84:3068 with SMTP id d75a77b69052e-4ee4971a985mr8236121cf.76.1763580999342; Wed, 19 Nov 2025 11:36:39 -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-4ee48d64503sm3117901cf.13.2025.11.19.11.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 11:36:38 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1vLnyo-00000000bYz-0lQx; Wed, 19 Nov 2025 15:36:38 -0400 Date: Wed, 19 Nov 2025 15:36:38 -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: <20251119193638.GQ17968@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> <20251119134245.GD18335@unreal> <6714dc49-6b5c-4d58-9a43-95bb95873a97@amd.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6714dc49-6b5c-4d58-9a43-95bb95873a97@amd.com> On Wed, Nov 19, 2025 at 03:11:01PM +0100, Christian König wrote: > I miss interpreted the call to pci_p2pdma_map_type() here in that > now the DMA-buf code decides if transactions go over the root > complex or not. Oh, that's not it at all. I think you get it, but just to be really clear: This code is taking a physical address from the exporter and determining how it MUST route inside the fabric. There is only one single choice with no optionality. The exporter already decided if it will go over the host bridge by providing an address that must use a host bridge path. > But the exporter can call pci_p2pdma_map_type() even before calling > this function, so that looks fine to me. Yes, the exporter needs to decide where the data is placed before it tries to map it into the SGT. Jason