[PATCH] selftests/mm: Confirm VA exhaustion without reliance on correctness of mmap()

2024-03-21 Thread Dev Jain
Currently, VA exhaustion is being checked by passing a hint to mmap() and expecting it to fail. This patch makes a stricter test by successful write() calls from /proc/self/maps to a dump file, confirming that a free chunk is indeed not available. Signed-off-by: Dev Jain --- Merge dependency: ht

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-21 Thread Yi Liu
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 set_dev_p

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-21 Thread Jason Gunthorpe
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 of the > > devices just means one d

Re: [PATCH 1/8] iommu: Introduce a replace API for device pasid

2024-03-21 Thread Yi Liu
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 o

Re: [PATCH] selftests: livepatch: Test atomic replace against multiple modules

2024-03-21 Thread Joe Lawrence
On 3/12/24 08:12, Marcos Paulo de Souza wrote: > This new test checks if a livepatch with replace attribute set replaces > all previously applied livepatches. > > Signed-off-by: Marcos Paulo de Souza > --- > tools/testing/selftests/livepatch/Makefile | 3 +- > .../selftests/livepatch/te

[PATCH] kunit: bail out early in __kunit_test_suites_init() if there are no suites to test

2024-03-21 Thread Scott Mayhew
Commit c72a870926c2 added a mutex to prevent kunit tests from running concurrently. Unfortunately that mutex gets locked during module load regardless of whether the module actually has any kunit tests. This causes a problem for kunit tests that might need to load other kernel modules (e.g. gss_k

Re: [PATCH bpf-next v4 3/6] bpf/helpers: introduce bpf_timer_set_sleepable_cb() kfunc

2024-03-21 Thread Benjamin Tissoires
On Mon, Mar 18, 2024 at 11:52 PM Eduard Zingerman wrote: > > On Fri, 2024-03-15 at 15:29 +0100, Benjamin Tissoires wrote: > > This patch looks good to me, please see two nitpicks below. > Acked-by: Eduard Zingerman Thanks! > > [...] > > > @@ -1350,6 +1358,11 @@ BPF_CALL_3(bpf_timer_start, struc

Re: [PATCH bpf-next v4 6/6] selftests/bpf: add sleepable timer tests

2024-03-21 Thread Benjamin Tissoires
On Tue, Mar 19, 2024 at 1:20 AM Eduard Zingerman wrote: > > On Fri, 2024-03-15 at 15:29 +0100, Benjamin Tissoires wrote: > > bpf_experimental.h and ../bpf_testmod/bpf_testmod_kfunc.h are both > > including vmlinux.h, which is not compatible with including time.h > > or bpf_tcp_helpers.h. > > > > S

Re: [PATCH bpf-next v4 2/6] bpf/verifier: add bpf_timer as a kfunc capable type

2024-03-21 Thread Benjamin Tissoires
On Mon, Mar 18, 2024 at 10:59 PM Eduard Zingerman wrote: > > On Fri, 2024-03-15 at 15:29 +0100, Benjamin Tissoires wrote: > [...] > > > @@ -12021,6 +12034,12 @@ static int check_kfunc_args(struct > > bpf_verifier_env *env, struct bpf_kfunc_call_ > > if (ret) > >

Re: [PATCH bpf-next v4 4/6] bpf/helpers: mark the callback of bpf_timer_set_sleepable_cb() as sleepable

2024-03-21 Thread Benjamin Tissoires
On Tue, Mar 19, 2024 at 12:54 AM Eduard Zingerman wrote: > > On Fri, 2024-03-15 at 15:29 +0100, Benjamin Tissoires wrote: > [...] > > > @@ -5279,7 +5281,8 @@ static int map_kptr_match_type(struct > > bpf_verifier_env *env, > > > > static bool in_sleepable(struct bpf_verifier_env *env) > > { > >

[PATCH v1] uffd-unit-tests: Fix ARM related issue with fork after pthread_create

2024-03-21 Thread Edward Liaw
Following issue was observed while running the uffd-unit-tests selftest on ARM devices. On x86_64 no issues were detected: pthread_create followed by fork caused deadlock in certain cases wherein fork required some work to be completed by the created thread. Used synchronization to ensure that cre

Re: [BUG] selftests/net: test_vxlan_mdb.sh: 84 out of 642 tests [FAIL]

2024-03-21 Thread Mirsad Todorovac
On 3/20/24 12:01, Ido Schimmel wrote: On Wed, Mar 20, 2024 at 01:47:36AM +0100, Mirsad Todorovac wrote: On 3/19/24 15:25, Ido Schimmel wrote: Will look into it today or later this week. Thank you for considering this. Can you please try the following patch? https://github.com/idosch/lin

Re: [BUG] selftests/net: test_vxlan_mdb.sh: 84 out of 642 tests [FAIL]

2024-03-21 Thread Mirsad Todorovac
On 3/20/24 12:01, Ido Schimmel wrote: On Wed, Mar 20, 2024 at 01:47:36AM +0100, Mirsad Todorovac wrote: On 3/19/24 15:25, Ido Schimmel wrote: Will look into it today or later this week. Thank you for considering this. Can you please try the following patch? https://github.com/idosch/lin

[PATCH v2] uffd-unit-tests: Fix ARM related issue with fork after pthread_create

2024-03-21 Thread Edward Liaw
Following issue was observed while running the uffd-unit-tests selftest on ARM devices. On x86_64 no issues were detected: pthread_create followed by fork caused deadlock in certain cases wherein fork required some work to be completed by the created thread. Used synchronization to ensure that cre

Re: [PATCH] selftests/mm: Confirm VA exhaustion without reliance on correctness of mmap()

2024-03-21 Thread Andrew Morton
On Thu, 21 Mar 2024 16:05:22 +0530 Dev Jain wrote: > Currently, VA exhaustion is being checked by passing a hint to mmap() and > expecting it to fail. This patch makes a stricter test by successful write() > calls from /proc/self/maps to a dump file, confirming that a free chunk is > indeed not a

Re: [RFC PATCH v5 01/29] KVM: selftests: Add function to allow one-to-one GVA to GPA mappings

2024-03-21 Thread Zhang, Dongsheng X
On 12/12/2023 12:46 PM, Sagi Shahar wrote: > From: Ackerley Tng > > One-to-one GVA to GPA mappings can be used in the guest to set up boot > sequences during which paging is enabled, hence requiring a transition > from using physical to virtual addresses in consecutive instructions. > > Signe

Re: [RFC PATCH v5 05/29] KVM: selftests: Add helper functions to create TDX VMs

2024-03-21 Thread Zhang, Dongsheng X
On 12/12/2023 12:46 PM, Sagi Shahar wrote: > From: Erdem Aktas > > TDX requires additional IOCTLs to initialize VM and vCPUs to add > private memory and to finalize the VM memory. Also additional utility > functions are provided to manipulate a TD, similar to those that > manipulate a VM in th

[PATCH v1] selftests/mm: sigbus-wp test requires UFFD_FEATURE_WP_HUGETLBFS_SHMEM

2024-03-21 Thread Edward Liaw
The sigbus-wp test requires the UFFD_FEATURE_WP_HUGETLBFS_SHMEM flag for shmem and hugetlb targets. Otherwise it is not backwards compatible with kernels <5.19 and fails with EINVAL. Signed-off-by: Edward Liaw --- tools/testing/selftests/mm/uffd-unit-tests.c | 3 ++- 1 file changed, 2 insertion

Re: [RFC PATCH v5 08/29] KVM: selftests: TDX: Add TDX lifecycle test

2024-03-21 Thread Zhang, Dongsheng X
On 12/12/2023 12:46 PM, Sagi Shahar wrote: > From: Erdem Aktas > > Adding a test to verify TDX lifecycle by creating a TD and running a > dummy TDG.VP.VMCALL inside it. > > Signed-off-by: Erdem Aktas > Signed-off-by: Ryan Afranji > Signed-off-by: Sagi Shahar > Co-developed-by: Ackerley Tn

Re: [PATCH] kunit: bail out early in __kunit_test_suites_init() if there are no suites to test

2024-03-21 Thread Rae Moar
On Thu, Mar 21, 2024 at 10:32 AM Scott Mayhew wrote: > > Commit c72a870926c2 added a mutex to prevent kunit tests from running > concurrently. Unfortunately that mutex gets locked during module load > regardless of whether the module actually has any kunit tests. This > causes a problem for kuni

Re: [PATCH v1] selftests/mm: sigbus-wp test requires UFFD_FEATURE_WP_HUGETLBFS_SHMEM

2024-03-21 Thread Andrew Morton
On Thu, 21 Mar 2024 23:20:21 + Edward Liaw wrote: > The sigbus-wp test requires the UFFD_FEATURE_WP_HUGETLBFS_SHMEM flag for > shmem and hugetlb targets. Otherwise it is not backwards compatible > with kernels <5.19 and fails with EINVAL. > > ... > > --- a/tools/testing/selftests/mm/uffd-un

Re: [RFC PATCH v5 15/29] KVM: selftests: TDX: Add TDX MSR read/write tests

2024-03-21 Thread Zhang, Dongsheng X
On 12/12/2023 12:46 PM, Sagi Shahar wrote: > The test verifies reads and writes for MSR registers with different access > level. > > Signed-off-by: Sagi Shahar > Signed-off-by: Ackerley Tng > Signed-off-by: Ryan Afranji > --- > .../selftests/kvm/include/x86_64/tdx/tdx.h| 5 + > .../se

Re: [RFC PATCH v5 17/29] KVM: selftests: TDX: Add TDX MMIO reads test

2024-03-21 Thread Zhang, Dongsheng X
On 12/12/2023 12:46 PM, Sagi Shahar wrote: > The test verifies MMIO reads of various sizes from the host to the guest. > > Signed-off-by: Sagi Shahar > Signed-off-by: Ackerley Tng > Signed-off-by: Ryan Afranji > --- > .../selftests/kvm/include/x86_64/tdx/tdcall.h | 2 + > .../selftests/kvm

Re: [RFC PATCH v5 18/29] KVM: selftests: TDX: Add TDX MMIO writes test

2024-03-21 Thread Zhang, Dongsheng X
On 12/12/2023 12:46 PM, Sagi Shahar wrote: > The test verifies MMIO writes of various sizes from the guest to the host. > > Signed-off-by: Sagi Shahar > Signed-off-by: Ackerley Tng > Signed-off-by: Ryan Afranji > --- > .../selftests/kvm/include/x86_64/tdx/tdx.h| 2 + > .../selftests/kv

Re: [PATCH] Documentation: kunit: correct KUNIT_VERY_SLOW to KUNIT_SPEED_VERY_SLOW

2024-03-21 Thread David Gow
On Wed, 20 Mar 2024 at 16:18, Kemeng Shi wrote: > > There is no KUNIT_VERY_SLOW, I guess we mean KUNIT_SPEED_VERY_SLOW. > > Signed-off-by: Kemeng Shi > --- Nice catch, thanks! Reviewed-by: David Gow Cheers, -- David > Documentation/dev-tools/kunit/running_tips.rst | 4 ++-- > 1 file changed

Re: [PATCH] selftests/mm: Confirm VA exhaustion without reliance on correctness of mmap()

2024-03-21 Thread Dev Jain
On 3/22/24 03:21, Andrew Morton wrote: On Thu, 21 Mar 2024 16:05:22 +0530 Dev Jain wrote: Currently, VA exhaustion is being checked by passing a hint to mmap() and expecting it to fail. This patch makes a stricter test by successful write() calls from /proc/self/maps to a dump file, confirmi