Re: [PATCH] selftests/resctrl: Add non-contiguous CBMs CAT test

2023-11-17 Thread Ilpo Järvinen
On Thu, 9 Nov 2023, Maciej Wieczor-Retman wrote: > Non-contiguous CBM support for Intel CAT has been merged into the kernel > with Commit 0e3cd31f6e90 ("x86/resctrl: Enable non-contiguous CBMs in > Intel CAT") but there is no selftest that would validate if this feature > works correctly. > > The

[PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-11-17 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 v6 1/6] iommu: Add cache_invalidate_user op

2023-11-17 Thread Yi Liu
From: Lu Baolu The updates of the PTEs in the nested page table will be propagated to the hardware caches on both IOMMU (IOTLB) and devices (DevTLB/ATC). 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 i

[PATCH v6 2/6] iommufd: Add IOMMU_HWPT_INVALIDATE

2023-11-17 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 v6 3/6] iommu: Add iommu_copy_struct_from_user_array helper

2023-11-17 Thread Yi Liu
From: Nicolin Chen Wrap up the data type/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 expect it to be used in cache_invalidate_user ops for example. Signed-off-by: Nicolin

[PATCH v6 4/6] iommufd/selftest: Add mock_domain_cache_invalidate_user support

2023-11-17 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. Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu --- drivers/iommu/iommufd/iommufd_test.h | 17 +++ drivers/iommu/iommufd/selftes

[PATCH v6 5/6] iommufd/selftest: Add IOMMU_TEST_OP_MD_CHECK_IOTLB test op

2023-11-17 Thread Yi Liu
From: Nicolin Chen Allow to test whether IOTLB has been invalidated or not. Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu --- drivers/iommu/iommufd/iommufd_test.h | 5 drivers/iommu/iommufd/selftest.c | 26 +++ tools/testing/selftests/iommu/iomm

[PATCH v6 6/6] iommufd/selftest: Add coverage for IOMMU_HWPT_INVALIDATE ioctl

2023-11-17 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. Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu --- tools/testing/selftests/iommu/iommufd.c | 71 +++ tools/testing/selftests/iommu/iommuf

[PATCH v7 0/3] Add Intel VT-d nested translation (part 2/2)

2023-11-17 Thread Yi Liu
This is the second part to add Intel VT-d nested translation based on IOMMUFD nesting infrastructure. As the iommufd nesting infrastructure series [1], iommu core supports new ops to invalidate the cache after the modifictions in stage-1 page table. So far, the cache invalidation data is vendor spe

[PATCH v7 2/3] iommu/vt-d: Make iotlb flush helpers to be extern

2023-11-17 Thread Yi Liu
This makes the helpers visible to nested.c. Reviewed-by: Kevin Tian Signed-off-by: Yi Liu --- drivers/iommu/intel/iommu.c | 10 +- drivers/iommu/intel/iommu.h | 6 ++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/i

[PATCH v7 1/3] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2023-11-17 Thread Yi Liu
This adds the data structure for flushing iotlb for the nested domain allocated with IOMMU_HWPT_DATA_VTD_S1 type. This only supports invalidating IOTLB, but no for device-TLB as device-TLB invalidation will be covered automatically in the IOTLB invalidation if the underlying IOMMU driver has enabl

[PATCH v7 3/3] iommu/vt-d: Add iotlb flush for nested domain

2023-11-17 Thread Yi Liu
This implements the .cache_invalidate_user() callback to support iotlb flush for nested domain. Signed-off-by: Lu Baolu Signed-off-by: Yi Liu --- drivers/iommu/intel/nested.c | 54 1 file changed, 54 insertions(+) diff --git a/drivers/iommu/intel/nested.c b

Re: [PATCH net-next 14/14] selftests: mlxsw: Add PCI reset test

2023-11-17 Thread Simon Horman
+ linux-kselftest ML, Shuah Khan On Wed, Nov 15, 2023 at 01:17:23PM +0100, Petr Machata wrote: > From: Ido Schimmel > > Test that PCI reset works correctly by verifying that only the expected > reset methods are supported and that after issuing the reset the ifindex > of the port changes. > > S

