[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1944e8b2226585e309081a541e51addc137e6684.1680762112.git.nicolinc@nvidia.com>
Date: Wed, 5 Apr 2023 23:25:34 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: <jgg@...dia.com>, <robin.murphy@....com>, <kevin.tian@...el.com>
CC: <eric.auger@...hat.com>, <yi.l.liu@...el.com>,
<baolu.lu@...ux.intel.com>, <will@...nel.org>, <joro@...tes.org>,
<shameerali.kolothum.thodi@...wei.com>, <jean-philippe@...aro.org>,
<linux-arm-kernel@...ts.infradead.org>, <iommu@...ts.linux.dev>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH RFC v1 1/3] iommu: Add set/unset_rid_user ops
Add a pair of new ops to allow user space to set virtual RID of a device.
This can be converted to Stream ID for SMMUv3, so as to create the link
between a physical Stream ID and a virtual Stream ID.
Signed-off-by: Nicolin Chen <nicolinc@...dia.com>
---
include/linux/iommu.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 080278c8154d..f85ce6f01408 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -248,6 +248,7 @@ struct iommu_iotlb_gather {
* driver init to device driver init (default no)
* @dev_enable/disable_feat: per device entries to enable/disable
* iommu specific features.
+ * @set/unset_rid_user: per device entries to set/unset user space Request ID
* @page_response: handle page request response
* @def_domain_type: device default domain type, return value:
* - IOMMU_DOMAIN_IDENTITY: must use an identity domain
@@ -291,6 +292,9 @@ struct iommu_ops {
int (*dev_enable_feat)(struct device *dev, enum iommu_dev_features f);
int (*dev_disable_feat)(struct device *dev, enum iommu_dev_features f);
+ int (*set_rid_user)(struct device *dev, u32 rid, u32 rid_base);
+ int (*unset_rid_user)(struct device *dev);
+
int (*page_response)(struct device *dev,
struct iommu_fault_event *evt,
struct iommu_page_response *msg);
--
2.40.0
Powered by blists - more mailing lists