Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-10-21 Thread Jason Gunthorpe
On Fri, Sep 23, 2022 at 11:40:51AM -0400, Laine Stump wrote: > It's been a few years, but my recollection is that before starting a > libvirtd that will run a guest with a vfio device, a privileged process > needs to > > 1) increase the locked memory limit for the user that will be running qemu >

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-10-12 Thread Jason Gunthorpe
On Wed, Oct 12, 2022 at 10:55:57AM -0400, Steven Sistare wrote: > On 10/12/2022 10:40 AM, Jason Gunthorpe wrote: > > On Wed, Oct 12, 2022 at 09:50:53AM -0400, Steven Sistare wrote: > > > >>> Anyhow, I think this conversation has convinced me there is no way to > >>> fix VFIO_DMA_UNMAP_FLAG_VADDR.

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-10-12 Thread Steven Sistare
On 10/12/2022 10:40 AM, Jason Gunthorpe wrote: > On Wed, Oct 12, 2022 at 09:50:53AM -0400, Steven Sistare wrote: > >>> Anyhow, I think this conversation has convinced me there is no way to >>> fix VFIO_DMA_UNMAP_FLAG_VADDR. I'll send a patch reverting it due to >>> it being a security bug,

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-10-12 Thread Jason Gunthorpe
On Wed, Oct 12, 2022 at 09:50:53AM -0400, Steven Sistare wrote: > > Anyhow, I think this conversation has convinced me there is no way to > > fix VFIO_DMA_UNMAP_FLAG_VADDR. I'll send a patch reverting it due to > > it being a security bug, basically. > > Please do not. Please give me the

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-10-12 Thread Steven Sistare
On 10/12/2022 8:32 AM, Jason Gunthorpe wrote: > On Tue, Oct 11, 2022 at 04:30:58PM -0400, Steven Sistare wrote: >> On 10/11/2022 8:30 AM, Jason Gunthorpe wrote: >>> On Mon, Oct 10, 2022 at 04:54:50PM -0400, Steven Sistare wrote: > Do we have a solution to this? > > If not I would like

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-10-12 Thread Jason Gunthorpe
On Tue, Oct 11, 2022 at 04:30:58PM -0400, Steven Sistare wrote: > On 10/11/2022 8:30 AM, Jason Gunthorpe wrote: > > On Mon, Oct 10, 2022 at 04:54:50PM -0400, Steven Sistare wrote: > >>> Do we have a solution to this? > >>> > >>> If not I would like to make a patch removing

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-10-11 Thread Steven Sistare
On 10/11/2022 8:30 AM, Jason Gunthorpe wrote: > On Mon, Oct 10, 2022 at 04:54:50PM -0400, Steven Sistare wrote: >>> Do we have a solution to this? >>> >>> If not I would like to make a patch removing VFIO_DMA_UNMAP_FLAG_VADDR >>> >>> Aside from the approach to use the FD, another idea is to just

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-10-11 Thread Jason Gunthorpe
On Mon, Oct 10, 2022 at 04:54:50PM -0400, Steven Sistare wrote: > > Do we have a solution to this? > > > > If not I would like to make a patch removing VFIO_DMA_UNMAP_FLAG_VADDR > > > > Aside from the approach to use the FD, another idea is to just use > > fork. > > > > qemu would do something

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-10-10 Thread Steven Sistare
On 10/6/2022 12:01 PM, Jason Gunthorpe wrote: > On Wed, Sep 21, 2022 at 08:09:54PM -0300, Jason Gunthorpe wrote: >> On Wed, Sep 21, 2022 at 03:30:55PM -0400, Steven Sistare wrote: >> If Steve wants to keep it then someone needs to fix the deadlock in the vfio implementation before any

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-10-06 Thread Steven Sistare
On 10/6/2022 12:01 PM, Jason Gunthorpe wrote: > On Wed, Sep 21, 2022 at 08:09:54PM -0300, Jason Gunthorpe wrote: >> On Wed, Sep 21, 2022 at 03:30:55PM -0400, Steven Sistare wrote: >> If Steve wants to keep it then someone needs to fix the deadlock in the vfio implementation before any

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-10-06 Thread Jason Gunthorpe
On Wed, Sep 21, 2022 at 08:09:54PM -0300, Jason Gunthorpe wrote: > On Wed, Sep 21, 2022 at 03:30:55PM -0400, Steven Sistare wrote: > > > > If Steve wants to keep it then someone needs to fix the deadlock in > > > the vfio implementation before any userspace starts to appear. > > > > The only

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-26 Thread David Gibson
On Fri, Sep 23, 2022 at 08:03:07AM -0600, Alex Williamson wrote: > On Fri, 23 Sep 2022 10:29:41 -0300 > Jason Gunthorpe wrote: > > > On Fri, Sep 23, 2022 at 09:54:48AM +0100, Daniel P. Berrangé wrote: > > > > > Yes, we use cgroups extensively already. > > > > Ok, I will try to see about this

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-23 Thread Laine Stump
On 9/23/22 10:00 AM, Daniel P. Berrangé wrote: On Fri, Sep 23, 2022 at 10:46:21AM -0300, Jason Gunthorpe wrote: On Fri, Sep 23, 2022 at 02:35:20PM +0100, Daniel P. Berrangé wrote: On Fri, Sep 23, 2022 at 10:29:41AM -0300, Jason Gunthorpe wrote: On Fri, Sep 23, 2022 at 09:54:48AM +0100, Daniel

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-23 Thread Alex Williamson
On Fri, 23 Sep 2022 10:29:41 -0300 Jason Gunthorpe wrote: > On Fri, Sep 23, 2022 at 09:54:48AM +0100, Daniel P. Berrangé wrote: > > > Yes, we use cgroups extensively already. > > Ok, I will try to see about this > > Can you also tell me if the selinux/seccomp will prevent qemu from >

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-23 Thread Daniel P . Berrangé
On Fri, Sep 23, 2022 at 10:46:21AM -0300, Jason Gunthorpe wrote: > On Fri, Sep 23, 2022 at 02:35:20PM +0100, Daniel P. Berrangé wrote: > > On Fri, Sep 23, 2022 at 10:29:41AM -0300, Jason Gunthorpe wrote: > > > On Fri, Sep 23, 2022 at 09:54:48AM +0100, Daniel P. Berrangé wrote: > > > > > > > Yes,

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-23 Thread Jason Gunthorpe
On Fri, Sep 23, 2022 at 02:35:20PM +0100, Daniel P. Berrangé wrote: > On Fri, Sep 23, 2022 at 10:29:41AM -0300, Jason Gunthorpe wrote: > > On Fri, Sep 23, 2022 at 09:54:48AM +0100, Daniel P. Berrangé wrote: > > > > > Yes, we use cgroups extensively already. > > > > Ok, I will try to see about

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-23 Thread Daniel P . Berrangé
On Fri, Sep 23, 2022 at 10:29:41AM -0300, Jason Gunthorpe wrote: > On Fri, Sep 23, 2022 at 09:54:48AM +0100, Daniel P. Berrangé wrote: > > > Yes, we use cgroups extensively already. > > Ok, I will try to see about this > > Can you also tell me if the selinux/seccomp will prevent qemu from >

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-23 Thread Jason Gunthorpe
On Fri, Sep 23, 2022 at 09:54:48AM +0100, Daniel P. Berrangé wrote: > Yes, we use cgroups extensively already. Ok, I will try to see about this Can you also tell me if the selinux/seccomp will prevent qemu from opening more than one /dev/vfio/vfio ? I suppose the answer is no? Thanks, Jason

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-23 Thread Daniel P . Berrangé
On Thu, Sep 22, 2022 at 12:31:20PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 22, 2022 at 04:00:00PM +0100, Daniel P. Berrangé wrote: > > On Thu, Sep 22, 2022 at 11:51:54AM -0300, Jason Gunthorpe wrote: > > > On Thu, Sep 22, 2022 at 03:49:02PM +0100, Daniel P. Berrangé wrote: > > > > On Thu, Sep

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-22 Thread Jason Gunthorpe
On Thu, Sep 22, 2022 at 04:00:00PM +0100, Daniel P. Berrangé wrote: > On Thu, Sep 22, 2022 at 11:51:54AM -0300, Jason Gunthorpe wrote: > > On Thu, Sep 22, 2022 at 03:49:02PM +0100, Daniel P. Berrangé wrote: > > > On Thu, Sep 22, 2022 at 11:08:23AM -0300, Jason Gunthorpe wrote: > > > > On Thu, Sep

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-22 Thread Daniel P . Berrangé
On Thu, Sep 22, 2022 at 11:51:54AM -0300, Jason Gunthorpe wrote: > On Thu, Sep 22, 2022 at 03:49:02PM +0100, Daniel P. Berrangé wrote: > > On Thu, Sep 22, 2022 at 11:08:23AM -0300, Jason Gunthorpe wrote: > > > On Thu, Sep 22, 2022 at 12:20:50PM +0100, Daniel P. Berrangé wrote: > > > > On Wed, Sep

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-22 Thread Jason Gunthorpe
On Thu, Sep 22, 2022 at 03:49:02PM +0100, Daniel P. Berrangé wrote: > On Thu, Sep 22, 2022 at 11:08:23AM -0300, Jason Gunthorpe wrote: > > On Thu, Sep 22, 2022 at 12:20:50PM +0100, Daniel P. Berrangé wrote: > > > On Wed, Sep 21, 2022 at 03:44:24PM -0300, Jason Gunthorpe wrote: > > > > On Wed, Sep

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-22 Thread Daniel P . Berrangé
On Thu, Sep 22, 2022 at 11:08:23AM -0300, Jason Gunthorpe wrote: > On Thu, Sep 22, 2022 at 12:20:50PM +0100, Daniel P. Berrangé wrote: > > On Wed, Sep 21, 2022 at 03:44:24PM -0300, Jason Gunthorpe wrote: > > > On Wed, Sep 21, 2022 at 12:06:49PM -0600, Alex Williamson wrote: > > > > The issue is

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-22 Thread Daniel P . Berrangé
On Thu, Sep 22, 2022 at 11:13:42AM -0300, Jason Gunthorpe wrote: > On Thu, Sep 22, 2022 at 12:06:33PM +0100, Daniel P. Berrangé wrote: > > > So per-user locked mem accounting looks like a regression in > > our VM isolation abilities compared to the per-task accounting. > > For this kind of API

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-22 Thread Jason Gunthorpe
On Thu, Sep 22, 2022 at 12:06:33PM +0100, Daniel P. Berrangé wrote: > So per-user locked mem accounting looks like a regression in > our VM isolation abilities compared to the per-task accounting. For this kind of API the management app needs to put each VM in its own user, which I'm a bit

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-22 Thread Jason Gunthorpe
On Thu, Sep 22, 2022 at 12:20:50PM +0100, Daniel P. Berrangé wrote: > On Wed, Sep 21, 2022 at 03:44:24PM -0300, Jason Gunthorpe wrote: > > On Wed, Sep 21, 2022 at 12:06:49PM -0600, Alex Williamson wrote: > > > The issue is where we account these pinned pages, where accounting is > > > necessary

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-22 Thread Daniel P . Berrangé
On Wed, Sep 21, 2022 at 03:44:24PM -0300, Jason Gunthorpe wrote: > On Wed, Sep 21, 2022 at 12:06:49PM -0600, Alex Williamson wrote: > > The issue is where we account these pinned pages, where accounting is > > necessary such that a user cannot lock an arbitrary number of pages > > into RAM to

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-22 Thread Daniel P . Berrangé
On Wed, Sep 21, 2022 at 12:06:49PM -0600, Alex Williamson wrote: > [Cc+ Steve, libvirt, Daniel, Laine] > > On Tue, 20 Sep 2022 16:56:42 -0300 > Jason Gunthorpe wrote: > > That really just leaves the accounting, and I'm still not convinced at > > this must be a critical thing. Linus's latest

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-22 Thread Steven Sistare
On 9/21/2022 2:44 PM, Jason Gunthorpe wrote: > On Wed, Sep 21, 2022 at 12:06:49PM -0600, Alex Williamson wrote: > >>> I still think the compat gaps are small. I've realized that >>> VFIO_DMA_UNMAP_FLAG_VADDR has no implementation in qemu, and since it >>> can deadlock the kernel I propose we

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-21 Thread Jason Gunthorpe
On Wed, Sep 21, 2022 at 03:44:24PM -0300, Jason Gunthorpe wrote: > If /dev/vfio/vfio is provided by iommufd it may well have to trigger a > different ulimit tracking - if that is the only sticking point it > seems minor and should be addressed in some later series that adds > /dev/vfio/vfio

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-21 Thread Jason Gunthorpe
On Wed, Sep 21, 2022 at 03:30:55PM -0400, Steven Sistare wrote: > > If Steve wants to keep it then someone needs to fix the deadlock in > > the vfio implementation before any userspace starts to appear. > > The only VFIO_DMA_UNMAP_FLAG_VADDR issue I am aware of is broken pinned > accounting >

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-21 Thread Laine Stump
On 9/21/22 2:06 PM, Alex Williamson wrote: [Cc+ Steve, libvirt, Daniel, Laine] On Tue, 20 Sep 2022 16:56:42 -0300 Jason Gunthorpe wrote: On Tue, Sep 13, 2022 at 09:28:18AM +0200, Eric Auger wrote: Hi, On 9/13/22 03:55, Tian, Kevin wrote: We didn't close the open of how to get this merged

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-21 Thread Jason Gunthorpe
On Wed, Sep 21, 2022 at 12:06:49PM -0600, Alex Williamson wrote: > > I still think the compat gaps are small. I've realized that > > VFIO_DMA_UNMAP_FLAG_VADDR has no implementation in qemu, and since it > > can deadlock the kernel I propose we purge it completely. > > Steve won't be happy to

Re: [PATCH RFC v2 00/13] IOMMUFD Generic interface

2022-09-21 Thread Alex Williamson
[Cc+ Steve, libvirt, Daniel, Laine] On Tue, 20 Sep 2022 16:56:42 -0300 Jason Gunthorpe wrote: > On Tue, Sep 13, 2022 at 09:28:18AM +0200, Eric Auger wrote: > > Hi, > > > > On 9/13/22 03:55, Tian, Kevin wrote: > > > We didn't close the open of how to get this merged in LPC due to the > > >