Re: [PATCH 6/6] selftests: futex: remove duplicate unneeded defines

2023-10-05 Thread Muhammad Usama Anjum
On 10/3/23 1:46 PM, Ingo Molnar wrote: > > * Muhammad Usama Anjum wrote: > >> Kselftests are kernel tests and must be build with kernel headers from >> same source version. These duplicate defines should automatically >> picked up from kernel headers. Use KHDR_IN

Re: [PATCH 6/6] selftests: futex: remove duplicate unneeded defines

2023-10-06 Thread Muhammad Usama Anjum
On 10/6/23 1:25 AM, Ingo Molnar wrote: > > * Muhammad Usama Anjum wrote: > >> On 10/3/23 1:46 PM, Ingo Molnar wrote: >>> >>> * Muhammad Usama Anjum wrote: >>> >>>> Kselftests are kernel tests and must be build with kernel headers from &g

Re: [PATCH 1/6] selftests: capabilities: remove duplicate unneeded defines

2023-10-06 Thread Muhammad Usama Anjum
On 9/4/23 3:48 PM, Muhammad Usama Anjum wrote: > On 8/22/23 1:57 PM, Muhammad Usama Anjum wrote: >> Hi Shuah, >> >> Christian Brauner had picked [PATCH 4/6]. Others are still not picked. >> Please have a look. Shuah, I thought you had picked up these patches. But I&#

[PATCH v2] selftests: futex: remove duplicate unneeded defines

2023-10-06 Thread Muhammad Usama Anjum
. Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Make the explanation correct --- .../selftests/futex/include/futextest.h | 22 --- 1 file changed, 22 deletions(-) diff --git a/tools/testing/selftests/futex/include/futextest.h b/tools/testing/selftests/futex/include

[PATCH v2 1/4] selftests: capabilities: remove duplicate unneeded defines

2023-10-06 Thread Muhammad Usama Anjum
These duplicate defines should automatically be picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/capabilities/Makefile | 2 +- tools/testing/selftests/capabilities/test_execve.c | 8

[PATCH v2 2/4] selftests: clone3: remove duplicate defines

2023-10-06 Thread Muhammad Usama Anjum
Remove duplicate defines which are already included in kernel headers. MAX_PID_NS_LEVEL macro is used inside kernel only. It isn't exposed to userspace. So it is never defined in test application. Remove #ifndef in this case. Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Make

[PATCH v2 3/4] selftests: core: remove duplicate defines

2023-10-06 Thread Muhammad Usama Anjum
Remove duplicate defines which are already defined in kernel headers and re-definition isn't required. Signed-off-by: Muhammad Usama Anjum --- .../testing/selftests/core/close_range_test.c | 28 --- 1 file changed, 28 deletions(-) diff --git a/tools/testing/selftests

[PATCH v2 4/4] selftests: firmware: remove duplicate unneeded defines

2023-10-06 Thread Muhammad Usama Anjum
These duplicate defines should automatically be picked up from kernel headers. Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Make the patch explanation better --- tools/testing/selftests/firmware/fw_namespace.c | 4 1 file changed, 4 deletions(-) diff --git a/tools/testing

Re: [PATCH 1/6] selftests: capabilities: remove duplicate unneeded defines

2023-10-06 Thread Muhammad Usama Anjum
On 10/6/23 1:33 PM, Muhammad Usama Anjum wrote: > On 9/4/23 3:48 PM, Muhammad Usama Anjum wrote: >> On 8/22/23 1:57 PM, Muhammad Usama Anjum wrote: >>> Hi Shuah, >>> >>> Christian Brauner had picked [PATCH 4/6]. Others are still not picked. >>> Please h

Re: [PATCH 1/1] selftests/mm: include mman header to access MREMAP_DONTUNMAP identifier

2023-10-12 Thread Muhammad Usama Anjum
mm/mremap_dontunmap.c > @@ -7,6 +7,7 @@ > */ > #define _GNU_SOURCE > #include > +#include > #include > #include > #include Tested-by: Muhammad Usama Anjum -- BR, Muhammad Usama Anjum

Re: [PATCH 1/1] selftests/mm: include mman header to access MREMAP_DONTUNMAP identifier

2023-10-12 Thread Muhammad Usama Anjum
On 10/12/23 1:06 PM, Muhammad Usama Anjum wrote: > On 10/12/23 11:40 AM, Samasth Norway Ananda wrote: >> Definition for MREMAP_DONTUNMAP not present in the selftest for >> mremap_dontunmap thus throwing an undeclared error when running make >> on mm. > Thanks for sending

Re: [RFC PATCH v2 6/8] mseal: Check seal flag for mremap(2)

2023-10-20 Thread Muhammad Usama Anjum
odify_mm(mm, addr, addr + old_len, MM_SEAL_MREMAP)) { > + ret = -EACCES; > + goto out; > + } > + > /* >* Always allow a shrinking remap: that just unmaps >* the unnecessary pages.. -- BR, Muhammad Usama Anjum

Re: [RFC PATCH v2 8/8] selftest mm/mseal mprotect/munmap/mremap/mmap

2023-10-20 Thread Muhammad Usama Anjum
nd don't unmap src addr. > + ret2 = mremap(ptr, size, size, MREMAP_MAYMOVE | MREMAP_DONTUNMAP, 0); > + if (seal) { > + assert(ret2 == MAP_FAILED); > + assert(errno == EACCES); > + } else { > + assert(ret2 != MAP_FAILED); > + clean_single_address(ret2, size); > + } > + > + clean_single_address(ptr, page_size); > +} > + > +void test_seal_mremap_move_dontunmap_anyaddr(bool seal) > +{ > + LOG_TEST_ENTER(); > + void *ptr; > + void *newAddr; > + unsigned long page_size = getpagesize(); > + unsigned long size = 4 * page_size; > + int ret; > + void *ret2; > + > + setup_single_address(size, &ptr); > + > + if (seal) { > + ret = sys_mseal(ptr, size, MM_SEAL_MREMAP); > + assert(!ret); > + } > + > + /* > + * The 0xdeaddead should not have effect on dest addr > + * when MREMAP_DONTUNMAP is set. > + */ > + ret2 = mremap(ptr, size, size, MREMAP_MAYMOVE | MREMAP_DONTUNMAP, > + 0xdeaddead); > + if (seal) { > + assert(ret2 == MAP_FAILED); > + assert(errno == EACCES); > + } else { > + assert(ret2 != MAP_FAILED); > + assert((long)ret2 != 0xdeaddead); > + clean_single_address(ret2, size); > + } > + > + clean_single_address(ptr, page_size); > +} > + > +int main(int argc, char **argv) > +{ > + test_seal_invalid_input(); > + test_seal_addseals(); > + test_seal_addseals_combined(); > + test_seal_addseals_reject(); > + test_seal_unmapped_start(); > + test_seal_unmapped_middle(); > + test_seal_unmapped_end(); > + test_seal_multiple_vmas(); > + test_seal_split_start(); > + test_seal_split_end(); > + > + test_seal_zero_length(); > + test_seal_twice(); > + > + test_seal_mprotect(false); > + test_seal_mprotect(true); > + > + test_seal_start_mprotect(false); > + test_seal_start_mprotect(true); > + > + test_seal_end_mprotect(false); > + test_seal_end_mprotect(true); > + > + test_seal_mprotect_unalign_len(false); > + test_seal_mprotect_unalign_len(true); > + > + test_seal_mprotect_unalign_len_variant_2(false); > + test_seal_mprotect_unalign_len_variant_2(true); > + > + test_seal_mprotect_two_vma(false); > + test_seal_mprotect_two_vma(true); > + > + test_seal_mprotect_two_vma_with_split(false); > + test_seal_mprotect_two_vma_with_split(true); > + > + test_seal_mprotect_partial_mprotect(false); > + test_seal_mprotect_partial_mprotect(true); > + > + test_seal_mprotect_two_vma_with_gap(false); > + test_seal_mprotect_two_vma_with_gap(true); > + > + test_seal_mprotect_merge(false); > + test_seal_mprotect_merge(true); > + > + test_seal_mprotect_split(false); > + test_seal_mprotect_split(true); > + > + test_seal_munmap(false); > + test_seal_munmap(true); > + test_seal_munmap_two_vma(false); > + test_seal_munmap_two_vma(true); > + test_seal_munmap_vma_with_gap(false); > + test_seal_munmap_vma_with_gap(true); > + > + test_munmap_start_freed(false); > + test_munmap_start_freed(true); > + test_munmap_middle_freed(false); > + test_munmap_middle_freed(true); > + test_munmap_end_freed(false); > + test_munmap_end_freed(true); > + > + test_seal_mremap_shrink(false); > + test_seal_mremap_shrink(true); > + test_seal_mremap_expand(false); > + test_seal_mremap_expand(true); > + test_seal_mremap_move(false); > + test_seal_mremap_move(true); > + > + test_seal_mremap_shrink_fixed(false); > + test_seal_mremap_shrink_fixed(true); > + test_seal_mremap_expand_fixed(false); > + test_seal_mremap_expand_fixed(true); > + test_seal_mremap_move_fixed(false); > + test_seal_mremap_move_fixed(true); > + test_seal_mremap_move_dontunmap(false); > + test_seal_mremap_move_dontunmap(true); > + test_seal_mremap_move_fixed_zero(false); > + test_seal_mremap_move_fixed_zero(true); > + test_seal_mremap_move_dontunmap_anyaddr(false); > + test_seal_mremap_move_dontunmap_anyaddr(true); > + > + test_seal_mmap_overwrite_prot(false); > + test_seal_mmap_overwrite_prot(true); > + > + printf("OK\n"); > + return 0; > +} -- BR, Muhammad Usama Anjum

Re: [RFC PATCH v2 8/8] selftest mm/mseal mprotect/munmap/mremap/mmap

2023-10-20 Thread Muhammad Usama Anjum
On 10/20/23 8:23 PM, Peter Zijlstra wrote: > On Fri, Oct 20, 2023 at 07:24:03PM +0500, Muhammad Usama Anjum wrote: > >> Please remove these. These macros would be picked up from the kernel >> headers automatically. > > As per the previous discussions, how does that w

[PATCH] selftests: core: include linux/close_range.h for CLOSE_RANGE_* macros

2023-10-24 Thread Muhammad Usama Anjum
CV Link: https://lore.kernel.org/all/7161219e-0223-d699-d6f3-81abd9abf...@arm.com Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/core/close_range_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/core/close_range_test.c b/tools/testing/selftests/core/close_ran

Re: [PATCH v2 3/4] selftests: core: remove duplicate defines

2023-10-24 Thread Muhammad Usama Anjum
Hi Aishwarya, On 10/24/23 5:43 PM, Aishwarya TCV wrote: > > > On 06/10/2023 11:07, Muhammad Usama Anjum wrote: >> Remove duplicate defines which are already defined in kernel headers and >> re-definition isn't required. >> >> Signed-off-by: Muhamma

Re: [PATCH v33 6/6] selftests: mm: add pagemap ioctl tests

2023-11-02 Thread Muhammad Usama Anjum
On 11/2/23 4:45 PM, Ryan Roberts wrote: > On 21/08/2023 15:15, Muhammad Usama Anjum wrote: > > [...] > >> + >> + >> +int init_uffd(void) >> +{ >> +struct uffdio_api uffdio_api; >> + >> +uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O

[PATCH 1/2] selftests: mm: skip whole test instead of failure

2023-11-03 Thread Muhammad Usama Anjum
s") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/pagemap_ioctl.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c index 0161fb49fc6ef..f8685a2ea07

[PATCH 2/2] selftests: mm: fix some build warnings

2023-11-03 Thread Muhammad Usama Anjum
has type ‘int’ [-Wformat=] Fixes: 46fd75d4a3c9 ("selftests: mm: add pagemap ioctl tests") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/pagemap_ioctl.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/mm/pagemap_

Re: [PATCH] selftests: core: include linux/close_range.h for CLOSE_RANGE_* macros

2023-11-29 Thread Muhammad Usama Anjum
Soft reminder On 10/24/23 8:51 PM, Muhammad Usama Anjum wrote: > Correct header file is needed for getting CLOSE_RANGE_* macros. > Previously it was tested with newer glibc which didn't show the need to > include the header which was a mistake. > > Fixes: ec54424923cf (&quo

Re: [PATCH] selftests: core: include linux/close_range.h for CLOSE_RANGE_* macros

2023-12-11 Thread Muhammad Usama Anjum
Soft reminder On 11/29/23 4:34 PM, Muhammad Usama Anjum wrote: > Soft reminder > > On 10/24/23 8:51 PM, Muhammad Usama Anjum wrote: >> Correct header file is needed for getting CLOSE_RANGE_* macros. >> Previously it was tested with newer glibc which didn't show the nee

Re: [PATCH] Revert "selftests: error out if kernel header files are not yet built"

2023-12-11 Thread Muhammad Usama Anjum
the selftests build. Additional patches > will be required in order to change over to not requiring the kernel > headers. > > [1] > https://lore.kernel.org/20231208221007.go28...@noisy.programming.kicks-ass.net > > Cc: Anders Roxell > Cc: Muhammad Usama Anjum > Cc:

Re: [PATCH] Revert "selftests: error out if kernel header files are not yet built"

2023-12-11 Thread Muhammad Usama Anjum
On 12/12/23 12:00 AM, John Hubbard wrote: > On 12/11/23 03:00, Muhammad Usama Anjum wrote: >> On 12/9/23 7:01 AM, John Hubbard wrote: >>> This reverts commit 9fc96c7c19df ("selftests: error out if kernel header >>> files are not yet built"). >> I d

Re: [PATCH v6 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-12 Thread Muhammad Usama Anjum
}; -#endif /* _UAPI_LINUX_FS_H */ +#endif /* _LINUX_FS_H */ > > I really like this, at first reading anyway. > > Muhammad, Shuah, others, what do you think? > > +Cc: Muhammad Usama Anjum > > > thanks, -- BR, Muhammad Usama Anjum

[PATCH] selftests: secretmem: Floor the memory size to the multiple of page_size

2023-12-14 Thread Muhammad Usama Anjum
le of page_size. Fix this by flooring the length to be allocated with mmap() to the previous multiple of the page_size. Fixes: 76fe17ef588a ("secretmem: test: add basic selftest for memfd_secret(2)") Reported-by: "kernelci.org bot" Signed-off-by: Muhammad Usama Anj

Re: [PATCH] selftests: secretmem: Floor the memory size to the multiple of page_size

2023-12-14 Thread Muhammad Usama Anjum
Hi Andrew, On 12/15/23 12:40 AM, Andrew Morton wrote: > On Thu, 14 Dec 2023 15:19:30 +0500 Muhammad Usama Anjum > wrote: > >> The "locked-in-memory size" limit per process can be non-multiple of >> page_size. The mmap() fails if we try to allocate locked-in-

Re: [PATCH] selftests: secretmem: Floor the memory size to the multiple of page_size

2023-12-15 Thread Muhammad Usama Anjum
On 12/15/23 3:59 PM, Mike Rapoport wrote: > On Thu, Dec 14, 2023 at 03:19:30PM +0500, Muhammad Usama Anjum wrote: >> The "locked-in-memory size" limit per process can be non-multiple of >> page_size. The mmap() fails if we try to allocate locked-in-memory >> with sa

Re: [PATCH v14 10/12] selftests/landlock: Add network tests

2023-12-19 Thread Muhammad Usama Anjum
Hi Konstantin, There are some errors being reported in KernelCI: https://linux.kernelci.org/test/plan/id/657ab2240c761c0bd1e134ee/ The following sub-tests are failing: landlock_net_test_protocol_no_sandbox_with_ipv6_tcp_bind_unspec landlock_net_test_protocol_no_sandbox_with_ipv6_udp_bind_unspec l

Re: [PATCH v2 net-next] selftests/net: change shebang to bash to support "source"

2023-12-29 Thread Muhammad Usama Anjum
nt with other > tests, suggested by Hangbin > > Link: > https://lore.kernel.org/all/20231202020110.362433-1-liuhang...@gmail.com/ [1] > Link: > https://lore.kernel.org/all/20231219094856.1740079-1-liuhang...@gmail.com/ [2] > Reported-by: kernel test robot > Signed-off-by: Y

Re: [PATCH v3 1/2] selftests/vDSO: Fix building errors on LoongArch

2023-12-29 Thread Muhammad Usama Anjum
pu; > __vdso_clock_getres; > __vdso_clock_gettime; > __vdso_gettimeofday; > __vdso_rt_sigreturn; > local: *; > }; > } > > so VDSO_VERSION should be 6 and VDSO_NAMES should be 1 for LoongArch, > add them to fix the bu

Re: [PATCH v3 2/2] selftests/vDSO: Fix runtime errors on LoongArch

2023-12-29 Thread Muhammad Usama Anjum
st way. > > Since each architecture has already defined names and versions in > vdso_config.h, it is proper to include vdso_config.h to get version > and name for all archs. > > Signed-off-by: Tiezhu Yang Reviewed-by: Muhammad Usama Anjum Tested on x86, works fine. Tested-by

Re: [PATCH v3 0/2] selftests/vDSO: Fix errors on LoongArch

2023-12-29 Thread Muhammad Usama Anjum
please review and merge them for the upcoming merge window? People may be on vacation. I'm also waiting to hear back on my patches. Lets see when they get back and start picking up patches. > > https://lore.kernel.org/lkml/20231213012300.5640-1-yangtie...@loongson.cn/ > > Thanks, > Tiezhu > > -- BR, Muhammad Usama Anjum

Re: [PATCH v2] selftests: uevent: use shared makefile library

2023-12-29 Thread Muhammad Usama Anjum
ed -Wall $(KHDR_INCLUDES) > > -uevent_filtering: uevent_filtering.c ../kselftest.h ../kselftest_harness.h > - $(CC) $(CFLAGS) $< -o $@ > +TEST_GEN_PROGS = uevent_filtering > > -TEST_PROGS += $(BINARIES) > -EXTRA_CLEAN := $(BINARIES) > - > -all: $(BINARIES) > +include ../lib.mk -- BR, Muhammad Usama Anjum

Re: [PATCH] kunit: Protect string comparisons against NULL

2023-12-29 Thread Muhammad Usama Anjum
ULL. This could > be trapped by KUNIT_ASSERT_NOT_NULL() but that would terminate the test > at that point. It's preferable that the KUNIT_EXPECT_STR*() macros can > handle NULL pointers as a failure. > > Signed-off-by: Richard Fitzgerald Reviewed-by: Muhammad Usama Anjum > -

Re: [PATCH] kunit: Fix NULL-dereference in kunit_init_suite() if suite->log is NULL

2023-12-29 Thread Muhammad Usama Anjum
;kunit: add ability to run tests after boot using > debugfs") Reviewed-by: Muhammad Usama Anjum > --- > lib/kunit/test.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/lib/kunit/test.c b/lib/kunit/test.c > index e803d998e855..ea7f0913e5

Re: [PATCH] kselftest: Add basic test for probing the rust sample modules

2023-12-30 Thread Muhammad Usama Anjum
On 12/15/23 6:21 PM, Laura Nao wrote: > Add new basic kselftest that checks if the available rust sample modules > can be added and removed correctly. > > Signed-off-by: Laura Nao Reviewed-by: Muhammad Usama Anjum Tested-by: Muhammad Usama Anjum > ---

Re: [RFC PATCH v3 10/11] selftest mm/mseal memory sealing

2023-12-30 Thread Muhammad Usama Anjum
I wasn't CC-ed on the patch even though I'd reviewed the earlier revision. On 12/13/23 4:17 AM, jef...@chromium.org wrote: > From: Jeff Xu > > selftest for memory sealing change in mmap() and mseal(). > > Signed-off-by: Jeff Xu > --- > tools/testing/selftests/mm/.gitignore |1 + > tool

[PATCH 1/2] selftests/mm: conform test to TAP format output

2024-01-01 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/compaction_test.c | 91 ++-- 1 file changed, 44 insertions(+), 47 deletions

[PATCH 2/2] selftests/mm: skip test if application doesn't has root privileges

2024-01-01 Thread Muhammad Usama Anjum
The test depends on writing to nr_hugepages which isn't possible without root privileges. So skip the test in this case. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/compaction_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/te

[PATCH] selftests/mm: conform test to TAP format output

2024-01-01 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/gup_test.c | 70 +++ 1 file changed, 38 insertions(+), 32 deletions

[PATCH] selftests: mm: hugepage-mmap: conform to TAP format output

2024-01-01 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugepage-mmap.c | 23 -- 1 file changed, 13 insertions(+), 10 deletions

[Patch v2] selftests/mm: gup_test: conform test to TAP format output

2024-01-01 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Fix typo - Update subject --- tools/testing/selftests/mm/gup_test.c | 65

[PATCH] mm/selftests: hugepage-mremap: conform test to TAP format output

2024-01-02 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugepage-mremap.c | 87 1 file changed, 35 insertions(+), 52 deletions

Re: [PATCH] selftests: core: include linux/close_range.h for CLOSE_RANGE_* macros

2024-01-05 Thread Muhammad Usama Anjum
Kind reminder On 12/11/23 4:01 PM, Muhammad Usama Anjum wrote: > Soft reminder > > On 11/29/23 4:34 PM, Muhammad Usama Anjum wrote: >> Soft reminder >> >> On 10/24/23 8:51 PM, Muhammad Usama Anjum wrote: >>> Correct header file is needed for getting CLOSE_R

Re: [RFC PATCH v4 3/4] selftest mm/mseal memory sealing

2024-01-08 Thread Muhammad Usama Anjum
You have used ksft_print_msg() only. Can you please udpate the test to use more TAP macros for increased readability and printing test output. We don't want to terminate the test if one test fails because of assert. We want the sub-tests to get executed indepdendent of other tests. ksft_test_resul

[PATCH] selftests/mm: mremap_test: fix build warning

2024-01-11 Thread Muhammad Usama Anjum
Fix following build warning: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long unsigned int’ Fixes: a4cb3b243343 ("selftests: mm: add a test for remapping to area immediately after existing mapping") Signed-off-by: Muhammad Usama Anjum --- too

[PATCH 1/7] selftests/mm: hugepage-shm: conform test to TAP format output

2024-01-11 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. The "." was being printed inside for loop to indicate the writes progress. This was extraneous and hence removed in the patch. Signed-off-by: Muha

[PATCH 2/7] selftests/mm: hugepage-vmemmap: conform test to TAP format output

2024-01-11 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugepage-vmemmap.c | 36 +-- 1 file changed, 17 insertions(+), 19 deletions

[PATCH 3/7] selftests/mm: hugetlb-madvise: conform test to TAP format output

2024-01-11 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugetlb-madvise.c | 209 +++ 1 file changed, 81 insertions(+), 128

[PATCH 4/7] selftests/mm: khugepaged: conform test to TAP format output

2024-01-11 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/khugepaged.c | 378 ++-- 1 file changed, 160 insertions(+), 218

[PATCH 5/7] selftests/mm: hugetlb-read-hwpoison: conform test to TAP format output

2024-01-11 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- Tested this by reverting the patch a08c7193e4f18dc8508f2d07d0de2c5b94cb39a3 ("mm/filemap: remove hugetlb special c

[PATCH 6/7] selftests/mm: ksm_tests: conform test to TAP format output

2024-01-11 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/ksm_tests.c | 682 ++--- 1 file changed, 276 insertions(+), 406

[PATCH 7/7] selftests/mm: config: add missing configs

2024-01-11 Thread Muhammad Usama Anjum
Add configurations which are needed for - hugetlb-read-hwpoison - ksm_functional_test and ksm_test Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/mm/config b/tools/testing/selftests/mm

Re: [PATCH 4/7] selftests/mm: khugepaged: conform test to TAP format output

2024-01-11 Thread Muhammad Usama Anjum
Sorry, forgot to remvove 2 lines. I'll resend if there aren't any comments until tomorrow. On 1/11/24 4:56 PM, Muhammad Usama Anjum wrote: > Conform the layout, informational and status messages to TAP. No > functional change is intended other than the layout of output messages.

Re: [PATCH] selftests/mm: mremap_test: fix build warning

2024-01-11 Thread Muhammad Usama Anjum
On 1/12/24 2:14 AM, Andrew Morton wrote: > On Thu, 11 Jan 2024 13:20:38 +0500 Muhammad Usama Anjum > wrote: > >> Fix following build warning: >> warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type >> ‘long long unsigned int’ >> >

[PATCH v2] selftests/mm: mremap_test: fix build warning

2024-01-11 Thread Muhammad Usama Anjum
: a4cb3b243343 ("selftests: mm: add a test for remapping to area immediately after existing mapping") Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Don't just fix the print format, instead use different variables --- tools/testing/selftests/mm/mremap_test.c | 27 -

[PATCH v2 1/7] selftests/mm: hugepage-shm: conform test to TAP format output

2024-01-11 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. The "." was being printed inside for loop to indicate the writes progress. This was extraneous and hence removed in the patch. Signed-off-by: Muha

[PATCH v2 2/7] selftests/mm: hugepage-vmemmap: conform test to TAP format output

2024-01-11 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugepage-vmemmap.c | 36 +-- 1 file changed, 17 insertions(+), 19 deletions

[PATCH v2 3/7] selftests/mm: hugetlb-madvise: conform test to TAP format output

2024-01-11 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugetlb-madvise.c | 209 +++ 1 file changed, 81 insertions(+), 128

[PATCH v2 4/7] selftests/mm: khugepaged: conform test to TAP format output

2024-01-11 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Remove commented out lines of code --- tools/testing/selftests/mm/khugepaged.c | 381

[PATCH v2 5/7] selftests/mm: hugetlb-read-hwpoison: conform test to TAP format output

2024-01-11 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- Tested this by reverting the patch a08c7193e4f18dc8508f2d07d0de2c5b94cb39a3 ("mm/filemap: remove hugetlb special c

[PATCH v2 6/7] selftests/mm: ksm_tests: conform test to TAP format output

2024-01-11 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/ksm_tests.c | 682 ++--- 1 file changed, 276 insertions(+), 406

[PATCH v2 7/7] selftests/mm: config: add missing configs

2024-01-11 Thread Muhammad Usama Anjum
Add configurations which are needed for - hugetlb-read-hwpoison - ksm_functional_test and ksm_test Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/mm/config b/tools/testing/selftests/mm

Re: [PATCH v2 5/7] selftests/mm: hugetlb-read-hwpoison: conform test to TAP format output

2024-01-14 Thread Muhammad Usama Anjum
On 1/13/24 6:08 AM, Jiaqi Yan wrote: > On Thu, Jan 11, 2024 at 11:21 PM Muhammad Usama Anjum > wrote: >> >> Conform the layout, informational and status messages to TAP. No >> functional change is intended other than the layout of output messages. >> >>

Re: [PATCH v2 5/7] selftests/mm: hugetlb-read-hwpoison: conform test to TAP format output

2024-01-14 Thread Muhammad Usama Anjum
On 1/15/24 11:52 AM, Jiaqi Yan wrote: > On Sun, Jan 14, 2024 at 10:32 PM Muhammad Usama Anjum > wrote: >> >> On 1/13/24 6:08 AM, Jiaqi Yan wrote: >>> On Thu, Jan 11, 2024 at 11:21 PM Muhammad Usama Anjum >>> wrote: >>>> >>>> Conf

[PATCH v3 1/7] selftests/mm: hugepage-shm: conform test to TAP format output

2024-01-14 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. The "." was being printed inside for loop to indicate the writes progress. This was extraneous and hence removed in the patch. Signed-off-by: Muha

[PATCH v3 2/7] selftests/mm: hugepage-vmemmap: conform test to TAP format output

2024-01-14 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugepage-vmemmap.c | 36 +-- 1 file changed, 17 insertions(+), 19 deletions

[PATCH v3 3/7] selftests/mm: hugetlb-madvise: conform test to TAP format output

2024-01-14 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugetlb-madvise.c | 209 +++ 1 file changed, 81 insertions(+), 128

[PATCH v3 4/7] selftests/mm: khugepaged: conform test to TAP format output

2024-01-14 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Remove commented out lines of code --- tools/testing/selftests/mm/khugepaged.c | 381

[PATCH v3 5/7] selftests/mm: hugetlb-read-hwpoison: conform test to TAP format output

2024-01-14 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- Changes in v3: - Use ksft_perror as short hand instead of missing strerror(errno) at one place Tested this by

[PATCH v3 6/7] selftests/mm: ksm_tests: conform test to TAP format output

2024-01-14 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/ksm_tests.c | 682 ++--- 1 file changed, 276 insertions(+), 406

[PATCH v3 7/7] selftests/mm: config: add missing configs

2024-01-14 Thread Muhammad Usama Anjum
Add configurations which are needed for - hugetlb-read-hwpoison - ksm_functional_test and ksm_test Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/mm/config b/tools/testing/selftests/mm

Re: [PATCH net] selftests: bonding: add missing build configs

2024-01-15 Thread Muhammad Usama Anjum
("selftests: include bonding tests into the kselftest > infra") > Signed-off-by: Jakub Kicinski Acked-by: Muhammad Usama Anjum > --- > CC: j.vosbu...@gmail.com > CC: a...@greyhouse.net > CC: sh...@kernel.org > CC: bpoir...@nvidia.com > CC: jon.toppins+li...@

[PATCH] selftests/mm: switch to bash from sh

2024-01-16 Thread Muhammad Usama Anjum
: Syntax error: "(" unexpected Switch to using /bin/bash instead of /bin/sh. Make the switch for write_hugetlb_memory.sh as well which is called from charge_reserved_hugetlb.sh. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/charge_reserved_hugetlb.sh | 2 +- too

[PATCH] selftests/mm: run_vmtests.sh: add missing tests

2024-01-16 Thread Muhammad Usama Anjum
Add missing tests to run_vmtests.sh. The mm kselftests are run through run_vmtests.sh. If a test isn't present in this script, it'll not run with run_tests or `make -C tools/testing/selftests/mm run_tests`. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/run_vmte

Re: [PATCH] selftests/mm: switch to bash from sh

2024-01-16 Thread Muhammad Usama Anjum
On 1/16/24 9:52 PM, David Laight wrote: > From: Muhammad Usama Anjum >> Sent: 16 January 2024 09:05 >> >> Running charge_reserved_hugetlb.sh generates errors if sh is set to >> dash: >> >> /charge_reserved_hugetlb.sh: 9: [[: not found >> /

Re: [PATCH v3 5/7] selftests/mm: hugetlb-read-hwpoison: conform test to TAP format output

2024-01-16 Thread Muhammad Usama Anjum
On 1/16/24 10:07 PM, Jiaqi Yan wrote: > On Sun, Jan 14, 2024 at 11:33 PM Muhammad Usama Anjum > wrote: >> >> Conform the layout, informational and status messages to TAP. No >> functional change is intended other than the layout of output messages. >> >>

Re: [PATCH] selftests/mm: run_vmtests.sh: add missing tests

2024-01-22 Thread Muhammad Usama Anjum
drew has dropped this patch for now. > > On 16/01/2024 09:06, Muhammad Usama Anjum wrote: >> Add missing tests to run_vmtests.sh. The mm kselftests are run through >> run_vmtests.sh. If a test isn't present in this script, it'll not run >> with run_tests or `make

[PATCH v2 2/2] selftests/mm: run_vmtests: remove sudo and conform to tap

2024-01-22 Thread Muhammad Usama Anjum
Remove sudo as some test running environments may not have sudo available. Instead skip the test if root privileges aren't available in the test. Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Added this patch in v2 We are allocating 2*RLIMIT_MEMLOCK.rlim_max memory and

[PATCH v2 1/2] selftests/mm: run_vmtests.sh: add missing tests

2024-01-22 Thread Muhammad Usama Anjum
Add missing tests to run_vmtests.sh. The mm kselftests are run through run_vmtests.sh. If a test isn't present in this script, it'll not run with run_tests or `make -C tools/testing/selftests/mm run_tests`. Cc: Ryan Roberts Signed-off-by: Muhammad Usama Anjum --- Changes since v1:

Re: [PATCH] selftests/mm: run_vmtests.sh: add missing tests

2024-01-22 Thread Muhammad Usama Anjum
can tell me what the new requirement > is: I'm not sure about the exact requirement of the number of hugetlb for these tests. But I specify hugepages=1000 and tests work for me. I've sent v2 [1]. Would it be possible to run your CI on that and share results before we merge that one? [1] https://lore.kernel.org/all/20240123073615.920324-1-usama.an...@collabora.com > > hugepagesz=1G hugepages=0:2,1:2 hugepagesz=32M hugepages=0:2,1:2 > default_hugepagesz=2M hugepages=0:64,1:64 hugepagesz=64K hugepages=0:2,1:2 > > Thanks, > Ryan > -- BR, Muhammad Usama Anjum

Re: [PATCH v3 1/7] selftests/mm: hugepage-shm: conform test to TAP format output

2024-01-22 Thread Muhammad Usama Anjum
Hi Andrew, There hasn't been any comment on these. I guess, they can be picked up now? Thanks, On 1/15/24 12:32 PM, Muhammad Usama Anjum wrote: > Conform the layout, informational and status messages to TAP. No > functional change is intended other than the layout of output message

Re: [PATCH] selftests: core: include linux/close_range.h for CLOSE_RANGE_* macros

2024-01-22 Thread Muhammad Usama Anjum
Hi, Can anybody please pick this patch? This was fixing genuine regression in some build system. Thanks, On 10/24/23 8:51 PM, Muhammad Usama Anjum wrote: > Correct header file is needed for getting CLOSE_RANGE_* macros. > Previously it was tested with newer glibc which didn't show

Re: [PATCH v2 1/2] selftests/mm: run_vmtests.sh: add missing tests

2024-01-23 Thread Muhammad Usama Anjum
Hi Ryan, Thank you so much for reviewing and getting involved. On 1/23/24 2:33 PM, Ryan Roberts wrote: > On 23/01/2024 07:36, Muhammad Usama Anjum wrote: >> Add missing tests to run_vmtests.sh. The mm kselftests are run through >> run_vmtests.sh. If a test isn't present in th

[PATCH v3 0/5] selftests/mm: Improve run_vmtests.sh

2024-01-25 Thread Muhammad Usama Anjum
v2: https://lore.kernel.org/all/20240123073615.920324-1-usama.an...@collabora.com Muhammad Usama Anjum (5): selftests/mm: hugetlb_reparenting_test: do not unmount selftests/mm: run_vmtests: remove sudo and conform to tap selftests/mm: save and restore nr_hugepages value selftests/

[PATCH v3 1/5] selftests/mm: hugetlb_reparenting_test: do not unmount

2024-01-25 Thread Muhammad Usama Anjum
cgroup setting") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugetlb_reparenting_test.sh | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/hugetlb_reparenting_test.sh b/tools/testing/selftests/mm/hugetlb_reparenting_test.sh

[PATCH v3 2/5] selftests/mm: run_vmtests: remove sudo and conform to tap

2024-01-25 Thread Muhammad Usama Anjum
Remove sudo as some test running environments may not have sudo available. Instead skip the test if root privileges aren't available in the test. Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Added this patch in v2 We are allocating 2*RLIMIT_MEMLOCK.rlim_max memory and

[PATCH v3 3/5] selftests/mm: save and restore nr_hugepages value

2024-01-25 Thread Muhammad Usama Anjum
Save and restore nr_hugepages before changing it during the test. A test should not change system wide settings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/charge_reserved_hugetlb.sh | 4 tools/testing/selftests/mm/hugetlb_reparenting_test.sh | 3 +++ 2 files

[PATCH v3 4/5] selftests/mm: protection_keys: save/restore nr_hugepages settings

2024-01-25 Thread Muhammad Usama Anjum
Save and restore nr_hugepages before changing it during the test. A test should not change system wide settings. Fixes: 5f23f6d082a9 ("x86/pkeys: Add self-tests") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/protection_keys.c | 34 1 file c

[PATCH v3 5/5] selftests/mm: run_vmtests.sh: add missing tests

2024-01-25 Thread Muhammad Usama Anjum
Add missing tests to run_vmtests.sh. The mm kselftests are run through run_vmtests.sh. If a test isn't present in this script, it'll not run with run_tests or `make -C tools/testing/selftests/mm run_tests`. Cc: Ryan Roberts Signed-off-by: Muhammad Usama Anjum --- Changes since v1:

[PATCH v4 2/7] selftests/mm: hugepage-vmemmap: conform test to TAP format output

2024-01-26 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- Changes since v3: - Rebase to next-20240125 - Update newly updated code --- tools/testing/selftests/mm/hugepage

[PATCH v4 3/7] selftests/mm: hugetlb-madvise: conform test to TAP format output

2024-01-26 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- Changes since v3: - Rebased on top of next-20240125 --- tools/testing/selftests/mm/hugetlb-madvise.c | 207

[PATCH v4 4/7] selftests/mm: khugepaged: conform test to TAP format output

2024-01-26 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Skip test if root privileges aren't provided. Signed-off-by: Muhammad Usama Anjum --- Changes since v3: - Rebased on top of next-20240125 - Skip test if

[PATCH v4 6/7] selftests/mm: ksm_tests: conform test to TAP format output

2024-01-26 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- Changes since v3: - Rebased on top of next-20240125 - Resolves minor conflict --- tools/testing/selftests/mm

[PATCH v4 7/7] selftests/mm: config: add missing configs

2024-01-26 Thread Muhammad Usama Anjum
Add configurations which are needed for - hugetlb-read-hwpoison - ksm_functional_test and ksm_test Signed-off-by: Muhammad Usama Anjum --- Changes since v3: - Rebased on top of next-20240125 --- tools/testing/selftests/mm/config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools

[PATCH v4 5/7] selftests/mm: hugetlb-read-hwpoison: conform test to TAP format output

2024-01-26 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Reviewed-by: Jiaqi Yan Signed-off-by: Muhammad Usama Anjum --- Changes since v3: - Rebased on top of next-20240125 - Added reviewed-by tag - Tested this on

[PATCH v4 1/7] selftests/mm: hugepage-shm: conform test to TAP format output

2024-01-26 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. The "." was being printed inside for loop to indicate the writes progress. This was extraneous and hence removed in the patch. Signed-off-by: Muha

Re: [PATCH] selftests/mm: run_vmtests.sh: add hugetlb test category

2024-01-29 Thread Muhammad Usama Anjum
On 1/29/24 4:52 PM, Breno Leitao wrote: > The usage of run_vmtests.sh does not include hugetlb, which is a valid > test category. > > Add the 'hugetlb' to the usage of run_vmtests.sh. > > Signed-off-by: Breno Leitao Reviewed-by: Muhammad Usama Anjum > --

[PATCH 01/12] selftests/mm: map_fixed_noreplace: conform test to TAP format output

2024-01-31 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. While at it, convert commenting style from // to /**/. Signed-off-by: Muhammad Usama Anjum --- .../selftests/mm/map_fixed_noreplace.c| 96

[PATCH 02/12] selftests/mm: map_hugetlb: conform test to TAP format output

2024-01-31 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/map_hugetlb.c | 42 +++- 1 file changed, 20 insertions(+), 22 deletions

  1   2   3   4   5   >