PASID usage requires PASID support in both device and IOMMU. Since the
iommu drivers always enable the PASID capability for the device if it
is supported, so it is reasonable to extend the IOMMU_GET_HW_INFO to
report the PASID capability to userspace.
Signed-off-by: Yi Liu
---
drivers/iommu
This adds ioctls for the userspace to attach/detach a given pasid of a
vfio device to/from an IOAS/HWPT.
Reviewed-by: Jason Gunthorpe
Signed-off-by: Yi Liu
---
drivers/vfio/device_cdev.c | 51 +++
drivers/vfio/vfio.h| 4 +++
drivers/vfio/vfio_main.c
This adds pasid_at|de]tach_ioas ops for attaching hwpt to pasid of a
device and the helpers for it. For now, only vfio-pci supports pasid
attach/detach.
Signed-off-by: Kevin Tian
Signed-off-by: Yi Liu
---
drivers/vfio/iommufd.c | 50 +
drivers/vfio/pci
, pasid);
}
Cc: Matthew Wilcox (Oracle)
Suggested-by: Jason Gunthorpe
Signed-off-by: Yi Liu
---
include/linux/idr.h | 11
lib/idr.c | 67 +
2 files changed, 78 insertions(+)
diff --git a/include/linux/idr.h b/include/linux/idr.
6093121.18676-1-yi.l@intel.com/
Regards,
Yi Liu
Yi Liu (4):
ida: Add ida_find_first_range()
vfio-iommufd: Support pasid [at|de]tach for physical VFIO devices
vfio: Add VFIO_DEVICE_PASID_[AT|DE]TACH_IOMMUFD_PT
iommufd: Extend IOMMU_GET_HW_INFO to report PASID capability
drivers/iommu/i
This tests iommufd pasid attach/replace/detach.
Signed-off-by: Yi Liu
---
tools/testing/selftests/iommu/iommufd.c | 256 ++
.../selftests/iommu/iommufd_fail_nth.c| 29 +-
tools/testing/selftests/iommu/iommufd_utils.h | 78 ++
3 files changed, 359 insertions
This adds 4 test ops for pasid attach/replace/detach testing. There are
ops to attach/detach pasid, and also op to check the attached domain of
a pasid.
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/iommufd_test.h | 30 ++
drivers/iommu/iommufd/selftest.c | 138
There is need to get the selftest device (sobj->type == TYPE_IDEV) in
multiple places, so have a helper to for it.
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/selftest.c | 32 +---
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/drivers/io
The two callbacks are needed to make pasid_attach/detach path complete for
mock device. A nop is enough for set_dev_pasid, a domain type check in the
remove_dev_pasid is also helpful.
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/selftest.c | 38
1 file
.
Signed-off-by: Kevin Tian
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/device.c | 44 ---
drivers/iommu/iommufd/fault.c | 14 +---
drivers/iommu/iommufd/hw_pagetable.c| 5 +--
drivers/iommu/iommufd/iommufd_private.h | 47 -
4
ff-by: Yi Liu
---
drivers/iommu/iommufd/Makefile | 1 +
drivers/iommu/iommufd/device.c | 12 +-
drivers/iommu/iommufd/fault.c | 6 +-
drivers/iommu/iommufd/iommufd_private.h | 40 --
drivers/iommu/iommufd/pasid.c | 157
in
major user of the RID attach/replace with iommu_attach_handle, this also
makes the iommufd always pass the attach handle for the RID path as well.
This keeps the RID and PASID path much aligned.
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/fault.c | 21 +++--
drivers
iommufd plans to always pass in an iommu_attach_handle to the iommu
core, so it's no longer fault specific, hence move the helpers out
of the fault.c
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/fault.c | 61 +
drivers/iommu/iommufd/iommufd_private.h
There is a wrapper of iommu_attach_group_handle(), so making a wrapper for
iommu_replace_group_handle() for further code refactor. No functional change
intended.
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/fault.c | 54 ---
1 file changed, 31 insertions
092651.17041-1-yi.l@intel.com/
Regards,
Yi Liu
Yi Liu (10):
iommu: Introduce a replace API for device pasid
iommufd: Refactor __fault_domain_replace_dev() to be a wrapper of
iommu_replace_group_handle()
iommufd: Move the iommufd_handle helpers to iommufd_private.h
iommufd:
Provide a high-level API to allow replacements of one domain with
another for specific pasid of a device. This is similar to
iommu_group_replace_domain() and it is expected to be used only by
IOMMUFD.
Co-developed-by: Lu Baolu
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu
The blocked domain can be extended to park PASID of a device to be the
DMA blocking state. By this the remove_dev_pasid() op is dropped.
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 17 -
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/iommu
remove_dev_pasid() op.
[1] https://lore.kernel.org/linux-iommu/20240816130202.gb2032...@nvidia.com/
[2]
https://lore.kernel.org/linux-iommu/20240912130427.10119-1-yi.l@intel.com/
Regards,
Yi Liu
Jason Gunthorpe (1):
iommu/arm-smmu-v3: Make smmuv3 blocked domain support PASID
Yi Liu (2
IOMMU core needs to support both ways to destroy the
attachment of device/PASID and domain.
Signed-off-by: Yi Liu
---
drivers/iommu/iommu.c | 30 --
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index
From: Jason Gunthorpe
The blocked domain is used to park RID to be blocking DMA state. This
can be extended to PASID as well. By this, the remove_dev_pasid() op
of ARM SMMUv3 can be dropped.
Signed-off-by: Jason Gunthorpe
Signed-off-by: Yi Liu
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
From: Lu Baolu
Extend intel_iommu_set_dev_pasid() to set a nested type domain to a PASID
of a device.
Signed-off-by: Lu Baolu
Co-developed-by: Yi Liu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 22 +-
drivers/iommu/intel/iommu.h | 3 +++
drivers/iommu
old config if the input @old
is non-NULL.
Suggested-by: Jason Gunthorpe
Signed-off-by: Yi Liu
---
drivers/iommu/amd/pasid.c | 3 +++
include/linux/iommu.h | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/amd/pasid.c b/drivers/iommu/amd/pasid.c
index
set_dev_pasid op is going to support domain replacement and keep the old
hardware config if it fails. Make the Intel iommu driver be prepared for
it.
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 98 -
1 file changed, 65 insertions(+), 33 deletions
,
this would duplicate code among the iommu drivers. Or iommu drivers would
rely group->pasid_array to get domain, which may not always the correct
one.
Suggested-by: Jason Gunthorpe
Signed-off-by: Yi Liu
---
drivers/iommu/amd/amd_iommu.h | 3 ++-
drivers/iommu/amd/pasi
/
Regards,
Yi Liu
Jason Gunthorpe (1):
iommu/arm-smmu-v3: Make smmuv3 set_dev_pasid() op support replace
Lu Baolu (1):
iommu/vt-d: Add set_dev_pasid callback for nested domain
Yi Liu (4):
iommu: Pass old domain to set_dev_pasid op
iommu/vt-d: Move intel_drain_pasid_prq() into
From: Jason Gunthorpe
set_dev_pasid() op is going to be enhanced to support domain replacement
of a pasid. This prepares for this op definition.
Signed-off-by: Jason Gunthorpe
Signed-off-by: Yi Liu
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 2 +-
drivers/iommu/arm/arm-smmu-v3/arm
Draining PRQ is mostly conjuncted with pasid teardown, and with more callers
coming,
move it into it in the intel_pasid_tear_down_entry(). But there is scenario
that only
teardown pasid entry but no PRQ drain, so passing a flag to mark it.
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c
On 2024/9/6 12:33, Baolu Lu wrote:
On 9/6/24 12:21 PM, Yi Liu wrote:
On 2024/8/16 21:02, Jason Gunthorpe wrote:
On Fri, Aug 16, 2024 at 05:43:18PM +0800, Yi Liu wrote:
On 2024/7/18 16:27, Tian, Kevin wrote:
From: Liu, Yi L
Sent: Friday, June 28, 2024 5:06 PM
@@ -3289,7 +3290,20 @@ static
On 2024/8/16 21:02, Jason Gunthorpe wrote:
On Fri, Aug 16, 2024 at 05:43:18PM +0800, Yi Liu wrote:
On 2024/7/18 16:27, Tian, Kevin wrote:
From: Liu, Yi L
Sent: Friday, June 28, 2024 5:06 PM
@@ -3289,7 +3290,20 @@ static int __iommu_set_group_pasid(struct
iommu_domain *domain
llow Jason's suggestion to iommu_group_replace_domain ()
in Baolu's series, i.e. doing a xa_reserve() first.
yeah, I noticed it. But there is a minor difference. In Baolu's series
no need to retrieve the old domain, but this path needs to get it and
pass it to set_dev_pasid().
--
Regards,
Yi Liu
This tests iommufd pasid attach/replace/detach.
Signed-off-by: Yi Liu
---
tools/testing/selftests/iommu/iommufd.c | 207 ++
.../selftests/iommu/iommufd_fail_nth.c| 28 ++-
tools/testing/selftests/iommu/iommufd_utils.h | 78 +++
3 files changed, 309 insertions
This adds 4 test ops for pasid attach/replace/detach testing. There are
ops to attach/detach pasid, and also op to check the attached domain of
a pasid.
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/iommufd_test.h | 30 ++
drivers/iommu/iommufd/selftest.c | 135
There is need to get the selftest device (sobj->type == TYPE_IDEV) in
multiple places, so have a helper to for it.
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/selftest.c | 32 +---
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/drivers/io
nt is still applied to pasid operations since
it is about memory accesses post page table walking (no matter the walk
is per RID or per PASID).
Since the attach is per PASID, this introduces a pasid_hwpts xarray to
track the per-pasid attach data.
Signed-off-by: Kevin Tian
Signed-off-by: Y
The two callbacks are needed to make pasid_attach/detach path complete for
mock device. A nop is enough for set_dev_pasid, a domain type check in the
remove_dev_pasid is also helpful.
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/selftest.c | 39
1 file
Most of the core logic before conducting the actual device attach/
replace operation can be shared with pasid attach/replace. So pass
pasid through the device attach/replace helpers to prepare adding
pasid attach/replace.
Signed-off-by: Kevin Tian
Signed-off-by: Yi Liu
---
drivers/iommu
ressponding attach_fn per the pasid
value.
rfc:
https://lore.kernel.org/linux-iommu/20230926092651.17041-1-yi.l@intel.com/
Regards,
Yi Liu
Yi Liu (7):
iommu: Introduce a replace API for device pasid
iommufd: Pass pasid through the device attach/replace path
iommufd: Suppor
Provide a high-level API to allow replacements of one domain with
another for specific pasid of a device. This is similar to
iommu_group_replace_domain() and it is expected to be used only by
IOMMUFD.
Co-developed-by: Lu Baolu
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu
On 2024/3/21 20:20, Jason Gunthorpe wrote:
On Thu, Mar 21, 2024 at 07:26:41PM +0800, Yi Liu wrote:
yes, the correct way is to undo what have been done before the fail
device. However, I somehow remember that pasid capability is only
available when the group is singleton. So iterate all devices
On 2024/3/21 14:16, Yi Liu wrote:
On 2024/3/20 20:38, Jason Gunthorpe wrote:
On Tue, Mar 19, 2024 at 03:29:39PM +0800, Yi Liu wrote:
On 2024/3/19 00:52, Jason Gunthorpe wrote:
On Wed, Mar 13, 2024 at 04:11:41PM +0800, Yi Liu wrote:
yes. how about your opinion? @Jason. I noticed the
On 2024/3/20 20:38, Jason Gunthorpe wrote:
On Tue, Mar 19, 2024 at 03:29:39PM +0800, Yi Liu wrote:
On 2024/3/19 00:52, Jason Gunthorpe wrote:
On Wed, Mar 13, 2024 at 04:11:41PM +0800, Yi Liu wrote:
yes. how about your opinion? @Jason. I noticed the set_dev_pasid callback
and pasid_array
On 2024/3/19 00:52, Jason Gunthorpe wrote:
On Wed, Mar 13, 2024 at 04:11:41PM +0800, Yi Liu wrote:
yes. how about your opinion? @Jason. I noticed the set_dev_pasid callback
and pasid_array update is under the group->lock, so update it should be
fine to adjust the order to update pasid_ar
On 2024/3/13 11:13, Baolu Lu wrote:
On 2024/3/12 11:07, Yi Liu wrote:
On 2024/3/11 17:26, Tian, Kevin wrote:
From: Liu, Yi L
Sent: Sunday, March 10, 2024 9:06 PM
On 2024/1/16 01:19, Jason Gunthorpe wrote:
On Sun, Nov 26, 2023 at 10:34:21PM -0800, Yi Liu wrote:
+int
On 2024/3/11 17:26, Tian, Kevin wrote:
From: Liu, Yi L
Sent: Sunday, March 10, 2024 9:06 PM
On 2024/1/16 01:19, Jason Gunthorpe wrote:
On Sun, Nov 26, 2023 at 10:34:21PM -0800, Yi Liu wrote:
+int iommu_replace_device_pasid(struct iommu_domain *domain,
+ struct
On 2024/1/16 01:19, Jason Gunthorpe wrote:
On Sun, Nov 26, 2023 at 10:34:21PM -0800, Yi Liu wrote:
+int iommu_replace_device_pasid(struct iommu_domain *domain,
+ struct device *dev, ioasid_t pasid)
+{
+ struct iommu_group *group = dev->iommu_gr
On 2024/2/21 23:19, Jason Gunthorpe wrote:
On Thu, Feb 08, 2024 at 12:23:02AM -0800, Yi Liu wrote:
If a domain is used as the parent in nested translation its mappings might
be cached using DID of the nested domain. But the existing code ignores
this fact to only invalidate the iotlb entries
oks even w/o nesting this is missed in the attach path.
could be fixed separately. so for this one:
it's fixed here.
https://lore.kernel.org/linux-iommu/20240208091414.28133-1-yi.l@intel.com/
Reviewed-by: Kevin Tian
--
Regards,
Yi Liu
->s2_domain;
+
+ spin_lock(&s2_domain->s1_lock);
+ list_del(&dmar_domain->s2_link);
+ spin_unlock(&s2_domain->s1_lock);
kfree(to_dmar_domain(domain));
use 'dmar_domain'.
Oops. yes it is.
Reviewed-by: Kevin Tian
--
Regards,
Yi Liu
Should set the SSADE (Second Stage Access/Dirty bit Enable) bit of the
pasid entry when attaching a device to a nested domain if its parent
has already enabled dirty tracking.
Fixes: 111bf85c68f6 ("iommu/vt-d: Add helper to setup pasid nested translation")
Signed-off-by: Yi Liu
---
b
Fixes: b41e38e22539 ("iommu/vt-d: Add nested domain allocation")
Signed-off-by: Yi Sun
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 36
1 file changed, 36 insertions(+)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
ind
Add device_set_dirty_tracking() to loop all the devices and set the dirty
tracking per the @enable parameter.
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 32 +---
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/drivers/iommu/intel/iommu.c
use the DID of nested domain.
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 7 +++
drivers/iommu/intel/pasid.c | 3 +--
drivers/iommu/intel/pasid.h | 1 -
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index
x27;s s1_domains list and loops the devices
list of each s1_domain to flush the entire device iotlb on the devices.
Fixes: b41e38e22539 ("iommu/vt-d: Add nested domain allocation")
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 18 ++
1 file changed, 18 insertions(+
ned-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 4 +---
drivers/iommu/intel/iommu.h | 1 +
drivers/iommu/intel/nested.c | 2 ++
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 46174ff5ae22..b1ceebe13107 100644
---
tries related
to the target s2 address range. According to VT-d spec there is no need for
software to explicitly flush the affected s1 cache. It's implicitly done by
HW when s2 cache is invalidated.
Fixes: b41e38e22539 ("iommu/vt-d: Add nested domain allocation")
Signed-off-by: Yi Liu
Add __iommu_flush_iotlb_psi() to do the psi iotlb flush with a DID input
rather than calculating it within the helper.
This is useful when flushing cache for parent domain which reuses DIDs of
its nested domains.
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 79
ed devices and iommus.
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 18 ++
drivers/iommu/intel/iommu.h | 6 ++
drivers/iommu/intel/nested.c | 10 ++
3 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/i
34cd2c8a8e3
Regards,
Yi Liu
Yi Liu (8):
iommu/vt-d: Track nested domains in parent
iommu/vt-d: Add __iommu_flush_iotlb_psi()
iommu/vt-d: Add missing iotlb flush for parent domain
iommu/vt-d: Update iotlb in nested domain attach
iommu/vt-d: Add missing device iotlb flush for parent
On 2024/1/18 21:38, Jason Gunthorpe wrote:
On Thu, Jan 18, 2024 at 05:28:01PM +0800, Yi Liu wrote:
On 2024/1/17 20:56, Jason Gunthorpe wrote:
On Wed, Jan 17, 2024 at 04:24:24PM +0800, Yi Liu wrote:
Above indeed makes more sense if there can be concurrent attach/replace/detach
on a single
On 2024/1/17 20:56, Jason Gunthorpe wrote:
On Wed, Jan 17, 2024 at 04:24:24PM +0800, Yi Liu wrote:
Above indeed makes more sense if there can be concurrent attach/replace/detach
on a single pasid. Just have one doubt should we add lock to protect the
whole attach/replace/detach paths. In the
On 2024/1/17 12:17, Tian, Kevin wrote:
From: Jason Gunthorpe
Sent: Tuesday, January 16, 2024 8:58 PM
On Tue, Jan 16, 2024 at 01:18:12AM +, Tian, Kevin wrote:
From: Jason Gunthorpe
Sent: Tuesday, January 16, 2024 1:25 AM
On Sun, Nov 26, 2023 at 10:34:23PM -0800, Yi Liu wrote
On 2023/12/12 23:35, Jason Gunthorpe wrote:
On Mon, Dec 11, 2023 at 11:49:49AM -0700, Alex Williamson wrote:
On Mon, 11 Dec 2023 14:10:28 -0400
Jason Gunthorpe wrote:
On Mon, Dec 11, 2023 at 11:03:45AM -0700, Alex Williamson wrote:
On Sun, 26 Nov 2023 22:39:09 -0800
Yi Liu wrote
off where stuff in PCI config space needs
explicit hypervisor support or it doesn't work in the VM and things
get confusing.
Jason
--
Regards,
Yi Liu
From: Lu Baolu
This implements the .cache_invalidate_user() callback to support iotlb
flush for nested domain.
Reviewed-by: Kevin Tian
Signed-off-by: Lu Baolu
Co-developed-by: Yi Liu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/nested.c | 88
1 file
From: Nicolin Chen
Add test cases for the IOMMU_HWPT_INVALIDATE ioctl and verify it by using
the new IOMMU_TEST_OP_MD_CHECK_IOTLB.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
Co-developed-by: Yi Liu
Signed-off-by: Yi Liu
---
tools/testing/selftests/iommu/iommufd.c | 148
This adds the data structure invalidating caches for the nested domain
allocated with IOMMU_HWPT_DATA_VTD_S1 type.
Reviewed-by: Kevin Tian
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
include/uapi/linux/iommufd.h | 36
1 file changed, 36 insertions
From: Nicolin Chen
Allow to test whether IOTLB has been invalidated or not.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/iommufd_test.h | 5
drivers/iommu/iommufd/selftest.c | 26 +++
tools
From: Nicolin Chen
Add mock_domain_cache_invalidate_user() data structure to support user
space selftest program to cover user cache invalidation pathway.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
Co-developed-by: Yi Liu
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd
Signed-off-by: Nicolin Chen
Co-developed-by: Yi Liu
Signed-off-by: Yi Liu
---
include/linux/iommu.h | 53 +++
1 file changed, 53 insertions(+)
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 93c0d12dd047..580ba74a3d5d 100644
--- a/include
Chen
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/hw_pagetable.c| 41 +++
drivers/iommu/iommufd/iommufd_private.h | 10 ++
drivers/iommu/iommufd/main.c| 3 ++
include/uapi/linux/iommufd.h| 43 +
4 files changed, 97
mmufd. Then, pass in invalidation
requests in form of a user data array containing a number of invalidation
data entries.
Reviewed-by: Kevin Tian
Signed-off-by: Lu Baolu
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Liu
---
include/linux/iommu.h | 26 ++
1 file change
data length for user domain allocation
- Rename struct iommu_hwpt_alloc::data_type to be hwpt_type
- Store the invalidation data length in
iommu_domain_ops::cache_invalidate_user_data_len
- Convert cache_invalidate_user op to be int instead of void
- Remove @data_type in struct iommu_hwpt_invalidate
-
reported.
from this angle whether to record pasid doesn't really matter.
intel-iommu driver doesn't batch commands. so it's possible for
the driver to figure out the timeout device itself and identify rid plus
pasid to find dev_id from iommufd.
based on this, even RID is unnecessary. Software should know which device
it has sent a devTLB invalidation.
--
Regards,
Yi Liu
On 2024/1/3 07:38, Jason Gunthorpe wrote:
On Fri, Dec 15, 2023 at 12:01:19PM +0800, Yi Liu wrote:
I think I misread Yi's narrative: dev_id is a working approach
for VMM to convert to a vRID, while he is asking for a better
alternative :)
In concept, dev_id works, but in reality we
On 2024/1/3 02:44, Jason Gunthorpe wrote:
On Tue, Jan 02, 2024 at 06:38:34AM -0800, Yi Liu wrote:
+static void intel_nested_flush_cache(struct dmar_domain *domain, u64 addr,
+unsigned long npages, bool ih, u32 *error)
+{
+ struct iommu_domain_info
From: Lu Baolu
This implements the .cache_invalidate_user() callback to support iotlb
flush for nested domain.
Reviewed-by: Kevin Tian
Signed-off-by: Lu Baolu
Co-developed-by: Yi Liu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/nested.c | 107 +++
1 file
This adds the data structure invalidating caches for the nested domain
allocated with IOMMU_HWPT_DATA_VTD_S1 type.
Reviewed-by: Kevin Tian
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
include/uapi/linux/iommufd.h | 58
1 file changed, 58 insertions
user.
Reviewed-by: Kevin Tian
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/dmar.c | 13 +++--
drivers/iommu/intel/iommu.c | 12 ++--
drivers/iommu/intel/iommu.h | 6 +++---
drivers/iommu/intel/pasid.c | 12 +++-
drivers/iommu/intel/svm.c | 8
newly added user domain cache invalidation by checking if the caller is
interested in the fault or not.
[1]
https://lore.kernel.org/all/20231228001646.587653-6-haifeng.z...@linux.intel.com/
Reviewed-by: Kevin Tian
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/dmar.c
From: Nicolin Chen
Add test cases for the IOMMU_HWPT_INVALIDATE ioctl and verify it by using
the new IOMMU_TEST_OP_MD_CHECK_IOTLB.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
Co-developed-by: Yi Liu
Signed-off-by: Yi Liu
---
tools/testing/selftests/iommu/iommufd.c | 186
From: Nicolin Chen
Allow to test whether IOTLB has been invalidated or not.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/iommufd_test.h | 5
drivers/iommu/iommufd/selftest.c | 26 +++
tools
From: Nicolin Chen
Add mock_domain_cache_invalidate_user() data structure to support user
space selftest program to cover user cache invalidation pathway.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
Co-developed-by: Yi Liu
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd
iommu_user_data_array.
And expect it to be used in cache_invalidate_user ops for example.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
Co-developed-by: Yi Liu
Signed-off-by: Yi Liu
---
include/linux/iommu.h | 74 +++
1 file changed, 74 insertions
Chen
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/hw_pagetable.c| 41 +++
drivers/iommu/iommufd/iommufd_private.h | 10 ++
drivers/iommu/iommufd/main.c| 3 ++
include/uapi/linux/iommufd.h| 43 +
4 files changed, 97
mmufd. Then, pass in invalidation
requests in form of a user data array conatining a number of invalidation
data entries.
Signed-off-by: Lu Baolu
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Liu
---
include/linux/iommu.h | 26 ++
1 file change
main_ops::cache_invalidate_user_data_len
- Convert cache_invalidate_user op to be int instead of void
- Remove @data_type in struct iommu_hwpt_invalidate
- Remove out_hwpt_type_bitmap in struct iommu_hw_info hence drop patch 08 of v1
v1:
https://lore.kernel.org/linux-iommu/20230309080910.607396
n may have a chance to look in his holiday and if ok
whether he wants to see a new version or just change it while committing.
anyhow, I've updated it in below branch.
https://github.com/yiliu1765/iommufd/tree/iommufd_nesting
--
Regards,
Yi Liu
return -EAGAIN'
the simpler form is:
/* No need to retry if the caller is interested in the timeout
error */
if (qi->desc_status[wait_index] == QI_ABORT)
return fsts ? -ETIMEDOUT : -EAGAIN;
otherwise,
Reviewed-by: Kevin Tian
sure.
--
Regards,
Yi Liu
From: Lu Baolu
This implements the .cache_invalidate_user() callback to support iotlb
flush for nested domain.
Signed-off-by: Lu Baolu
Co-developed-by: Yi Liu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/nested.c | 107 +++
1 file changed, 107 insertions
This adds the data structure invalidating caches for the nested domain
allocated with IOMMU_HWPT_DATA_VTD_S1 type.
Reviewed-by: Kevin Tian
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
include/uapi/linux/iommufd.h | 58
1 file changed, 58 insertions
user.
Reviewed-by: Kevin Tian
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/dmar.c | 13 +++--
drivers/iommu/intel/iommu.c | 12 ++--
drivers/iommu/intel/iommu.h | 6 +++---
drivers/iommu/intel/pasid.c | 12 +++-
drivers/iommu/intel/svm.c | 8
From: Lu Baolu
This allows qi_submit_sync() to return back faults to callers.
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/dmar.c | 42 -
drivers/iommu/intel/iommu.h | 2 +-
drivers/iommu/intel/irq_remapping.c | 2
From: Nicolin Chen
Allow to test whether IOTLB has been invalidated or not.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/iommufd_test.h | 5
drivers/iommu/iommufd/selftest.c | 26 +++
tools
From: Nicolin Chen
Add test cases for the IOMMU_HWPT_INVALIDATE ioctl and verify it by using
the new IOMMU_TEST_OP_MD_CHECK_IOTLB.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
Co-developed-by: Yi Liu
Signed-off-by: Yi Liu
---
tools/testing/selftests/iommu/iommufd.c | 186
From: Nicolin Chen
Add mock_domain_cache_invalidate_user() data structure to support user
space selftest program to cover user cache invalidation pathway.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
Co-developed-by: Yi Liu
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd
iommu_user_data_array.
And expect it to be used in cache_invalidate_user ops for example.
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
Co-developed-by: Yi Liu
Signed-off-by: Yi Liu
---
include/linux/iommu.h | 74 +++
1 file changed, 74 insertions
Chen
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/hw_pagetable.c| 41 +++
drivers/iommu/iommufd/iommufd_private.h | 10 ++
drivers/iommu/iommufd/main.c| 3 ++
include/uapi/linux/iommufd.h| 43 +
4 files changed, 97
user data length for user domain allocation
- Rename struct iommu_hwpt_alloc::data_type to be hwpt_type
- Store the invalidation data length in
iommu_domain_ops::cache_invalidate_user_data_len
- Convert cache_invalidate_user op to be int instead of void
- Remove @data_type in struct iommu_hwpt_inval
mmufd. Then, pass in invalidation
requests in form of a user data array conatining a number of invalidation
data entries.
Signed-off-by: Lu Baolu
Reviewed-by: Kevin Tian
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Liu
---
include/linux/iommu.h | 26 ++
1 file change
7;s caused only by driver internal bug.
+*/
here lack of:
*error = 0;
yes.
+ if (fault & DMA_FSTS_ICE)
+ *error |= IOMMU_HWPT_INVALIDATE_VTD_S1_ICE;
+ if (fault & DMA_FSTS_ITE)
+ *error |= IOMMU_HWPT_INVALIDATE_VTD_S1_ITE;
+}
+
--
Regards,
Yi Liu
1 - 100 of 366 matches
Mail list logo