From: "David Matlack" <dmatlack@google.com>
To: "Alex Mastro" <amastro@fb.com>, "David Matlack" <dmatlack@google.com>
Cc: dri-devel@lists.freedesktop.org, iommu@lists.linux.dev,
kvm@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-media@vger.kernel.org, linux-pci@vger.kernel.org,
"Alex Williamson" <alex@shazbot.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Christian König" <christian.koenig@amd.com>,
"Jason Gunthorpe" <jgg@nvidia.com>,
"Josh Hilke" <jrhilke@google.com>,
"Kevin Tian" <kevin.tian@intel.com>,
"Leon Romanovsky" <leon@kernel.org>,
"Logan Gunthorpe" <logang@deltatee.com>,
"Matt Evans" <mattev@meta.com>, "Matt Evans" <matt@ozlabs.org>,
"Mina Almasry" <almasrymina@google.com>,
"Samiullah Khawaja" <skhawaja@google.com>,
"Shuah Khan" <shuah@kernel.org>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Vipin Sharma" <vipinsh@google.com>
Subject: Re: [RFC PATCH 0/7] vfio: selftests: Add peer-to-peer DMA selftest
Date: Thu, 12 Nov 2026 13:47:03 -0800 [thread overview]
Message-ID: <DMTK99TDM9AM.SAM3Z4COP9WS@google.com> (raw)
In-Reply-To: <avYjFfqr3T/U7lvn@devgpu015.cco6.facebook.com>
On Thu Nov 12, 2026 at 12:35 PM PST, Alex Mastro wrote:
> Hey David,
>
> On Wed, Nov 11, 2026 at 07:24:04PM +0000, David Matlack wrote:
>
>> Is requiring userspace to re-issue IOMMU_IOAS_MAP_FILE the expected
>> uAPI behavior? VFIO_DEVICE_RESET (and runtime PM transitions) on the
>> target device also bracket the reset with
>> vfio_pci_dma_buf_move(vdev, true) and vfio_pci_dma_buf_move(vdev,
>> false), tearing down any active IOMMU_IOAS_MAP_FILE mapping of that
>> device's BAR even though PCI_COMMAND_MEMORY remains enabled when
>> VFIO_DEVICE_RESET returns.
>
> There was some discussion about this in the thread below. My understanding of
> Jason's point is that the current behavior, and differences between what
> revoking and move-capable importers see in regards to vfio-exported dma-buf is
> somewhat incidental and not necessarily desirable.
Thanks, I will read through that thread. It seemed like a surprising
uAPI.
>
> https://lore.kernel.org/all/arMBqyI4XNfD+q1W@devgpu015.cco6.facebook.com/
>
>> - Physical target devices and P2P topology checks: mem_bar_descs[]
>> currently only matches QEMU's pci-testdev, and
>> vfio_pci_has_p2p_path() does not yet check PCI topology or ACS to
>> verify that P2P traffic can flow between two physical endpoints.
>>
>> Suggestions on physical target BARs to add to mem_bar_descs[] and on
>> checking P2P reachability from userspace are welcome.
>
> FWIW, you can also exercise the "P2P" path with just a single device if you
> IOMMU map a device's BAR into it's own IOAS, and have the device DMA itself. For
> eventually validating aspects of Live Update, maybe you don't necessarily care
> if an actual peer device is being DMA'd?
The way I designed the P2P selftest support requires 2 things:
(A) initiator: A device that has a VFIO selftests driver.
(B) target: A device that can provide a memory BAR (vfio_pci_find_mem_bar()).
So far I haven't found a single device that can do both. But you are
right that theoretically a single device could satisfy both
requirements.
I can relax vfio_pci_has_p2p_path() to allow initiator == target.
prev parent reply other threads:[~2026-11-12 21:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 19:24 [RFC PATCH 0/7] vfio: selftests: Add peer-to-peer DMA selftest David Matlack
2026-11-11 19:24 ` [RFC PATCH 1/7] vfio: selftests: Add vfio_pci_find_mem_bar() helper David Matlack
2026-11-11 19:24 ` [RFC PATCH 2/7] vfio: selftests: Verify memory behavior in vfio_pci_find_mem_bar() David Matlack
2026-11-11 19:24 ` [RFC PATCH 3/7] vfio: selftests: Allow multiple BDFs in VFIO_SELFTESTS_BDF David Matlack
2026-11-11 19:24 ` [RFC PATCH 4/7] vfio: selftests: Add vfio_pci_dmabuf_create() helper David Matlack
2026-11-11 19:24 ` [RFC PATCH 5/7] vfio: selftests: Add iommu_map_file() helper David Matlack
2026-11-11 19:24 ` [RFC PATCH 6/7] vfio: selftests: Add vfio_pci_find_p2p_pair() helper David Matlack
2026-11-11 19:24 ` [RFC PATCH 7/7] vfio: selftests: Add P2P DMA selftest David Matlack
2026-11-11 19:47 ` sashiko-bot
2026-11-12 20:35 ` [RFC PATCH 0/7] vfio: selftests: Add peer-to-peer " Alex Mastro
2026-11-12 21:47 ` David Matlack [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=DMTK99TDM9AM.SAM3Z4COP9WS@google.com \
--to=dmatlack@google.com \
--cc=alex@shazbot.org \
--cc=almasrymina@google.com \
--cc=amastro@fb.com \
--cc=bhelgaas@google.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=jrhilke@google.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=leon@kernel.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=matt@ozlabs.org \
--cc=mattev@meta.com \
--cc=shuah@kernel.org \
--cc=skhawaja@google.com \
--cc=sumit.semwal@linaro.org \
--cc=vipinsh@google.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