Re: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-24 Thread Nicolin Chen
On Thu, Apr 24, 2025 at 10:40:49AM -0300, Jason Gunthorpe wrote: > On Wed, Apr 23, 2025 at 11:51:53PM -0700, Nicolin Chen wrote: > > On Wed, Apr 23, 2025 at 08:13:33PM -0300, Jason Gunthorpe wrote: > > > On Wed, Apr 23, 2025 at 11:31:29AM -0700, Nicolin Chen wrote: > > > > > > > > It also needs to

Re: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-24 Thread Jason Gunthorpe
On Wed, Apr 23, 2025 at 11:51:53PM -0700, Nicolin Chen wrote: > On Wed, Apr 23, 2025 at 08:13:33PM -0300, Jason Gunthorpe wrote: > > On Wed, Apr 23, 2025 at 11:31:29AM -0700, Nicolin Chen wrote: > > > > > > It also needs to act like a mdev and lock down the part of the IOAS > > > > that provides t

RE: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-24 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Thursday, April 24, 2025 2:52 PM > > On Wed, Apr 23, 2025 at 08:13:33PM -0300, Jason Gunthorpe wrote: > > On Wed, Apr 23, 2025 at 11:31:29AM -0700, Nicolin Chen wrote: > > > > > > It also needs to act like a mdev and lock down the part of the IOAS > > > > that provide

Re: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-23 Thread Nicolin Chen
On Wed, Apr 23, 2025 at 08:13:33PM -0300, Jason Gunthorpe wrote: > On Wed, Apr 23, 2025 at 11:31:29AM -0700, Nicolin Chen wrote: > > > > It also needs to act like a mdev and lock down the part of the IOAS > > > that provides that memory so the pin can't be released and UAF things. > > > > If I ca

Re: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-23 Thread Jason Gunthorpe
On Wed, Apr 23, 2025 at 11:31:29AM -0700, Nicolin Chen wrote: > > It also needs to act like a mdev and lock down the part of the IOAS > > that provides that memory so the pin can't be released and UAF things. > > If I capture this correctly, the GPA->PA mapping is already done > at the IOAS level

Re: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-23 Thread Nicolin Chen
On Wed, Apr 23, 2025 at 08:55:51AM -0300, Jason Gunthorpe wrote: > On Wed, Apr 23, 2025 at 08:05:49AM +, Tian, Kevin wrote: > > > It's not a good idea having the kernel trust the VMM. > > It certainly shouldn't trust it, but it can validate the VMM's choice > and generate a failure if it isn

Re: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-23 Thread Jason Gunthorpe
On Wed, Apr 23, 2025 at 08:05:49AM +, Tian, Kevin wrote: > It's not a good idea having the kernel trust the VMM. It certainly shouldn't trust it, but it can validate the VMM's choice and generate a failure if it isn't good. > Also I'm not > sure the contiguity is guaranteed all the time wit

RE: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-23 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Tuesday, April 22, 2025 3:14 AM > On Mon, Apr 21, 2025 at 08:37:40AM +, Tian, Kevin wrote: > > > From: Nicolin Chen > > > Sent: Friday, April 11, 2025 2:38 PM > > > > > > + > > > + vcmdq = iommufd_vcmdq_alloc(viommu, struct tegra241_vcmdq, > > > core); > > > + if

Re: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-21 Thread Nicolin Chen
On Mon, Apr 21, 2025 at 08:37:40AM +, Tian, Kevin wrote: > > From: Nicolin Chen > > Sent: Friday, April 11, 2025 2:38 PM > > > > Add the support via vIOMMU infrastructure for virtualization use case. > > > > This basically allows VMM to allocate VINTFs (as a vIOMMU object) and > > assign VCM

RE: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-21 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Friday, April 11, 2025 2:38 PM > > Add the support via vIOMMU infrastructure for virtualization use case. > > This basically allows VMM to allocate VINTFs (as a vIOMMU object) and > assign VCMDQs (vCMDQ objects) to it. A VINTF's MMIO page0 can be > mmap'd > to user s