On Mon, Feb 5, 2018 at 5:40 PM, Alex Williamson <alex.williamson@xxxxxxxxxx> wrote: > On Mon, 5 Feb 2018 15:58:22 +0200 > Ran Shalit <ranshalit@xxxxxxxxx> wrote: > >> Hello, >> >> >> I can't find in uio_pci_generic.c any usage of DMA. >> Is it that the driver does not use DMA in transactions between device >> and host ? If not - isn't it a sort disadvantage ? > > AIUI, uio_pci_generic doesn't officially support DMA because there's no > way that a userspace driver can safely support DMA without an IOMMU > isolating the device. Otherwise the userspace driver can use the > device to read and write data anywhere it wants, which is also sort of > a disadvantage. Of course this doesn't seem to stop anyone from doing > DMA with uio_pci_generic, but you're not likely to get much support for > such uses. Instead, you might want to be looking at vfio, which does > make use of (and require) IOMMU support in order to more safely allow > userspace drivers to use DMA. Thanks, > Thanks you very much Alex. I will check vfio. I would like to ask one mote thing on the issue of generic pci uio: I also did not find in https://elixir.free-electrons.com/linux/v4.15.1/source/Documentation/ABI/testing/sysfs-bus-pci that there is "irq" for registering irq, only msi-irq, which I don't think it is the same. Yet, in code it seems to use irq. https://elixir.free-electrons.com/linux/v4.3/source/drivers/uio/uio_pci_generic.c I also see in wiki guide & example that irq can be used in userspace (in the code example there is a wait for interrupt): https://www.kernel.org/doc/html/v4.12/driver-api/uio-howto.html Yet, unfortunately the same wiki did not show how to register irq from userspace. Is that possible ? How ? Should it be done with something like: echo "3" > /sys/bus/pci/drivers/uio_pci_generic/irq Thank you. Ran > Alex