Re: [PATCH v8 06/10] iommufd/selftest: Add coverage for IOMMU_HWPT_INVALIDATE ioctl

2023-12-28 Thread Yi Liu
On 2023/12/28 14:14, Tian, Kevin wrote: From: Liu, Yi L Sent: Thursday, December 28, 2023 12:14 AM + /* Negative test: trigger error */ + num_inv = 1; + inv_reqs[0].flags = IOMMU_TEST_INVALIDATE_FLAG_TRIGGER_ERROR; + inv_reqs[0].iotlb_id =

Re: [PATCH v8 07/10] iommu/vt-d: Allow qi_submit_sync() to return the QI faults

2023-12-28 Thread Yi Liu
On 2023/12/28 14:17, Tian, Kevin wrote: From: Liu, Yi L Sent: Thursday, December 28, 2023 12:14 AM @@ -1376,6 +1383,8 @@ int qi_submit_sync(struct intel_iommu *iommu, struct qi_desc *desc, restart: rc = 0; + if (fault) + *fault = 0; move it to right before the l

Re: [PATCH v8 09/10] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2023-12-28 Thread Yi Liu
On 2023/12/28 14:38, Tian, Kevin wrote: From: Tian, Kevin Sent: Thursday, December 28, 2023 2:38 PM From: Liu, Yi L Sent: Thursday, December 28, 2023 12:14 AM +/** + * struct iommu_hwpt_vtd_s1_invalidate - Intel VT-d cache invalidation + * (IOMMU_HWPT_INVA

Re: [PATCH v8 10/10] iommu/vt-d: Add iotlb flush for nested domain

2023-12-28 Thread Yi Liu
On 2023/12/28 15:11, Tian, Kevin wrote: From: Liu, Yi L Sent: Thursday, December 28, 2023 12:14 AM +static void nested_flush_pasid_iotlb(struct intel_iommu *iommu, +struct dmar_domain *domain, u64 addr, +unsigned long npag

[PATCH v9 01/10] iommu: Add cache_invalidate_user op

2023-12-28 Thread Yi Liu
From: Lu Baolu The updates of the PTEs in the nested page table will be propagated to the hardware caches. Add a new domain op cache_invalidate_user for the userspace to flush the hardware caches for a nested domain through iommufd. No wrapper for it, as it's only supposed to be used by iommufd.

[PATCH v9 00/10] Add iommufd nesting (part 2/2)

2023-12-28 Thread Yi Liu
Nested translation is a hardware feature that is supported by many modern IOMMU hardwares. It has two stages (stage-1, stage-2) address translation to get access to the physical address. stage-1 translation table is owned by userspace (e.g. by a guest OS), while stage-2 is owned by kernel. Changes

[PATCH v9 02/10] iommufd: Add IOMMU_HWPT_INVALIDATE

2023-12-28 Thread Yi Liu
In nested translation, the stage-1 page table is user-managed but cached by the IOMMU hardware, so an update on present page table entries in the stage-1 page table should be followed with a cache invalidation. Add an IOMMU_HWPT_INVALIDATE ioctl to support such a cache invalidation. It takes hwpt_

[PATCH v9 03/10] iommu: Add iommu_copy_struct_from_user_array helper

2023-12-28 Thread Yi Liu
From: Nicolin Chen Wrap up the data pointer/num sanity and __iommu_copy_struct_from_user call for iommu drivers to copy driver specific data at a specific location in the struct iommu_user_data_array, and iommu_respond_struct_to_user_array() to copy response to a specific location in the struct i

[PATCH v9 04/10] iommufd/selftest: Add mock_domain_cache_invalidate_user support

2023-12-28 Thread Yi Liu
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/iommufd_test

[PATCH v9 06/10] iommufd/selftest: Add coverage for IOMMU_HWPT_INVALIDATE ioctl

2023-12-28 Thread Yi Liu
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 ++

[PATCH v9 05/10] iommufd/selftest: Add IOMMU_TEST_OP_MD_CHECK_IOTLB test op

2023-12-28 Thread Yi Liu
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/tes

[PATCH v9 07/10] iommu/vt-d: Allow qi_submit_sync() to return the QI faults

2023-12-28 Thread Yi Liu
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 +- dri

[PATCH v9 08/10] iommu/vt-d: Convert stage-1 cache invalidation to return QI fault

2023-12-28 Thread Yi Liu
From: Lu Baolu This makes the pasid based cache invalidation and device TLB invalidation to return QI faults to callers. This is needed when usersapce invalidates cache after modifying the stage-1 page table used in nested translation. Hardware errors during invalidation should be reported to use

[PATCH v9 09/10] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2023-12-28 Thread Yi Liu
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(+)

[PATCH v9 10/10] iommu/vt-d: Add iotlb flush for nested domain

2023-12-28 Thread 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(+)

Re: [PATCH net-next 2/3] net: gro: parse ipv6 ext headers without frag0

2023-12-28 Thread Richard Gobert
Willem de Bruijn wrote: > Richard Gobert wrote: >> This commit utilizes a new helper function, ipv6_gro_pull_exthdrs, which >> is used in ipv6_gro_receive to pull ipv6 ext headers instead of >> ipv6_gso_pull_exthdrs. To use ipv6_gso_pull_exthdr, pskb_pull and >> __skb_push must be used, and frag

Re: [PATCH net-next 3/3] selftests/net: fix GRO coalesce test and add ext

2023-12-28 Thread Richard Gobert
Willem de Bruijn wrote: > Richard Gobert wrote: >> Currently there is no test which checks that IPv6 extension header packets >> successfully coalesce. This commit adds a test, which verifies two IPv6 >> packets with HBH extension headers do coalesce. >> >> I changed the receive socket filter to

Re: [RFC PATCH v3 0/3] Add test to verify probe of devices from discoverable busses

2023-12-28 Thread Bjorn Helgaas
I have no opinion about the patches themselves, but just a heads-up that "busses" may be regarded as a misspelling of "buses", e.g., https://lore.kernel.org/r/20231223184720.25645-1-tintinm2...@gmail.com, I'm guessing because codespell complains about it. Git grep says there are almost as many ins

RE: [PATCH v9 07/10] iommu/vt-d: Allow qi_submit_sync() to return the QI faults

2023-12-28 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, December 28, 2023 11:06 PM > > From: Lu Baolu > > This allows qi_submit_sync() to return back faults to callers. this might be useful to add a note that the retry logic itself is being discussed in a separate thread [1]. Here we keep it intact and just make

RE: [PATCH v9 10/10] iommu/vt-d: Add iotlb flush for nested domain

2023-12-28 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, December 28, 2023 11:06 PM > > 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 Reviewed-by: Kevin Tian

RE: [PATCH v9 00/10] Add iommufd nesting (part 2/2)

2023-12-28 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, December 28, 2023 11:06 PM > > This series is based on the first part which was merged [1], this series is to > add the cache invalidation interface or the userspace to invalidate cache > after > modifying the stage-1 page table. This includes both the iommufd

Re: [PATCH v9 07/10] iommu/vt-d: Allow qi_submit_sync() to return the QI faults

2023-12-28 Thread Yi Liu
On 2023/12/29 10:52, Tian, Kevin wrote: From: Liu, Yi L Sent: Thursday, December 28, 2023 11:06 PM From: Lu Baolu This allows qi_submit_sync() to return back faults to callers. this might be useful to add a note that the retry logic itself is being discussed in a separate thread [1]. Here