Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Michael S. Tsirkin
Date: Wednesday, June 2, 2010 - 6:17 am

On Wed, Jun 02, 2010 at 02:50:50PM +0200, Joerg Roedel wrote:

The reason it is more intuitive is because it is harder to get it
wrong. If you swap iommu and device in the call, you get BADF
so you know you made a mistake. We can even make it work
both ways if we wanted to. With ioctl(dev1, BIND, dev2)
it breaks silently.



And then when we assign meaning to it we find that half the apps
are broken because they did not call this ioctl.


This simple scenario ignores all the real-life corner cases.
For example, with an explicit iommu open and bind application
can naturally detect that:
- we have run out of iommu domains
- iommu is unsupported
- iommu is in use by another, incompatible device
- device is in bad state
because each is a separate operation, so it is easy to produce meaningful
errors.

Another interesting thing that a separate iommu device supports is when
application A controls the iommu and application B
controls the device. This might be good to e.g. improve security
(B is run by root, A is unpriveledged and passes commands to/from B
 over a pipe).

This is not possible when same fd is used for iommu and device.

-- 
MST
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Sun May 30, 5:19 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Sun May 30, 5:49 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Sun May 30, 6:03 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Sun May 30, 7:53 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Mon May 31, 10:10 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Tue Jun 1, 3:46 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Wed Jun 2, 2:53 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Wed Jun 2, 3:09 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Wed Jun 2, 3:15 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Wed Jun 2, 3:21 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Wed Jun 2, 3:38 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Wed Jun 2, 3:44 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Wed Jun 2, 4:21 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Wed Jun 2, 5:34 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Wed Jun 2, 6:17 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Sun Jun 6, 2:54 am)
Re: [PATCH] VFIO driver: Non-privileged user level PCI drivers, Michael S. Tsirkin, (Tue Jun 8, 2:22 pm)