[PATCH 0/8] selftests: x86: build suite with clang

2024-05-01 Thread Muhammad Usama Anjum
test would fail with clang. Should we disable this test for now when clang is used until the bug is fixed in clang? Not sure. Any opinions? [1] https://github.com/llvm/llvm-project/issues/53728 Muhammad Usama Anjum (8): selftests: x86: Remove dependence of headers file selftests

[PATCH 1/8] selftests: x86: Remove dependence of headers file

2024-05-01 Thread Muhammad Usama Anjum
Remove header file dependence to remove the following error caught by clang. clang: error: cannot specify -o when generating multiple output files Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/x86/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 2/8] selftests: x86: check_initial_reg_state: remove -no-pie while using -static

2024-05-01 Thread Muhammad Usama Anjum
The -static clang flag ignores -no-pie flag. Hence following warning is generated. Fix the warning by removing the -no-pie flag before specifying -static flag. clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument] Signed-off-by: Muhammad U

[PATCH 3/8] selftests: x86: test_vsyscall: remove unused function

2024-05-01 Thread Muhammad Usama Anjum
Remove unused function to fix the following warning: test_vsyscall.c:100:19: warning: unused function 'sys_clock_gettime' [-Wunused-function] 100 | static inline int sys_clock_gettime(clockid_t id, struct timespec *ts) Signed-off-by: Muhammad Usama Anjum --- tools/testing/sel

[PATCH 4/8] selftests: x86: fsgsbase_restore: fix asm directive from =rm to =r

2024-05-01 Thread Muhammad Usama Anjum
;mov %" SEG ":(0), %0" : "=rm" (ret)); | ^ :1:2: note: instantiated into assembly here 1 | mov %fs:(0), 20(%esp) | ^ Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/x86/fsgsbase_restore.c | 2 +- 1 file change

[PATCH 5/8] selftests: x86: syscall_arg_fault_32: remove unused variable

2024-05-01 Thread Muhammad Usama Anjum
Remove unused global variable. syscall_arg_fault.c:32:30: warning: unused variable 'sig_traps' [-Wunused-variable] 32 | static volatile sig_atomic_t sig_traps; Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/x86/syscall_arg_fault.c | 1 - 1 file changed, 1 deletio

[PATCH 6/8] selftests: x86: test_FISTTP: use fisttps instead of ambigous fisttp

2024-05-01 Thread Muhammad Usama Anjum
res16""\n" | ^ :4:2: note: instantiated into assembly here 4 | fisttp res16 | ^ test_FISTTP.c:91:3: error: ambiguous instructions require an explicit suffix (could be 'fisttps', or 'fisttpl') 91 | " fisttp res16&q

[PATCH 7/8] selftests: x86: fsgsbase: Remove unused function and variable

2024-05-01 Thread Muhammad Usama Anjum
15 | static volatile bool remote_hard_zero; | ^~~~ Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/x86/fsgsbase.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/tools/testing/selftests/x86/fsgsbase.c b/tools/testing/selftests/

[PATCH 8/8] selftests: x86: amx: Remove unused functions

2024-05-01 Thread Muhammad Usama Anjum
int64_t get_xstatebv(struct xsave_buffer *buffer) |^~~~ Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/x86/amx.c | 16 1 file changed, 16 deletions(-) diff --git a/tools/testing/selftests/x86/amx.c b/tools/testing/selft

Re: [linus:master] [selftests/harness] 8092162335: kernel-selftests.sgx.make.fail

2024-05-01 Thread Muhammad Usama Anjum
ned the first time stdio.h was included hence the definition of asprintf isn't present. The second inclusion of stdio.h when _GNU_SOURCE is defined is ignored as it was already included. This is being fixed in following series: https://lore.kernel.org/all/20240430235057.1351993-1-edl...@google.com -- BR, Muhammad Usama Anjum

Re: [PATCH bpf-next v3] selftests/bpf: Move test_dev_cgroup to prog_tests

2024-05-03 Thread Muhammad Usama Anjum
On 4/5/24 1:06 AM, Yonghong Song wrote: > > On 4/3/24 5:03 AM, Muhammad Usama Anjum wrote: >> On 4/3/24 7:36 AM, Yonghong Song wrote: >>> On 4/2/24 8:16 AM, Muhammad Usama Anjum wrote: >>>> Yonghong Song, >>>> >>>> Thank you so much for

Re: [PATCH] selftest/timerns: fix clang build failures for abs() calls

2024-05-03 Thread Muhammad Usama Anjum
1-2f9ed7d1c...@valentinobst.de/ > > Signed-off-by: John Hubbard Thanks for fixing! Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/timens/exec.c | 6 +++--- > tools/testing/selftests/timens/timer.c | 2 +- > tools/testing/selftests/timens/timer

Re: [PATCH] selftests/capabilities: fix warn_unused_result build warnings

2024-05-05 Thread Muhammad Usama Anjum
rocess’ > declared with attribute ‘warn_unused_result’ [-Wunused-result] >47 | capng_get_caps_process(); > | ^~~~ > > Signed-off-by: Amer Al Shanawany LGTM Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/capabili

Re: [PATCH v2 1/5] selftests: Compile kselftest headers with -D_GNU_SOURCE

2024-05-08 Thread Muhammad Usama Anjum
://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.s...@intel.com > Signed-off-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/Makefile| 4 ++-- > tools/testing/selftests/kselftest_harness.h | 2 +- > tools/testing/selftests/lib.

Re: [PATCH v2 2/5] selftests/sgx: Include KHDR_INCLUDES in Makefile

2024-05-08 Thread Muhammad Usama Anjum
quot;) > Reported-by: kernel test robot > Closes: > https://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.s...@intel.com > Signed-off-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/sgx/Makefile| 2 +- > tools/testing/self

Re: [PATCH v2 4/5] selftests: Drop define _GNU_SOURCE

2024-05-08 Thread Muhammad Usama Anjum
On 5/8/24 2:38 AM, Edward Liaw wrote: > _GNU_SOURCE is provided by KHDR_INCLUDES, so it should be dropped to > prevent _GNU_SOURCE redefined warnings. > > Fixes: 809216233555 ("selftests/harness: remove use of LINE_MAX") > Signed-off-by: Edward Liaw Reviewed

Re: [PATCH v2 3/5] selftests: Include KHDR_INCLUDES in Makefile

2024-05-08 Thread Muhammad Usama Anjum
On 5/8/24 2:38 AM, Edward Liaw wrote: > Add KHDR_INCLUDES to CFLAGS to pull in the kselftest harness > dependencies (-D_GNU_SOURCE). > > Fixes: 809216233555 ("selftests/harness: remove use of LINE_MAX") > Signed-off-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum

Re: [PATCH v2 5/5] selftests: Drop duplicate -D_GNU_SOURCE

2024-05-08 Thread Muhammad Usama Anjum
On 5/8/24 2:38 AM, Edward Liaw wrote: > -D_GNU_SOURCE can be de-duplicated here, as it is added by > KHDR_INCLUDES. > > Signed-off-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/futex/functional/Makefile | 2 +- > tools/testing/sel

Re: [PATCH v2 0/5] Define _GNU_SOURCE for sources using

2024-05-09 Thread Muhammad Usama Anjum
nd them split - it will be easier to review and apply. You >> might as well wait until the merge window is done. I don't think >> anybody would have time to review now since merge window starts >> next week. > > Sorry, I have them split already; is it ok if I send them now? I will > be on leave soon and may not be able to get back to it in a while. Feel free to send the patches. There is no restriction on that. > > Thanks, > Edward > >> >> >> thanks, >> -- Shuah > -- BR, Muhammad Usama Anjum

Re: [PATCH bpf-next v2 1/4] selftests/bpf: Add some null pointer checks

2024-05-10 Thread Muhammad Usama Anjum
ates) > + return -ENOMEM; > > for (int i = 0; i < subtest_num; i++) { > subtest_state = &state->subtest_states[i]; -- BR, Muhammad Usama Anjum

Re: [PATCH bpf-next v2 2/4] selftests/bpf/sockopt: Add a null pointer check for the run_test

2024-05-10 Thread Muhammad Usama Anjum
f-by: Kunwu Chan LGTM Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/bpf/prog_tests/sockopt.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/tools/testing/selftests/bpf/prog_tests/sockopt.c > b/tools/testing/selftests/bpf/prog_tests/sockopt

Re: [PATCH bpf-next v2 3/4] selftests/bpf: Add a null pointer check for the load_btf_spec

2024-05-10 Thread Muhammad Usama Anjum
On 5/10/24 2:58 PM, kunwu.c...@linux.dev wrote: > From: Kunwu Chan > > There is a 'malloc' call, which can be unsuccessful. > Add the malloc failure checking to avoid possible null > dereference. > > Signed-off-by: Kunwu Chan LGTM Reviewed-by: Muhammad Usama

Re: [PATCH bpf-next v2 4/4] selftests/bpf: Add a null pointer check for the serial_test_tp_attach_query

2024-05-10 Thread Muhammad Usama Anjum
uery(void) > attr.wakeup_events = 1; > > query = malloc(sizeof(*query) + sizeof(__u32) * num_progs); > + if (!ASSERT_OK_PTR(query, "malloc")) > + return; > + LGTM Reviewed-by: Muhammad Usama Anjum > for (i =

Re: [PATCH v2] selftests/mqueue: fix 5 warnings about signed/unsigned mismatches

2024-05-10 Thread Muhammad Usama Anjum
ument name to test->func(), in order to address another > warning from clang. > > Cc: Ryan Roberts > Signed-off-by: John Hubbard LGTM Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/mqueue/mq_perf_tests.c | 15 --- > 1 file changed, 8 inserti

Re: [PATCH] selftests/mm: hugetlb_madv_vs_map: Avoid test skipping by querying hugepage size at runtime

2024-05-10 Thread Muhammad Usama Anjum
> Also, there is no reason why a hugepage allocation should fail, since we > are using a simple mmap() using MAP_HUGETLB; hence, instead of skipping > the test, make it fail. > > Signed-off-by: Dev Jain LGTM Reviewed-by: Muhammad Usama Anjum > --- > tools/testin

Re: [PATCH 0/8] selftests: x86: build suite with clang

2024-05-16 Thread Muhammad Usama Anjum
On 5/1/24 6:29 AM, Muhammad Usama Anjum wrote: > This series fixes build errors found by clang to allow the x86 suite to > get built with the clang. > > Unfortunately, there is one bug [1] in the clang becuase of which > extended asm isn't handled correctly by it

Re: [PATCH] kselftest/alsa: Ensure _GNU_SOURCE is defined

2024-05-16 Thread Muhammad Usama Anjum
ould provide some futureproofing. > > Fixes: daef47b89efd ("selftests: Compile kselftest headers with > -D_GNU_SOURCE") > Signed-off-by: Mark Brown Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/alsa/Makefile | 2 +- > 1 file changed, 1 insertion(+

Re: [PATCH v1 7/7] selftest: test system-wide workingset reporting

2024-05-16 Thread Muhammad Usama Anjum
ze_ref, TEST_SIZE, 10)) { > + ksft_print_msg( > + "file working set size difference too large: > actual=%ld, expected=%ld\n", > + ws_size_test - ws_size_ref, TEST_SIZE); > + goto cleanup; > + } > + } > + ret = KSFT_PASS; > + > +cleanup: > + if (pid > 0) > + kill(pid, SIGKILL); > + cleanup_file_workingset(); > + return ret; > +} > + > +static int test_anon(void) > +{ > + ssize_t ws_size_ref, ws_size_test; > + pid_t pid = 0; > + int ret = KSFT_FAIL, i; > + > + ws_size_ref = read_interval_all_nodes(PAGETYPE_ANON, 0); > + if (ws_size_ref < 0) > + goto cleanup; > + > + pid = clone_and_run(alloc_anon_workingset, (void *)TEST_SIZE); > + if (pid < 0) > + goto cleanup; > + > + sleep_ms(REFRESH_INTERVAL); > + read_interval_all_nodes(PAGETYPE_ANON, 0); > + > + for (i = 0; i < 5; ++i) { > + sleep_ms(REFRESH_INTERVAL); > + ws_size_test = read_interval_all_nodes(PAGETYPE_ANON, 0); > + ws_size_test += read_interval_all_nodes(PAGETYPE_ANON, 1); > + if (ws_size_test < 0) > + goto cleanup; > + > + if (!values_close(ws_size_test - ws_size_ref, TEST_SIZE, 10)) { > + ksft_print_msg( > + "anon working set size difference too large: > actual=%ld, expected=%ld\n", > + ws_size_test - ws_size_ref, TEST_SIZE); > + goto cleanup; > + } > + } > + ret = KSFT_PASS; > + > +cleanup: > + if (pid > 0) > + kill(pid, SIGKILL); > + return ret; > +} > + > + > +#define T(x) { x, #x } > +struct workingset_test { > + int (*fn)(void); > + const char *name; > +} tests[] = { > + T(test_anon), > + T(test_file), > +}; > +#undef T > + > +int main(int argc, char **argv) > +{ > + int ret = EXIT_SUCCESS, i, err; > + > + for (i = 0; i < ARRAY_SIZE(tests); i++) { > + err = run_test(tests[i].fn); > + switch (err) { > + case KSFT_PASS: > + ksft_test_result_pass("%s\n", tests[i].name); > + break; > + case KSFT_SKIP: > + ksft_test_result_skip("%s\n", tests[i].name); > + break; > + default: > + ret = EXIT_FAILURE; > + ksft_test_result_fail("%s with error %d\n", > + tests[i].name, err); > + break; > + } Replace this switch-case with ksft_test_result*(). > + } > + return ret; > +} -- BR, Muhammad Usama Anjum

[PATCH] selftests: firmware: conform test to TAP

2024-05-20 Thread Muhammad Usama Anjum
completely. Signed-off-by: Muhammad Usama Anjum --- .../selftests/firmware/fw_run_tests.sh| 63 --- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/tools/testing/selftests/firmware/fw_run_tests.sh b/tools/testing/selftests/firmware/fw_run_tests.sh index

[PATCH] selftests: mm: check return values

2024-05-20 Thread Muhammad Usama Anjum
Check return value and return error/skip the tests. Fixes: 46fd75d4a3c9 ("selftests: mm: add pagemap ioctl tests") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/pagemap_ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/se

[PATCH 1/2] selftests/thermel/intel: conform the test to TAP output

2024-05-22 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 --- .../intel/workload_hint/workload_hint_test.c | 98 --- 1 file changed, 39 insertions(+), 59 deletions

[PATCH 2/2] selftests/thermel/intel: conform the test to TAP output

2024-05-22 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 --- .../intel/power_floor/power_floor_test.c | 68 --- 1 file changed, 28 insertions(+), 40 deletions

[PATCH] selftests: openat2: don't print total number of tests and then skip

2024-05-22 Thread Muhammad Usama Anjum
ail:0 xfail:0 xpass:0 skip:1 error:0 New and correct output: TAP version 13 1..0 # SKIP all tests require euid == 0 Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/openat2/resolve_test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/self

Re: [PATCH] selftest: mm: Test if hugepage does not get leaked during __bio_release_pages()

2024-05-24 Thread Muhammad Usama Anjum
pages freed successfully !\n"); > + } > +} > + > +int main(void) > +{ > + size_t pagesize = 0; > + > + ksft_print_header(); > + ksft_set_plan(4); > + > + /* Get base page size */ > + pagesize = psize(); > + > + /* start and end is aligned to pagesize */ > + run_dio_using_hugetlb(0, (pagesize * 3)); > + > + /* start is aligned but end is not aligned */ > + run_dio_using_hugetlb(0, (pagesize * 3) - (pagesize / 2)); > + > + /* start is unaligned and end is aligned */ > + run_dio_using_hugetlb(pagesize / 2, (pagesize * 3)); > + > + /* both start and end are unaligned */ > + run_dio_using_hugetlb(pagesize / 2, (pagesize * 3) + (pagesize / 2)); > + > + ksft_finished(); ksft_finished() never returns. Remove the following line. > + return 0; > +} > + -- BR, Muhammad Usama Anjum

Re: [PATCH 1/2] selftests/ftrace: Fix to check required event file

2024-05-24 Thread Muhammad Usama Anjum
t set, the test will fail. > > Add the event file to `required` line so that the test will return > `unsupported` result. > > Fixes: 297e1dcdca3d ("selftests/ftrace: Add selftest for testing duplicate > eprobes and kprobes") > Signed-off-by: Masami Hiramatsu (G

Re: [PATCH 2/2] selftests/ftrace: Update required config

2024-05-24 Thread Muhammad Usama Anjum
On 5/20/24 5:00 PM, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > Update required config options for running all tests. > This also sorts the config entries alphabetically. > > Signed-off-by: Masami Hiramatsu (Google) LGTM Reviewed-by: Mu

Re: [PATCH] selftests/openat2: Fix build warnings on ppc64

2024-05-24 Thread Muhammad Usama Anjum
from individual files. But until then the current solution seems fine: Reviewed-by: Muhammad Usama Anjum On 5/20/24 8:03 PM, Michael Ellerman wrote: > Fix warnings like: > > openat2_test.c: In function ‘test_openat2_flags’: > openat2_test.c:303:73: warning: format ‘%llX’ expects

Re: [PATCH] selftests/mm: Fix build warnings on ppc64

2024-05-24 Thread Muhammad Usama Anjum
t’, but argument 3 has type ‘__u64’ {aka ‘long > unsigned int’} [-Wformat=] > > By switching to unsigned long long for u64 for ppc64 builds. > > Signed-off-by: Michael Ellerman Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/mm/gup_test.c| 1 + > to

Re: [PATCH 0/4] selftest: x86: conform tests to TAP format output

2024-05-27 Thread Muhammad Usama Anjum
Kind reminder On 4/14/24 6:18 PM, Muhammad Usama Anjum wrote: > In this series, 4 tests are being conformed to TAP. > > Muhammad Usama Anjum (4): > selftests: x86: check_initial_reg_state: conform test to TAP format > output > selftests: x86: corrupt_xstate_header: c

Re: [PATCH 0/8] selftests: x86: build suite with clang

2024-05-27 Thread Muhammad Usama Anjum
Soft reminder On 5/1/24 5:29 PM, Muhammad Usama Anjum wrote: > This series fixes build errors found by clang to allow the x86 suite to > get built with the clang. > > Unfortunately, there is one bug [1] in the clang becuase of which > extended asm isn't handled correctly b

Re: [PATCH 0/4] selftest: x86: conform tests to TAP format output

2024-05-27 Thread Muhammad Usama Anjum
Kind reminder On 4/14/24 6:18 PM, Muhammad Usama Anjum wrote: > In this series, 4 tests are being conformed to TAP. > > Muhammad Usama Anjum (4): > selftests: x86: check_initial_reg_state: conform test to TAP format > output > selftests: x86: corrupt_xstate_header: c

Re: [PATCH v2] selftests: x86: conform test to TAP format output

2024-05-27 Thread Muhammad Usama Anjum
Kind reminder On 4/26/24 3:18 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. > > Signed-off-by: Muhammad Usama Anjum > --- > Changes since v1: > - N

Re: [PATCH] selftests: tpm2: conform test to TAP output

2024-05-27 Thread Muhammad Usama Anjum
Kind reminder On 4/26/24 2:14 PM, Muhammad Usama Anjum wrote: > The python unittest is being used for executing tests. TAP output > cannot be added in the unittest framework. The python unittest is being > run from a script. Add the output TAP logs to the script. Add "#" >

[PATCH 0/4] kselftests: vdso: conform tests to TAP output

2024-05-29 Thread Muhammad Usama Anjum
Conform individual tests to TAP output. One patch conform one test. With this series, all vDSO tests become TAP conformant. Muhammad Usama Anjum (4): kselftests: vdso: vdso_test_clock_getres: conform test to TAP output kselftests: vdso: vdso_test_correctness: conform test to TAP output

[PATCH 1/4] kselftests: vdso: vdso_test_clock_getres: conform test to TAP output

2024-05-29 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 --- .../selftests/vDSO/vdso_test_clock_getres.c | 68 +-- 1 file changed, 33 insertions(+), 35 deletions

[PATCH 2/4] kselftests: vdso: vdso_test_correctness: conform test to TAP output

2024-05-29 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 --- .../selftests/vDSO/vdso_test_correctness.c| 146 +- 1 file changed, 74 insertions(+), 72 deletions

[PATCH 3/4] kselftests: vdso: vdso_test_getcpu: conform test to TAP output

2024-05-29 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/vDSO/vdso_test_getcpu.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions

[PATCH 4/4] kselftests: vdso: vdso_test_gettimeofday: conform test to TAP output

2024-05-29 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 --- .../selftests/vDSO/vdso_test_gettimeofday.c | 23 ++- 1 file changed, 12 insertions(+), 11 deletions

Re: [PATCH v2] selftests/vDSO: fix clang build errors and warnings

2024-05-29 Thread Muhammad Usama Anjum
tps://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c...@valentinobst.de/ > > Signed-off-by: John Hubbard LGTM Reviewed-by: Muhammad Usama Anjum Tested-by: Muhammad Usama Anjum > --- > > Changes since the first version: > > 1) Rebased onto Linux 6.10-rc1 >

Re: [PATCH 1/2] selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS

2024-05-29 Thread Muhammad Usama Anjum
gt;> >>> + >>> +LOCAL_HDRS += helpers.h >>> + >>>   include ../lib.mk >>>   -$(TEST_GEN_PROGS): helpers.c helpers.h >>> +$(TEST_GEN_PROGS): helpers.c >>> >>> base-commit: ddb4c3f25b7b95df3d6932db0b379d768a6ebdf7 >>> prerequisite-patch-id: b901ece2a5b78503e2fb5480f20e304d36a0ea27 >> > > thanks, -- BR, Muhammad Usama Anjum

Re: [PATCH 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang builds

2024-05-29 Thread Muhammad Usama Anjum
isions > solely on whether or not LLVM is set. > > Cc: Nathan Chancellor > Cc: Ryan Roberts > > Signed-off-by: John Hubbard LGTM Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/lib.mk | 12 > 1 file changed, 12 insertions(+) >

Re: [PATCH v2 0/6] selftests/x86: fix build errors and warnings found via clang

2024-05-30 Thread Muhammad Usama Anjum
> is that it is more intrusive. Which I think is appropriate. > > Would you be OK with my posting v3 that uses your patch for > test_FISTTP.c [1], and the rest of my patches for the rest? Yeah, sure go ahead. I'll test/review the v3 series. > > > [1] > https://lore.kernel.org/all/20240501122918.3831734-7-usama.an...@collabora.com/ > > thanks, -- BR, Muhammad Usama Anjum

Re: [PATCH] list: test: remove unused struct 'klist_test_struct'

2024-05-31 Thread Muhammad Usama Anjum
st-test.c > @@ -1201,12 +1201,6 @@ static struct kunit_suite hlist_test_module = { > }; > > > -struct klist_test_struct { > - int data; > - struct klist klist; > - struct klist_node klist_node; > -}; > - > static int node_count; > static struct klist_node *last_node; > -- BR, Muhammad Usama Anjum

[PATCH 1/2] selftests: arm64: tags_test: conform test to TAP output

2024-06-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/arm64/tags/tags_test.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff

[PATCH 2/2] selftests: arm64: tags: remove the result script

2024-06-02 Thread Muhammad Usama Anjum
The run_tags_test.sh script is used to run tags_test and print out if the test succeeded or failed. As tags_test has been TAP conformed, this script is unneeded and hence can be removed. Signed-off-by: Muhammad Usama Anjum --- make run_tests TARGETS="arm64/tags" Before: ➜ self

[Bug Report] selftests: arm64: build errors

2024-06-03 Thread Muhammad Usama Anjum
Hi, I'm trying to build arm64 selftests on next-20240529. I'm getting build failures. Complete logs are attached while some snippets are as following: gcc pac.c /pauth/pac_corruptor.o /pauth/helper.o -o /pauth/pac -Wall -O2 -g -I/linux_mainline/tools/testing/selftests/ -I/linux_mainline/tools/in

Re: [Bug Report] selftests: arm64: build errors

2024-06-04 Thread Muhammad Usama Anjum
On 6/3/24 6:31 PM, Mark Brown wrote: > On Mon, Jun 03, 2024 at 06:28:16PM +0500, Muhammad Usama Anjum wrote: > >> gcc pac.c /pauth/pac_corruptor.o /pauth/helper.o -o /pauth/pac -Wall -O2 -g >> -I/linux_mainline/tools/testing/selftests/ -I/linux_mainline/tools/include >>

Re: [PATCH] selftests: mm: Make map_fixed_noreplace test names stable

2024-06-06 Thread Muhammad Usama Anjum
: 4838cf70e539 ("selftests/mm: map_fixed_noreplace: conform test to TAP > format output") > Signed-off-by: Mark Brown Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/mm/map_fixed_noreplace.c | 24 > > 1 file changed,

[PATCH] selftests: kvm: fix mkdir error when building for non-supported arch

2024-08-06 Thread Muhammad Usama Anjum
The mkdir generates an error when kvm suite is build for non-supported architecture such as arm. Fix it by ignoring the error from mkdir. mkdir: missing operand Try 'mkdir --help' for more information. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/kvm/Makefile | 2

Re: [PATCH] selftests: kvm: fix mkdir error when building for non-supported arch

2024-08-06 Thread Muhammad Usama Anjum
On 8/6/24 9:00 PM, Shuah Khan wrote: > On 8/6/24 06:10, Muhammad Usama Anjum wrote: >> The mkdir generates an error when kvm suite is build for non-supported > > built > unsupported > >> architecture such as arm. Fix it by ignoring the error from mkdir. >> >&g

Re: [PATCH] selftests: kvm: fix mkdir error when building for non-supported arch

2024-08-06 Thread Muhammad Usama Anjum
On 8/7/24 11:08 AM, Muhammad Usama Anjum wrote: > On 8/6/24 9:00 PM, Shuah Khan wrote: >> On 8/6/24 06:10, Muhammad Usama Anjum wrote: >>> The mkdir generates an error when kvm suite is build for non-supported >> >> built >> unsupported >> >>> arc

Re: [PATCH 1/3] selftests/exec: Build both static and non-static load_address tests

2024-08-07 Thread Muhammad Usama Anjum
ueabihf/12/../../../../arm-linux-gnueabihf/bin/ld: cannot find rcrt1.o: No such file or directory collect2: error: ld returned 1 exit status make: *** [Makefile:39: /home/usama/repos/kernel/linux_mainline/tools/testing/selftests/exec/load_address.static.0x1000] Error 1 -- BR, Muhammad Usama Anjum

Re: [PATCH] selftests: kvm: fix mkdir error when building for non-supported arch

2024-08-08 Thread Muhammad Usama Anjum
Adding Sean On 8/7/24 11:33 AM, Muhammad Usama Anjum wrote: > On 8/7/24 11:08 AM, Muhammad Usama Anjum wrote: >> On 8/6/24 9:00 PM, Shuah Khan wrote: >>> On 8/6/24 06:10, Muhammad Usama Anjum wrote: >>>> The mkdir generates an error when kvm suite is build f

[PATCH] selftests: resctrl: ignore builds for unsupported architectures

2024-08-09 Thread Muhammad Usama Anjum
this suite only for x86 and x86_64 architectures. Fixes: b733143cc455 ("selftests/resctrl: Make resctrl_tests run using kselftest framework") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/resctrl/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/te

[PATCH] selftests: memfd_secret: don't build memfd_secret test on unsupported arches

2024-08-09 Thread Muhammad Usama Anjum
memfd_secret(2)") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/Makefile | 2 ++ tools/testing/selftests/mm/run_vmtests.sh | 3 +++ 2 files changed, 5 insertions(+) diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 1a83b70e

Re: [PATCH] selftests: resctrl: ignore builds for unsupported architectures

2024-08-09 Thread Muhammad Usama Anjum
On 8/9/24 12:23 PM, Ilpo Järvinen wrote: > On Fri, 9 Aug 2024, Muhammad Usama Anjum wrote: > >> This test doesn't have support for other architectures. Altough resctrl >> is supported on x86 and ARM, but arch_supports_noncont_cat() shows that >> only x86 for AMD a

[PATCH] selftests: mm: Fix build errors on armhf

2024-08-09 Thread Muhammad Usama Anjum
sret = (void *) syscall(__NR_mmap, addr, len, prot, | ^ Cc: sta...@vger.kernel.org Fixes: 4926c7a52de7 ("selftest mm/mseal memory sealing") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/mseal_test.c | 37 +

Re: [PATCH net-next v13 01/14] mm: page_frag: add a test module for page_frag

2024-08-09 Thread Muhammad Usama Anjum
("$@" 2>&1) | tap_prefix > local ret=${PIPESTATUS[0]} > count_total=$(( count_total + 1 )) > - if [ $ret -eq 0 ]; then > + # page_frag_test.ko returns 11(EAGAIN) when insmod'ing to avoid > rmmod > + if [ $ret -eq 0 ] | [ $ret -eq 11 -a ${CATEGORY} == "page_frag" > ]; then > count_pass=$(( count_pass + 1 )) > echo "[PASS]" | tap_prefix > echo "ok ${count_total} ${test}" | tap_output > @@ -453,6 +456,10 @@ CATEGORY="mkdirty" run_test ./mkdirty > > CATEGORY="mdwe" run_test ./mdwe_test > > +CATEGORY="page_frag" run_test insmod ./page_frag/page_frag_test.ko > + > +CATEGORY="page_frag" run_test insmod ./page_frag/page_frag_test.ko > test_alloc_len=12 test_align=1 > + You are loading the test module. How will we verify if the test passed or failed? There must be a way to mark the test passed or failed after running it. You can definitely parse the dmesg to get results. But it would be complex to do it. KUnit is way to go as all such tools are already present there. > echo "SUMMARY: PASS=${count_pass} SKIP=${count_skip} FAIL=${count_fail}" | > tap_prefix > echo "1..${count_total}" | tap_output > -- BR, Muhammad Usama Anjum

[PATCH v2] selftests: memfd_secret: don't build memfd_secret test on unsupported arches

2024-08-11 Thread Muhammad Usama Anjum
"secretmem: test: add basic selftest for memfd_secret(2)") Reviewed-by: Shuah Khan Acked-by: Mike Rapoport (Microsoft) Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Add error message to the patch and reviewed-by tags --- tools/testing/selftests/mm/Makefile | 2 ++ tools/te

Re: [PATCH 1/3] selftests/exec: Build both static and non-static load_address tests

2024-08-18 Thread Muhammad Usama Anjum
On 8/7/24 3:22 PM, Muhammad Usama Anjum wrote: > On 5/9/24 11:16 AM, Kees Cook wrote: >> On Wed, May 08, 2024 at 07:54:13PM -0700, John Hubbard wrote: >>> Didn't we learn recently, though, that -static-pie is gcc 8.1+, while the >>> kernel's minimum gcc versio

[PATCH v2] selftests: kvm: fix mkdir error when building for unsupported arch

2024-08-19 Thread Muhammad Usama Anjum
Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Instead of ignoring error, check TEST_GEN_PROGS's validity first --- tools/testing/selftests/kvm/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kv

Re: [PATCH] selftests: mm: Fix build errors on armhf

2024-08-19 Thread Muhammad Usama Anjum
On 8/14/24 3:29 AM, Jeff Xu wrote: > Hi Muhammad > > On Fri, Aug 9, 2024 at 1:25 AM Muhammad Usama Anjum > wrote: >> >> The __NR_mmap isn't found on armhf. The mmap() is commonly available >> system call and its wrapper is presnet on all architectures. So it &g

Re: [PATCH v2] selftests: kvm: fix mkdir error when building for unsupported arch

2024-08-20 Thread Muhammad Usama Anjum
On 8/19/24 9:33 PM, Sean Christopherson wrote: > +KVM arch maintainers > > On Mon, Aug 19, 2024, Muhammad Usama Anjum wrote: >> The tests are built on per architecture basis. When unsupported >> architecture is specified, it has no tests and TEST_GEN_PROGS is empty. >>

Re: [PATCH 1/3] selftests/resctrl: Generalize non-contiguous CAT check

2024-08-21 Thread Muhammad Usama Anjum
he vendor check using switch/case logic and return false > for unknown vendors. > > Signed-off-by: Ilpo Järvinen Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/resctrl/cat_test.c | 26 +- > 1 file changed, 16 insertions(+), 10 deletions(-

Re: [PATCH 2/3] selftests/resctrl: Always initialize ecx to avoid build warnings

2024-08-21 Thread Muhammad Usama Anjum
On 8/13/24 3:45 PM, Ilpo Järvinen wrote: > To avoid warnings when __cpuid_count() is an empty stub, always > initialize ecx because it is used in the return statement. > > Signed-off-by: Ilpo Järvinen Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/resc

Re: [RFC PATCH 3/3] kselftest: Provide __cpuid_count() stub on non-x86 archs

2024-08-21 Thread Muhammad Usama Anjum
un that code only on Intel CPUs but > as is, the code cannot be build at all. > > Provide an empty stub for __cpuid_count() if it is not supported > to allow build to succeed. > > Reported-by: Muhammad Usama Anjum > Signed-off-by: Ilpo Järvinen Reviewed-by: Muhammad

Re: [PATCH 0/3] selftests: Fix cpuid / vendor checking build issues

2024-08-21 Thread Muhammad Usama Anjum
seeing? Yeah, build errors are resolved. > > Hi Reinette - do these look okay to you? Can you give me an ack if they do? > > thanks, > -- Shuah > -- BR, Muhammad Usama Anjum

Re: [Patch v2 2/2] selftests: harness: Add kselftest harness selftest with variant

2025-06-20 Thread Muhammad Usama Anjum
On 6/20/25 8:28 AM, Wei Yang wrote: > Each fixture could support variant. Add fixture with variant to verify > the behavior, so we can validate for further change. > > Signed-off-by: Wei Yang > Cc: Muhammad Usama Anjum > Cc: Thomas Weißschuh > > --- > v2: >

Re: [PATCH 3/3] selftests: harness: Add kselftest harness selftest with variant

2025-06-16 Thread Muhammad Usama Anjum
On 6/16/25 5:23 PM, Wei Yang wrote: > Each fixture could support variant. Add fixture with variant to verify > the behavior, so we can validate for further change. > > Signed-off-by: Wei Yang Reviewed-by: Muhammad Usama Anjum > --- > .../kselftest_harness/harness-se

Re: [PATCH 2/3] selftests: print 0 if no test is chosen

2025-06-16 Thread Muhammad Usama Anjum
On 6/16/25 5:23 PM, Wei Yang wrote: > In case there is no test chosen, e.g -t non-exist, the following message > would be printed at start. > > TAP version 13 > 1..0 > > Change it to print 0 if no test is chosen. Please give reference from TAP format guidelines for this change. > > Sign

Re: [PATCH net-next V3 1/4] selftests: drv-net: Test XDP_PASS/DROP support

2025-07-12 Thread Muhammad Usama Anjum
On 7/12/25 5:26 AM, Mohsin Bashir wrote: > Test XDP_PASS/DROP in single buffer and multi buffer mode when > XDP native support is available. > > ./drivers/net/xdp.py > TAP version 13 > 1..6 > ok 1 xdp.test_xdp_native_pass_sb > ok 2 xdp.test_xdp_native_pass_mb > ok 3 xdp.test_xdp_native_drop_sb > o

<    1   2   3   4   5