On Tue, 13 Jun 2023 15:11:06 +0000 "Liu, Yi L" <yi.l.liu@xxxxxxxxx> wrote: > > From: Alex Williamson <alex.williamson@xxxxxxxxxx> > > Sent: Tuesday, June 13, 2023 11:04 PM > > > > > > > > > > > > > > > > > > > Unless I missed it, we've not described that vfio device cdev access is > > > > > > still bound by IOMMU group semantics, ie. there can be one DMA owner > > > > > > for the group. That's a pretty common failure point for multi-function > > > > > > consumer device use cases, so the why, where, and how it fails should > > > > > > be well covered. > > > > > > > > > > Yes. this needs to be documented. How about below words: > > > > > > > > > > vfio device cdev access is still bound by IOMMU group semantics, ie. there > > > > > can be only one DMA owner for the group. Devices belonging to the same > > > > > group can not be bound to multiple iommufd_ctx. > > > > > > > > ... or shared between native kernel and vfio drivers. > > > > > > I suppose you mean the devices in one group are bound to different > > > drivers. right? > > > > Essentially, but we need to be careful that we're developing multiple > > vfio drivers for a given bus now, which is why I try to distinguish > > between the two sets of drivers. Thanks, > > Indeed. There are a set of vfio drivers. Even pci-stub can be considered > in this set? Perhaps, it is more precise to say : or shared between drivers > that set the struct pci_driver::driver_managed_dma flag and the drivers > that do not. Yeah, I wish there was a less technical way to describe this. This is essentially why we have the VIABLE flag on VFIO_GROUP_GET_STATUS in the legacy interface, which is what QEMU uses to generate the warning specific to binding all devices to vfio bus drivers. Technically there are some exceptions, like pci-stub or "no driver" that can be used to prevent direct access to devices within the group, but except for that narrow use case a vfio driver is generally recommended, and is currently required for certain things like the dev_set test during hot-reset. If we want to be accurate without being too pedantic, perhaps it would be something like "vfio bus driver or other driver supporting the driver_manged_dma flag". Note the flag is supported for several drivers other than pci_driver. Thanks, Alex