On Mon, May 05, 2025 at 02:28:13PM -0300, Jason Gunthorpe wrote:
> On Mon, May 05, 2025 at 10:21:03AM -0700, Nicolin Chen wrote:
> > > > > +void iommufd_ctx_free_mmap(struct iommufd_ctx *ictx, unsigned long
> > > > > immap_id)
> > > > > +{
On Mon, May 05, 2025 at 01:50:19PM -0300, Jason Gunthorpe wrote:
> On Mon, Apr 28, 2025 at 10:50:32AM +0800, Baolu Lu wrote:
> > On 4/26/25 13:58, Nicolin Chen wrote:
> > > +/* Entry for iommufd_ctx::mt_mmap */
> > > +struct iommufd_mmap {
> > > + unsigned l
On Mon, May 05, 2025 at 01:55:52PM -0300, Jason Gunthorpe wrote:
> On Tue, Apr 29, 2025 at 02:46:25PM -0700, Nicolin Chen wrote:
> > > > > > > > > + immap = kzalloc(sizeof(*immap), GFP_KERNEL);
> > > > > > > > > + i
On Mon, May 05, 2025 at 02:31:01PM -0300, Jason Gunthorpe wrote:
> On Mon, May 05, 2025 at 10:27:30AM -0700, Nicolin Chen wrote:
> > > So when calling mtree_alloc_range:
> > >
> > > int mtree_alloc_range(struct maple_tree *mt, unsigned long *startp,
> > >
On Tue, May 06, 2025 at 09:36:38AM +, Tian, Kevin wrote:
> > From: Nicolin Chen
> > Sent: Saturday, April 26, 2025 1:58 PM
> >
> > The new vCMDQ object will be added for HW to access the guest memory for
> > a
> > HW-accelerated virtualization feature.
On Tue, May 06, 2025 at 09:52:22AM -0300, Jason Gunthorpe wrote:
> On Mon, May 05, 2025 at 12:50:56PM -0700, Nicolin Chen wrote:
>
> > I wanted to ask: what should we pass in to the "entry"? An mmap
> > structure that hold the pfn range? Or just pfn_start?
>
&g
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
On Thu, Apr 24, 2025 at 08:21:08AM +, Tian, Kevin wrote:
> > From: Nicolin Chen
> > Sent: Friday, April 11, 2025 2:38 PM
> >
> [...]
> > This is a big
> > improvement since there is no VM Exit during an invalidation, compared to
> > the traditional i
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:
> > &g
On Tue, Apr 29, 2025 at 11:04:06AM +0530, Vasant Hegde wrote:
> On 4/29/2025 1:32 AM, Nicolin Chen wrote:
> > On Mon, Apr 28, 2025 at 05:42:27PM +0530, Vasant Hegde wrote:
> >>> +/**
> >>> + * struct iommu_vcmdq_alloc - ioctl(IOMMU_VCMDQ_ALLOC)
> >>&g
would not be a good fit in the new iopt_unpin_pages(), thus change them to
use WARN_ON_ONCE instead.
Rename check_area_prot() to align with the existing iopt_area helpers, and
inline it to the header since iommufd_access_rw() still uses it.
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd
The new type of vIOMMU for tegra241-cmdqv driver needs a driver-specific
user data. So, add data_len/uptr to the iommu_viommu_alloc uAPI and pass
it in via the viommu_alloc iommu op.
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
include/uapi/linux/iommufd.h | 6 ++
drivers
The new type of vIOMMU for tegra241-cmdqv needs to pass in a driver-level
data structure from user space via iommufd, so add a user_data to the op.
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 3 ++-
include/linux/iommu.h
Similar to the iommu_copy_struct_from_user helper receiving data from the
user space, add an iommu_copy_struct_to_user helper to report output data
back to the user space data pointer.
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
include/linux/iommu.h | 40
Introduce a new IOMMUFD_CMD_VCMDQ_ALLOC ioctl for user space to allocate
a vCMDQ for a vIOMMU object. Simply increase the refcount of the vIOMMU.
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_private.h | 2 +
include/uapi/linux/iommufd.h| 41 +++
drivers
case.
Signed-off-by: Nicolin Chen
---
include/linux/iommufd.h| 47 ++
drivers/iommu/iommufd/driver.c | 28
2 files changed, 75 insertions(+)
diff --git a/include/linux/iommufd.h b/include/linux/iommufd.h
index e91381aaec5a..5dff154e8ce1 1
: iommufd_ctx_alloc_mmap() and iommufd_ctx_free_mmap().
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_private.h | 8 +
include/linux/iommufd.h | 15 ++
drivers/iommu/iommufd/driver.c | 39 +
drivers/iommu/iommufd/main.c| 39
g can complicate the timing of
calling tegra241_vcmdq_hw_init/deinit(), which write LVCMDQ address space,
i.e. requiring LVCMDQ to be mapped. Highlight that with a note to the top
of either of them.
Signed-off-by: Nicolin Chen
---
.../iommu/arm/arm-smmu-v3/tegra241-cmdqv.c| 37 +--
1
Extend the loopback test to a new mmap page.
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_test.h| 4 +++
drivers/iommu/iommufd/selftest.c| 37 ++---
tools/testing/selftests/iommu/iommufd.c | 5
3 files changed, 42 insertions(+), 4
With the introduction of the new object and its infrastructure, update the
doc to reflect that.
Signed-off-by: Nicolin Chen
---
Documentation/userspace-api/iommufd.rst | 14 ++
1 file changed, 14 insertions(+)
diff --git a/Documentation/userspace-api/iommufd.rst
b/Documentation
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 15 +
include/uapi/linux/iommufd.h | 49 ++-
.../arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 6 +-
.../iommu/arm/arm-smmu-v3/tegra241-cmdqv.c| 374 +-
4 files changed, 435 i
Add a new vEVENTQ type for VINTFs that are assigned to the user space.
Simply report the two 64-bit LVCMDQ_ERR_MAPs register values.
Signed-off-by: Nicolin Chen
---
include/uapi/linux/iommufd.h | 15 +
.../iommu/arm/arm-smmu-v3/tegra241-cmdqv.c| 22
in the driver-level, add an hw_info impl op that will return such
a flag to use the impl field.
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 1 +
include/uapi/linux/iommufd.h | 4 ++--
.../iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 16
. Release all LVCMDQ SW resources
Drop tegra241_vintf_remove_lvcmdq(), and move tegra241_vintf_free_lvcmdq()
as the new step 2.
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 13 +++--
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers
A vIRQ can be reported only from a threaded IRQ context. Change to use
to request_threaded_irq to support that.
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/arm/arm-smmu-v3
Add a simple user_data for an input-to-output loopback test.
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_test.h | 13 +
drivers/iommu/iommufd/selftest.c | 19 +++
2 files changed, 32 insertions(+)
diff --git a/drivers/iommu/iommufd
fer
Inroduce a struct iommufd_vcmdq and its allocator iommufd_vcmdq_alloc().
Also add a pair of viommu ops for iommufd to forward user space ioctls to
IOMMU drivers.
Signed-off-by: Nicolin Chen
---
include/linux/iommufd.h | 35 +++
1 file changed, 35 insertions(+
On Mon, Apr 28, 2025 at 09:32:04AM +0800, Baolu Lu wrote:
> On 4/26/25 13:58, Nicolin Chen wrote:
> > +int iommufd_vcmdq_alloc_ioctl(struct iommufd_ucmd *ucmd)
> > +{
> > + struct iommu_vcmdq_alloc *cmd = ucmd->cmd;
> > + struct iommufd_viommu *viommu;
>
On Mon, Apr 28, 2025 at 09:31:31PM +0700, Bagas Sanjaya wrote:
> On Fri, Apr 25, 2025 at 10:58:10PM -0700, Nicolin Chen wrote:
> > +- IOMMUFD_OBJ_VCMDQ, representing a hardware queue as a subset of a
> > vIOMMU's
> > + virtualization feature for a VM to dir
On Mon, Apr 28, 2025 at 05:42:27PM +0530, Vasant Hegde wrote:
> > +/**
> > + * struct iommu_vcmdq_alloc - ioctl(IOMMU_VCMDQ_ALLOC)
> > + * @size: sizeof(struct iommu_vcmdq_alloc)
> > + * @flags: Must be 0
> > + * @viommu_id: Virtual IOMMU ID to associate the virtual command queue with
> > + * @type
On Mon, Apr 28, 2025 at 12:41:33AM +, Tian, Kevin wrote:
> > From: Baolu Lu
> > Sent: Sunday, April 27, 2025 2:24 PM
> >
> > On 4/26/25 13:57, Nicolin Chen wrote:
> > > @@ -120,6 +128,13 @@ struct iommufd_viommu {
> > >*array-
On Mon, Apr 28, 2025 at 09:09:19AM +0800, Baolu Lu wrote:
> On 4/26/25 13:58, Nicolin Chen wrote:
> > Add a new IOMMUFD_OBJ_VCMDQ with an iommufd_vcmdq structure, representing
> > a command queue type of physical HW passed to a user space VM. This vCMDQ
> > object, is a subse
On Mon, Apr 28, 2025 at 10:22:09AM +0800, Baolu Lu wrote:
> On 4/26/25 13:58, Nicolin Chen wrote:
> > NVIDIA Virtual Command Queue is one of the iommufd users exposing vIOMMU
> > features to user space VMs. Its hardware has a strict rule when mapping
> > and unmapping mult
On Mon, Apr 28, 2025 at 05:50:28PM +, Pranjal Shrivastava wrote:
> On Fri, Apr 25, 2025 at 10:57:59PM -0700, Nicolin Chen wrote:
> > Similar to the iommu_copy_struct_from_user helper receiving data from the
> > user space, add an iommu_copy_struct_to_user helper to report outpu
On Mon, Apr 28, 2025 at 10:50:32AM +0800, Baolu Lu wrote:
> On 4/26/25 13:58, Nicolin Chen wrote:
> > For vIOMMU passing through HW resources to user space (VMs), add an mmap
> > infrastructure to map a region of hardware MMIO pages.
> >
> > Maintain an mt_mmap per ict
On Tue, Apr 29, 2025 at 12:40:07PM +, Pranjal Shrivastava wrote:
> On Fri, Apr 25, 2025 at 10:58:06PM -0700, Nicolin Chen wrote:
> > /* Caller should xa_lock(&viommu->vdevs) to protect the return value */
> > struct device *iommufd_viommu_find_dev(struct
On Tue, Apr 29, 2025 at 03:52:48PM +0530, Vasant Hegde wrote:
> On 4/29/2025 12:15 PM, Nicolin Chen wrote:
> > On Tue, Apr 29, 2025 at 11:04:06AM +0530, Vasant Hegde wrote:
> >> On 4/29/2025 1:32 AM, Nicolin Chen wrote:
> >>> On Mon, Apr 28, 2025 at 05:42:27PM +0530,
On Tue, Apr 29, 2025 at 05:59:32PM +, Pranjal Shrivastava wrote:
> On Tue, Apr 29, 2025 at 10:10:28AM -0700, Nicolin Chen wrote:
> > On Tue, Apr 29, 2025 at 12:40:07PM +, Pranjal Shrivastava wrote:
> > > On Fri, Apr 25, 2025 at 10:58:06PM -0700, Nicolin Chen wrote:
On Tue, Apr 29, 2025 at 06:10:31PM +, Pranjal Shrivastava wrote:
> On Tue, Apr 29, 2025 at 08:28:01AM +, Pranjal Shrivastava wrote:
> > On Mon, Apr 28, 2025 at 03:44:08PM -0700, Nicolin Chen wrote:
> > > On Mon, Apr 28, 2025 at 09:34:05PM +, Pranjal Shrivastava wro
On Tue, Apr 29, 2025 at 08:34:56PM +, Pranjal Shrivastava wrote:
> On Tue, Apr 29, 2025 at 08:24:33PM +, Pranjal Shrivastava wrote:
> > On Fri, Apr 25, 2025 at 10:58:08PM -0700, Nicolin Chen wrote:
> > > + struct iommufd_mmap *immap;
> > > + int rc;
>
On Tue, Apr 29, 2025 at 08:55:47PM +, Pranjal Shrivastava wrote:
> On Tue, Apr 29, 2025 at 01:39:09PM -0700, Nicolin Chen wrote:
> > On Tue, Apr 29, 2025 at 08:34:56PM +, Pranjal Shrivastava wrote:
> > > On Tue, Apr 29, 2025 at 08:24:33PM +, Pranjal Shrivastava wro
On Wed, Apr 30, 2025 at 01:17:48AM +0530, ALOK TIWARI wrote:
> > + /*
> > +* @length must be a power of 2, in range of
> > +* [ 32, 1 ^ (idr[1].CMDQS + CMDQ_ENT_SZ_SHIFT) ]
>
> 2 ^ (idr[1].CMDQS + CMDQ_ENT_SZ_SHIFT) or 1 << idr[1].CMDQS
>
> > +*/
> > + max_n_shift = FIELD_GET(ID
change @min_last in mock_viommu_alloc()
* [iommufd] Generalize TEGRA241_VCMDQ data in core structure
* [iommufd] Add selftest coverage for IOMMUFD_CMD_VCMDQ_ALLOC
* [iommufd] Add iopt_pin_pages() to prevent queue memory from unmapping
v1
https://lore.kernel.org/all/cover.1744353300.git.nicol...@nv
Similar to the iommu_copy_struct_from_user helper receiving data from the
user space, add an iommu_copy_struct_to_user helper to report output data
back to the user space data pointer.
Reviewed-by: Jason Gunthorpe
Reviewed-by: Lu Baolu
Reviewed-by: Pranjal Shrivastava
Signed-off-by: Nicolin
Gunthorpe
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_private.h | 8 --
include/linux/iommufd.h | 38 +
drivers/iommu/iommufd/viommu.c | 9 +-
3 files changed, 46 insertions(+), 9 deletions(-)
diff --git a/drivers/iommu
-off-by: Nicolin Chen
---
include/uapi/linux/iommufd.h | 6 ++
drivers/iommu/iommufd/viommu.c | 8 +++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/iommufd.h b/include/uapi/linux/iommufd.h
index f29b6c44655e..cc90299a08d9 100644
--- a/include/uapi
Gunthorpe
Reviewed-by: Lu Baolu
Reviewed-by: Pranjal Shrivastava
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 3 ++-
include/linux/iommu.h | 3 ++-
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 3 ++-
drivers/iommu
(), in order to ease
a new vIOMMU-based helper that would then get the ictx from viommu->ictx.
Signed-off-by: Nicolin Chen
---
include/linux/iommufd.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/iommufd.h b/include/linux/iommufd.h
index 422eda95d19e..dc6
Extend the existing test_cmd/err_viommu_alloc helpers to accept optional
user data. And add a TEST_F for a loopback test.
Reviewed-by: Pranjal Shrivastava
Signed-off-by: Nicolin Chen
---
tools/testing/selftests/iommu/iommufd_utils.h | 21 -
tools/testing/selftests/iommu/iommufd.c
y increase the refcount of the vIOMMU.
Reviewed-by: Pranjal Shrivastava
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_private.h | 2 +
include/uapi/linux/iommufd.h| 44 +++
drivers/iommu/iommufd/main.c| 6 ++
drivers/iommu/iommufd/viommu.c
: Nicolin Chen
---
drivers/iommu/iommufd/io_pagetable.h| 8 ++
drivers/iommu/iommufd/iommufd_private.h | 6 ++
drivers/iommu/iommufd/device.c | 117 ++--
drivers/iommu/iommufd/io_pagetable.c| 95 +++
4 files changed, 117 insertions(+), 109
Add a simple user_data for an input-to-output loopback test.
Reviewed-by: Pranjal Shrivastava
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_test.h | 13 +
drivers/iommu/iommufd/selftest.c | 19 +++
2 files changed, 32 insertions(+)
diff --git a
header, to
introduce common iommufd_struct_destroy() helper that will abort all kinds
of driver structures, not confined to iommufd_viommu but also the new ones
being added in the future.
Reviewed-by: Jason Gunthorpe
Reviewed-by: Lu Baolu
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd
With the introduction of the new object and its infrastructure, update the
doc to reflect that.
Signed-off-by: Nicolin Chen
---
Documentation/userspace-api/iommufd.rst | 15 +++
1 file changed, 15 insertions(+)
diff --git a/Documentation/userspace-api/iommufd.rst
b/Documentation
Extend the loopback test to a new mmap page.
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_test.h| 4 +++
drivers/iommu/iommufd/selftest.c| 40 ++---
tools/testing/selftests/iommu/iommufd.c | 7 +
3 files changed, 47 insertions(+), 4
iommufd_mmap structure pointers,
for pfn and owner validations. To allow IOMMU drivers to add and delete
mmappable regions onto/from the mt_mmap, add a pair of vIOMMU helpers:
iommufd_viommu_alloc_mmap() and iommufd_viommu_destroy_mmap().
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd
: Pranjal Shrivastava
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 6 ++
.../iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 17 +++--
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
b
x27;s Command Buffer, Event Log Buffer, and PPR Log Buffer
Introduce a struct iommufd_vqueue and an allocator iommufd_vqueue_alloc().
Also, add a pair of viommu ops for iommufd to forward user space ioctls to
IOMMU drivers.
Reviewed-by: Lu Baolu
Reviewed-by: Pranjal Shrivastava
Signed-
Reviewed-by: Lu Baolu
Reviewed-by: Pranjal Shrivastava
Signed-off-by: Nicolin Chen
---
include/linux/iommufd.h| 48 ++
drivers/iommu/iommufd/driver.c | 28
2 files changed, 76 insertions(+)
diff --git a/include/linux/iommufd.h b/inc
Some simple tests for IOMMUFD_CMD_VQUEUE_ALLOC infrastructure covering the
new iommufd_vqueue_depend/undepend() helpers.
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_test.h | 3 +
tools/testing/selftests/iommu/iommufd_utils.h | 31 +
drivers/iommu/iommufd
in the driver-level, add an hw_info impl op that will return such
a flag and fill the impl field.
Reviewed-by: Pranjal Shrivastava
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 1 +
include/uapi/linux/iommufd.h | 4 ++--
.../iommu/arm/arm
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 15 +
include/uapi/linux/iommufd.h | 50 ++-
.../arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 6 +-
.../iommu/arm/arm-smmu-v3/tegra241-cmdqv.c| 404 +-
4 files changed, 466 i
A vEVENT can be reported only from a threaded IRQ context. Change to using
request_threaded_irq to support that.
Acked-by: Pranjal Shrivastava
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a
g can complicate the timing of
calling tegra241_vcmdq_hw_init/deinit(), which write LVCMDQ address space,
i.e. requiring LVCMDQ to be mapped. Highlight that with a note to the top
of either of them.
Acked-by: Pranjal Shrivastava
Signed-off-by: Nicolin Chen
---
.../iommu/arm/arm-smmu-v3/teg
Add a new vEVENTQ type for VINTFs that are assigned to the user space.
Simply report the two 64-bit LVCMDQ_ERR_MAPs register values.
Reviewed-by: Alok Tiwari
Reviewed-by: Pranjal Shrivastava
Signed-off-by: Nicolin Chen
---
include/uapi/linux/iommufd.h | 15
. Release all LVCMDQ SW resources
Drop tegra241_vintf_remove_lvcmdq(), and move tegra241_vintf_free_lvcmdq()
as the new step 2.
Acked-by: Pranjal Shrivastava
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 13 +++--
1 file changed, 3 insertions(+), 10
On Thu, May 01, 2025 at 04:01:28PM -0700, Nicolin Chen wrote:
> +static void tegra241_vcmdq_hw_flush_timeout(struct tegra241_vcmdq *vcmdq)
> +{
> + struct arm_smmu_device *smmu = &vcmdq->cmdqv->smmu;
> + u64 cmd_sync[CMDQ_ENT_DWORDS] = {};
> +
> + cmd_sy
On Fri, May 02, 2025 at 10:50:07AM +0700, Bagas Sanjaya wrote:
> On Thu, May 01, 2025 at 04:01:22PM -0700, Nicolin Chen wrote:
> > +- IOMMUFD_OBJ_VQUEUE, representing a hardware accelerated virtual queue,
> > as a
> > + subset of IOMMU's virtualization features, fo
On Mon, Apr 21, 2025 at 08:16:54AM +, Tian, Kevin wrote:
> > From: Nicolin Chen
> > Sent: Friday, April 11, 2025 2:38 PM
> >
> > For vIOMMU passing through HW resources to user space (VMs), add an
> > mmap
> > infrastructure to map a region of ha
On Mon, Apr 21, 2025 at 08:00:37AM +, Tian, Kevin wrote:
> > From: Nicolin Chen
> > Sent: Friday, April 11, 2025 2:38 PM
> >
> > @@ -128,6 +142,9 @@ struct iommufd_viommu_ops {
> > const struct iommu_user_data *user_data);
> > int (*cac
On Mon, Apr 21, 2025 at 08:03:01AM +, Tian, Kevin wrote:
> > From: Nicolin Chen
> > Sent: Friday, April 11, 2025 2:38 PM
> >
> > Add a new IOMMUFD_OBJ_VCMDQ with an iommufd_vcmdq structure,
> > representing
> > a command queue type of physical HW passe
On Mon, Apr 21, 2025 at 08:05:40AM +, Tian, Kevin wrote:
> > From: Nicolin Chen
> > Sent: Friday, April 11, 2025 2:38 PM
> >
> > +
> > +/**
> > + * enum iommu_vcmdq_type - Virtual Queue Type
>
> "Virtual Command Queue Type"
>
>
On Mon, Apr 21, 2025 at 08:16:54AM +, Tian, Kevin wrote:
> > From: Nicolin Chen
> > Sent: Friday, April 11, 2025 2:38 PM
> > + * previously given to user space via a prior ioctl output.
> > + */
> > +static int iommufd_fops_mmap(struct file *fi
On Mon, Apr 21, 2025 at 08:23:50AM +, Tian, Kevin wrote:
> > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
> > b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
> > index 66855cae775e..aa8653af50f2 100644
> > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
> > +
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
On Wed, May 07, 2025 at 07:08:09PM -0300, Jason Gunthorpe wrote:
> On Wed, May 07, 2025 at 02:09:31PM -0700, Nicolin Chen wrote:
> > I have another question: while I don't think my code is handling
> > this well either, how should we validate the input address is an
> > a
On Thu, May 08, 2025 at 10:16:51AM +0530, Vasant Hegde wrote:
> >> - There is other bit "Completion wait interrupt enable"
> >> This doesn't related to any buffer. Instead if we configure this for
> >> completion wait command it will generate interrupt.
> >
> > This sounds like a modify on t
On Tue, Feb 18, 2025 at 11:29:59AM -0400, Jason Gunthorpe wrote:
> On Fri, Jan 24, 2025 at 04:30:34PM -0800, Nicolin Chen wrote:
> > + list_add_tail(&vevent->node, &eventq->deliver);
> > + vevent->on_list = true;
> > + vevent->header.sequence = at
On Tue, Feb 18, 2025 at 05:13:47AM +, Tian, Kevin wrote:
> > From: Nicolin Chen
> > Sent: Saturday, January 25, 2025 8:31 AM
> > +
> > +/*
> > + * An iommufd_veventq object represents an interface to deliver vIOMMU
> > events to
> > + * the user
On Tue, Feb 18, 2025 at 01:21:20PM -0400, Jason Gunthorpe wrote:
> On Fri, Jan 24, 2025 at 04:30:43PM -0800, Nicolin Chen wrote:
> > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> > @@ -1051,7 +1051,7 @@ void arm_sm
On Tue, Feb 18, 2025 at 02:08:05PM -0400, Jason Gunthorpe wrote:
> On Tue, Feb 18, 2025 at 09:47:50AM -0800, Nicolin Chen wrote:
> > > > +int iommufd_veventq_alloc(struct iommufd_ucmd *ucmd)
> > > > +{
> > > > + struct iommu_veventq_alloc *
On Tue, Feb 18, 2025 at 03:08:46PM -0400, Jason Gunthorpe wrote:
> On Tue, Feb 18, 2025 at 11:02:23AM -0800, Nicolin Chen wrote:
> > > > > This already holds the streams_mutex across all of this, do you think
> > > > > we should get rid of the vmaster_rw
On Tue, Feb 18, 2025 at 06:17:15PM +, Pranjal Shrivastava wrote:
> On Tue, Feb 18, 2025 at 05:24:08AM +, Tian, Kevin wrote:
> > > From: Nicolin Chen
> > > Sent: Saturday, January 25, 2025 8:31 AM
> > >
> > > There is a DoS concern on the sh
On Tue, Feb 18, 2025 at 02:50:46PM -0400, Jason Gunthorpe wrote:
> On Tue, Feb 18, 2025 at 10:28:04AM -0800, Nicolin Chen wrote:
> > On Tue, Feb 18, 2025 at 01:18:21PM -0400, Jason Gunthorpe wrote:
> > > On Fri, Jan 24, 2025 at 04:30:42PM -0800, Nicolin Chen wrote:
> >
On Tue, Feb 18, 2025 at 01:18:21PM -0400, Jason Gunthorpe wrote:
> On Fri, Jan 24, 2025 at 04:30:42PM -0800, Nicolin Chen wrote:
>
> > @@ -1831,31 +1831,30 @@ static int arm_smmu_handle_event(struct
> > arm_smmu_device *smmu,
> > return -EOPNOTSUPP;
> >
On Tue, Mar 11, 2025 at 03:56:38PM +, Will Deacon wrote:
> On Tue, Feb 25, 2025 at 09:25:41AM -0800, Nicolin Chen wrote:
> > @@ -1866,7 +1869,14 @@ static int arm_smmu_handle_event(struct
> > arm_smmu_device *smmu,
> > goto out_unlock;
> &
On Tue, Mar 11, 2025 at 03:57:16PM +, Will Deacon wrote:
> On Tue, Feb 25, 2025 at 09:25:40AM -0800, Nicolin Chen wrote:
> > Use it to store all vSMMU-related data. The vsid (Virtual Stream ID) will
> > be the first use case. Since the vsid reader will be the eventq handler
&
On Sat, Mar 01, 2025 at 12:16:00PM +0800, Zhangfei Gao wrote:
> On Wed, 26 Feb 2025 at 01:33, Nicolin Chen wrote:
> >
> > As the vIOMMU infrastructure series part-3, this introduces a new vEVENTQ
> > object. The existing FAULT object provides a nice notification pathway to
&g
On Wed, Mar 12, 2025 at 04:27:55PM +1100, Alexey Kardashevskiy wrote:
> On 13/11/24 04:45, Jason Gunthorpe wrote:
> > On Tue, Nov 05, 2024 at 12:05:08PM -0800, Nicolin Chen wrote:
> > > Jason Gunthorpe (1):
> > >iommu: Add iommu_copy_struct_from_full_user_array helpe
y: Jason Gunthorpe
Reviewed-by: Pranjal Shrivastava
Acked-by: Will Deacon
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 1 +
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 2 ++
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 4 ++--
3 files ch
forwarded to a VM.
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Reviewed-by: Pranjal Shrivastava
Acked-by: Will Deacon
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 7 +++
include/uapi/linux/iommufd.h | 23
.../arm/arm-smmu
iewed-by: Pranjal Shrivastava
Acked-by: Will Deacon
Signed-off-by: Nicolin Chen
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 28 +
.../arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 41 +++
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 18 +++-
3 files cha
iommufd_veventq_ops for the new ioctl.
Reviewed-by: Lu Baolu
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_private.h | 82 ++
include/linux/iommufd.h | 3 +
include/uapi/linux/iommufd.h| 82
helper in arm-smmu-v3-iommufd file
to simplify the routine in arm_smmu_handle_evt() of the main driver
v1
https://lore.kernel.org/all/cover.1724777091.git.nicol...@nvidia.com/
Thanks!
Nicolin
Nicolin Chen (14):
iommufd/fault: Move two fault functions out of the header
iommufd/fault: Add
Rename the file, aligning with the new eventq object.
Reviewed-by: Kevin Tian
Reviewed-by: Lu Baolu
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/Makefile | 2 +-
drivers/iommu/iommufd/{fault.c => eventq.c} | 0
2 files changed, 1 insert
Queue).
Reviewed-by: Lu Baolu
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/iommufd_private.h | 28 --
drivers/iommu/iommufd/fault.c | 111 +---
drivers/iommu/iommufd/hw_pagetable.c| 6 +-
iommufd_fault_fops_release().
Since the new vEVENTQ doesn't need "response" and its "mutex", so keep
the xa_init_flags and mutex_init in their original locations.
Reviewed-by: Kevin Tian
Reviewed-by: Lu Baolu
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
drivers/i
-by: Lu Baolu
Reviewed-by: Kevin Tian
Reviewed-by: Jason Gunthorpe
Signed-off-by: Nicolin Chen
---
include/linux/iommufd.h| 9 +
drivers/iommu/iommufd/driver.c | 24
2 files changed, 33 insertions(+)
diff --git a/include/linux/iommufd.h b/include/linux
There is no need to keep them in the header. The vEVENTQ version of these
two functions will turn out to be a different implementation and will not
share with this fault version. Thus, move them out of the header.
Reviewed-by: Jason Gunthorpe
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
---
drivers/iommu/iommufd/selftest.c| 24
tools/testing/selftests/iommu/iommufd.c | 5 +
2 files changed, 29 insertions(+)
diff --git a/drivers/iommu/iommufd/selftest.c b/drivers/iommu/iommufd/selftest.c
301 - 400 of 702 matches
Mail list logo