Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alex Williamson
On Sat, 2013-06-22 at 13:16 +1000, Alexey Kardashevskiy wrote: > On 06/22/2013 12:57 PM, Alex Williamson wrote: > > On Sat, 2013-06-22 at 12:44 +1000, Alexey Kardashevskiy wrote: > >> On 06/22/2013 11:26 AM, Alex Williamson wrote: > >>> On Sat, 2013-06-22 at 11:16 +1000, Alexey Kardashevskiy

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alexey Kardashevskiy
On 06/22/2013 12:57 PM, Alex Williamson wrote: > On Sat, 2013-06-22 at 12:44 +1000, Alexey Kardashevskiy wrote: >> On 06/22/2013 11:26 AM, Alex Williamson wrote: >>> On Sat, 2013-06-22 at 11:16 +1000, Alexey Kardashevskiy wrote: Cool, thanks! So we will need only this (to be called

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alex Williamson
On Sat, 2013-06-22 at 12:44 +1000, Alexey Kardashevskiy wrote: > On 06/22/2013 11:26 AM, Alex Williamson wrote: > > On Sat, 2013-06-22 at 11:16 +1000, Alexey Kardashevskiy wrote: > >> Cool, thanks! > >> > >> So we will need only this (to be called from KVM), and that will be it, > >> right? > >

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alexey Kardashevskiy
On 06/22/2013 11:26 AM, Alex Williamson wrote: > On Sat, 2013-06-22 at 11:16 +1000, Alexey Kardashevskiy wrote: >> Cool, thanks! >> >> So we will need only this (to be called from KVM), and that will be it, >> right? > > For what? This is not the external lock you're looking for. As I've >

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alex Williamson
On Sat, 2013-06-22 at 11:16 +1000, Alexey Kardashevskiy wrote: > Cool, thanks! > > So we will need only this (to be called from KVM), and that will be it, right? For what? This is not the external lock you're looking for. As I've mentioned, the file can only hold the group, but that doesn't

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alexey Kardashevskiy
Cool, thanks! So we will need only this (to be called from KVM), and that will be it, right? int vfio_group_iommu_id_from_file(struct file *filep) ... On 06/22/2013 07:12 AM, Alex Williamson wrote: > vfio_group_fops_open attempts to limit concurrent sessions by > disallowing opens once

[PATCH] vfio: Limit group opens

2013-06-21 Thread Alex Williamson
vfio_group_fops_open attempts to limit concurrent sessions by disallowing opens once group->container is set. This really doesn't do what we want and allow for inconsistent behavior, for instance a group can be opened twice, then a container set giving the user two file descriptors to the group.

[PATCH] vfio: Limit group opens

2013-06-21 Thread Alex Williamson
vfio_group_fops_open attempts to limit concurrent sessions by disallowing opens once group-container is set. This really doesn't do what we want and allow for inconsistent behavior, for instance a group can be opened twice, then a container set giving the user two file descriptors to the group.

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alexey Kardashevskiy
Cool, thanks! So we will need only this (to be called from KVM), and that will be it, right? int vfio_group_iommu_id_from_file(struct file *filep) ... On 06/22/2013 07:12 AM, Alex Williamson wrote: vfio_group_fops_open attempts to limit concurrent sessions by disallowing opens once

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alex Williamson
On Sat, 2013-06-22 at 11:16 +1000, Alexey Kardashevskiy wrote: Cool, thanks! So we will need only this (to be called from KVM), and that will be it, right? For what? This is not the external lock you're looking for. As I've mentioned, the file can only hold the group, but that doesn't give

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alexey Kardashevskiy
On 06/22/2013 11:26 AM, Alex Williamson wrote: On Sat, 2013-06-22 at 11:16 +1000, Alexey Kardashevskiy wrote: Cool, thanks! So we will need only this (to be called from KVM), and that will be it, right? For what? This is not the external lock you're looking for. As I've mentioned, the

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alex Williamson
On Sat, 2013-06-22 at 12:44 +1000, Alexey Kardashevskiy wrote: On 06/22/2013 11:26 AM, Alex Williamson wrote: On Sat, 2013-06-22 at 11:16 +1000, Alexey Kardashevskiy wrote: Cool, thanks! So we will need only this (to be called from KVM), and that will be it, right? For what? This

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alexey Kardashevskiy
On 06/22/2013 12:57 PM, Alex Williamson wrote: On Sat, 2013-06-22 at 12:44 +1000, Alexey Kardashevskiy wrote: On 06/22/2013 11:26 AM, Alex Williamson wrote: On Sat, 2013-06-22 at 11:16 +1000, Alexey Kardashevskiy wrote: Cool, thanks! So we will need only this (to be called from KVM), and

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alex Williamson
On Sat, 2013-06-22 at 13:16 +1000, Alexey Kardashevskiy wrote: On 06/22/2013 12:57 PM, Alex Williamson wrote: On Sat, 2013-06-22 at 12:44 +1000, Alexey Kardashevskiy wrote: On 06/22/2013 11:26 AM, Alex Williamson wrote: On Sat, 2013-06-22 at 11:16 +1000, Alexey Kardashevskiy wrote: Cool,