Re: [libvirt PATCH 01/15] util: properly deal with module vs. driver when binding device to driver

2023-10-23 Thread Jason Gunthorpe
On Mon, Oct 23, 2023 at 12:54:37AM -0400, Laine Stump wrote: > When we recently gained the ability to manually specify a driver to > bind to with virsh nodedev-detach, the fragility of this system became > apparent - if a user gives the driver name as "vfio_pci", then we > would modprobe the

Re: [PATCH v2 3/3] qom: Link multiple numa nodes to device using a new object

2023-10-17 Thread Jason Gunthorpe
On Tue, Oct 17, 2023 at 10:54:19AM -0600, Alex Williamson wrote: > On Tue, 17 Oct 2023 12:28:30 -0300 > Jason Gunthorpe wrote: > > > On Tue, Oct 17, 2023 at 09:21:16AM -0600, Alex Williamson wrote: > > > > > Do we therefore need some programatic means for the

Re: [PATCH v2 3/3] qom: Link multiple numa nodes to device using a new object

2023-10-17 Thread Jason Gunthorpe
On Tue, Oct 17, 2023 at 09:21:16AM -0600, Alex Williamson wrote: > Do we therefore need some programatic means for the kernel driver to > expose the node configuration to userspace? What interfaces would > libvirt like to see here? Is there an opportunity that this could > begin to define

Re: [PATCH v2] util: basic support for VFIO variant drivers

2023-06-01 Thread Jason Gunthorpe
On Wed, May 31, 2023 at 03:34:11PM -0600, Alex Williamson wrote: > device. It does not guarantee the vfio device API exposed to userspace > is vfio-pci. Therefore management tools should be cautious to make > assumptions about the type of device the VM will see even though we've > got vfio-pci

Re: [PATCH v2] util: basic support for VFIO variant drivers

2023-05-31 Thread Jason Gunthorpe
On Wed, May 31, 2023 at 02:40:01PM -0600, Alex Williamson wrote: > Also note that we're saying "vfio" not "vfio-pci". Only the mdev > interface has the device_api attribute to indicate the exported vfio > device interface. The "vfio_pci:" match in modalias indicates a vfio > PCI driver, not

Re: [PATCH v2] util: basic support for VFIO variant drivers

2023-05-31 Thread Jason Gunthorpe
On Wed, May 31, 2023 at 01:18:44PM -0400, Laine Stump wrote: > On 5/31/23 10:31 AM, Jason Gunthorpe wrote: > > On Wed, May 31, 2023 at 03:18:17PM +0100, Joao Martins wrote: > > > Hey Laine, > > > > > > On 23/08/2022 15:11, Laine Stump wrote: > > >

Re: [PATCH v2] util: basic support for VFIO variant drivers

2023-05-31 Thread Jason Gunthorpe
On Wed, May 31, 2023 at 03:18:17PM +0100, Joao Martins wrote: > Hey Laine, > > On 23/08/2022 15:11, Laine Stump wrote: > > ping. > > > > I have a different version of this patch where I do read the modules.alias > > file > > rather than just checking the name of the driver, but that also

Re: [PATCH] vfio/pci: Propagate ACPI notifications to the user-space

2023-03-09 Thread Jason Gunthorpe
On Wed, Mar 08, 2023 at 05:51:32PM -0800, Dominik Behr wrote: > All other ACPI events that are available to userspace are on netlink already. > As for translation of ACPI paths. It is sort of a requirement for VMM > to translate the PCI path from host to guest because the PCI device > tree in the

Re: [RFC PATCH 14/19] mm: Introduce a cgroup for pinned memory

2023-01-30 Thread Jason Gunthorpe
On Fri, Jan 27, 2023 at 11:44:19AM -1000, Tejun Heo wrote: > On Tue, Jan 24, 2023 at 04:42:43PM +1100, Alistair Popple wrote: > > If too much memory in a system is pinned or locked it can lead to > > problems such as performance degredation or in the worst case > > out-of-memory errors as such

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 > >

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 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? > >>> > >>>

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-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 ap

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. > > &

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-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: &

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: &

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

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 > /d

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 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