[PATCH net-next] net: ctnetlink: support filtering by zone

2023-11-17 Thread Felix Huettner
conntrack zones are heavily used by tools like openvswitch to run multiple virtual "routers" on a single machine. In this context each conntrack zone matches to a single router, thereby preventing overlapping IPs from becoming issues. In these systems it is common to operate on all conntrack entrie

Re: [PATCH v5 0/6] workload-specific and memory pressure-driven zswap writeback

2023-11-17 Thread Nhat Pham
On Thu, Nov 16, 2023 at 4:57 PM Chris Li wrote: > > Hi Nhat, > > I want want to share the high level feedback we discussed here in the > mailing list as well. > > It is my observation that each memcg LRU list can't compare the page > time order with other memcg. > It works great when the leaf leve

Re: [PATCH v5 0/6] workload-specific and memory pressure-driven zswap writeback

2023-11-17 Thread Yosry Ahmed
On Fri, Nov 17, 2023 at 8:23 AM Nhat Pham wrote: > > On Thu, Nov 16, 2023 at 4:57 PM Chris Li wrote: > > > > Hi Nhat, > > > > I want want to share the high level feedback we discussed here in the > > mailing list as well. > > > > It is my observation that each memcg LRU list can't compare the pag

Re: [PATCH bpf-next 0/4] selftests/bpf: Update multiple prog_tests to use ASSERT_ macros

2023-11-17 Thread Andrii Nakryiko
On Wed, Nov 15, 2023 at 10:14 PM Yuran Pereira wrote: > > Multiple files/programs in `tools/testing/selftests/bpf/prog_tests/` still > heavily use the `CHECK` macro, even when better `ASSERT_` alternatives are > available. > > As it was already pointed out by Yonghong Song [1] in the bpf selftests

Re: [PATCH RFC RFT v2 2/5] fork: Add shadow stack support to clone3()

2023-11-17 Thread Edgecombe, Rick P
On Thu, 2023-11-16 at 18:41 +, Mark Brown wrote: > > What about a CLONE_NEW_SHSTK for clone3 that forces a new shadow > > stack? > > So keep the existing logic, but the new flag can override the logic > > for > > !CLONE_VM and CLONE_VFORK if the caller wants. The behavior of > > shadow_stack_si

Re: [PATCH RFC RFT v2 5/5] kselftest/clone3: Test shadow stack support

2023-11-17 Thread Edgecombe, Rick P
On Tue, 2023-11-14 at 15:11 -0800, Rick Edgecombe wrote: > The other tests passed in both cases. I'm going to dig into the other > parts now but can circle back if it's not obvious what's going on > there. Finally got back to this. I think it's just a problem with the shadow stack detection logic

Re: [PATCH bpf-next 0/4] selftests/bpf: Update multiple prog_tests to use ASSERT_ macros

2023-11-17 Thread Yuran Pereira
Hello Andrii, On Fri, Nov 17, 2023 at 12:18:40PM -0500, Andrii Nakryiko wrote: > > It seems like you introduced a few failures in selftests, please take > a look at [0] and fix them, thanks! > Thank you for letting me know. I will see what's wrong and submit a v2 ASAP. Thanks, Yuran Pereira

Re: [PATCH RFC RFT v2 2/5] fork: Add shadow stack support to clone3()

2023-11-17 Thread Deepak Gupta
On Tue, Nov 14, 2023 at 08:05:55PM +, Mark Brown wrote: Unlike with the normal stack there is no API for configuring the the shadow stack for a new thread, instead the kernel will dynamically allocate a new shadow stack with the same size as the normal stack. This appears to be due to the sha

Re: [PATCH RFC RFT v2 5/5] kselftest/clone3: Test shadow stack support

2023-11-17 Thread Deepak Gupta
On Tue, Nov 14, 2023 at 11:11:58PM +, Edgecombe, Rick P wrote: On Tue, 2023-11-14 at 20:05 +, Mark Brown wrote: +static void test_shadow_stack_supported(void) +{ +    long shadow_stack; + +   shadow_stack = syscall(__NR_map_shadow_stack, 0, getpagesize(), 0); Hmm, x86 fails thi