linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Nicolin Chen <nicolinc@nvidia.com>
To: <jgg@nvidia.com>, <kevin.tian@intel.com>
Cc: <robin.murphy@arm.com>, <eric.auger@redhat.com>,
	<yi.l.liu@intel.com>, <baolu.lu@linux.intel.com>,
	<will@kernel.org>, <joro@8bytes.org>,
	<shameerali.kolothum.thodi@huawei.com>,
	<jean-philippe@linaro.org>,
	<linux-arm-kernel@lists.infradead.org>, <iommu@lists.linux.dev>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH v5 0/4] Add set_dev_data and unset_dev_data support
Date: Thu, 27 Jul 2023 14:09:39 -0700	[thread overview]
Message-ID: <cover.1690487690.git.nicolinc@nvidia.com> (raw)

Changelog
v5:
 * Renamed ioctls to IOMMU_SET_DEV_DATA and IOMMU_UNSET_DEV_DATA
 * Renamed data structs to iommu_set_dev_data and IOMMU_UNSET_DEV_DATA
 * Added missing TEST_LENGTH for those two new data structures
v4:
 https://lore.kernel.org/all/cover.1683593949.git.nicolinc@nvidia.com/
 * Rebased on top of v6.4-rc1, and iommufd_nesting-v2 (candidate)
 * Dropped WARN_ON in the destroy()
v3:
 https://lore.kernel.org/all/cover.1682234302.git.nicolinc@nvidia.com/
 * Reverted the data in VFIO BIND ioctl to a set of new iommufd ioctls
 * Replaced the iommu_device_data_size array with a dev_user_data_len
   variable in the iommu_ops structure.
 * Added has_dev_data check and locking protection
 * Added selftest coverage
v2:
 https://lore.kernel.org/all/cover.1681976394.git.nicolinc@nvidia.com/
 * Integrated the uAPI into VFIO_DEVICE_BIND_IOMMUFD call
 * Renamed the previous set_rid_user to set_dev_data, to decouple from
   the PCI regime.
v1:
 https://lore.kernel.org/all/cover.1680762112.git.nicolinc@nvidia.com/

This is a pair of new uAPI/ops for user space to set an iommu specific
device data for a passthrough device. This is primarily used by SMMUv3
driver for now, to link the vSID and the pSID of a device that's behind
the SMMU. The link (lookup table) will be used to verify any ATC_INV
command from the user space for that device, and then replace the SID
field (virtual SID) with the corresponding physical SID.

This series is available on Github:
https://github.com/nicolinc/iommufd/commits/set_dev_data-v5

Thanks!
Nicolin

Nicolin Chen (4):
  iommu: Add set/unset_dev_user_data ops
  iommufd: Add IOMMUFD_CMD_SET_DEV_DATA and IOMMUFD_CMD_UNSET_DEV_DATA
  iommufd/selftest: Add IOMMU_TEST_OP_DEV_CHECK_DATA
  iommufd/selftest: Add coverage for IOMMU_SET/UNSET_DEV_DATA

 drivers/iommu/iommufd/device.c                |  2 +
 drivers/iommu/iommufd/iommufd_private.h       |  1 +
 drivers/iommu/iommufd/iommufd_test.h          | 15 ++++
 drivers/iommu/iommufd/main.c                  | 85 +++++++++++++++++++
 drivers/iommu/iommufd/selftest.c              | 42 +++++++++
 include/linux/iommu.h                         | 13 +++
 include/uapi/linux/iommufd.h                  | 32 +++++++
 tools/testing/selftests/iommu/iommufd.c       | 22 +++++
 tools/testing/selftests/iommu/iommufd_utils.h | 59 +++++++++++++
 9 files changed, 271 insertions(+)

-- 
2.41.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2023-07-27 21:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 21:09 Nicolin Chen [this message]
2023-07-27 21:09 ` [PATCH v5 1/4] iommu: Add set/unset_dev_user_data ops Nicolin Chen
2023-07-27 21:09 ` [PATCH v5 2/4] iommufd: Add IOMMUFD_CMD_SET_DEV_DATA and IOMMUFD_CMD_UNSET_DEV_DATA Nicolin Chen
2023-07-27 21:09 ` [PATCH v5 3/4] iommufd/selftest: Add IOMMU_TEST_OP_DEV_CHECK_DATA Nicolin Chen
2023-07-27 21:09 ` [PATCH v5 4/4] iommufd/selftest: Add coverage for IOMMU_SET/UNSET_DEV_DATA Nicolin Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1690487690.git.nicolinc@nvidia.com \
    --to=nicolinc@nvidia.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=eric.auger@redhat.com \
    --cc=iommu@lists.linux.dev \
    --cc=jean-philippe@linaro.org \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=will@kernel.org \
    --cc=yi.l.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).