Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Alex Mastro <amastro@fb.com>
Cc: linux-pci@vger.kernel.org, alex.williamson@redhat.com,
	peterx@redhat.com, kbusch@kernel.org, linux-mm@kvack.org,
	leon@kernel.org, vivek.kasireddy@intel.com, wguay@meta.com,
	yilun.xu@linux.intel.com, Nicolin Chen <nicolinc@nvidia.com>
Subject: Re: [BUG?] vfio/pci: VA alignment sensitivity of VFIO_IOMMU_MAP_DMA which target MMIO
Date: Sun, 8 Jun 2025 21:20:57 -0300	[thread overview]
Message-ID: <20250609002057.GK19710@nvidia.com> (raw)
In-Reply-To: <20250606184946.4175252-1-amastro@fb.com>

On Fri, Jun 06, 2025 at 11:49:46AM -0700, Alex Mastro wrote:
> Hi Jason,
> 
> By the way, we have been following progress on IOMMUFD, and would be interested
> in dogfooding it for our use case when ready. The main blocker is IOMMUFD's
> current lack of P2P support (IOMMU_IOAS_MAP fails when the VA range is backed
> by MMIO).

Nicolin has a OOT tree patch that makes iommufd work in the same
insecure way as VFIO. Several places are using that for now.

> dma-buf as a less ambiguous semantic for communicating this intent (rather than
> the struggles of inferring what kind of memory is behind some VA range) makes a
> lot of sense.

Yes, I hope
 
> Based on tidbits we have gleaned, IOMMUFD P2P support intends to be built on
> top of "Provide a new two step DMA mapping API" [1] and "vfio/pci: Allow MMIO
> regions to be exported through dma-buf" [2].

Yes, that would be the first basis.

We also need to enhance DMABUF to add 'revoke' semantic

And enhance it to allow the physical page list to be given the iommufd
instead of a scatterlist.

> Item [2] appears to have been picked up by "Host side (KVM/VFIO/IOMMUFD) support
> for TDISP using TSM" [3].

I hope to see #2 redone on top of #1 this next cycle, Leon is working
on the incremental changes to allow the new DMA API to work without
struct page.

> On top of this, there would need to be a new IOMMUFD uapi, or extension to
> existing, which would accept an input dma-buf to map. Are there any patches in
> progress which include this?

No, I haven't seen patches for dmabuf revoke, or iommufd. The patches
for the physical address list need redoing to try again following
Sima's directions.

There are lots of steps here for someone to contribute to :)

Jason

      reply	other threads:[~2025-06-09  0:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-29 21:44 [BUG?] vfio/pci: VA alignment sensitivity of VFIO_IOMMU_MAP_DMA which target MMIO Alex Mastro
2025-05-30 13:10 ` Jason Gunthorpe
2025-05-30 14:25   ` Peter Xu
2025-05-30 23:05     ` Alex Mastro
2025-06-06 18:49   ` Alex Mastro
2025-06-09  0:20     ` Jason Gunthorpe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250609002057.GK19710@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=amastro@fb.com \
    --cc=kbusch@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=nicolinc@nvidia.com \
    --cc=peterx@redhat.com \
    --cc=vivek.kasireddy@intel.com \
    --cc=wguay@meta.com \
    --cc=yilun.xu@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox