[1] mentions that memfd_secret is only supported on arm64, riscv, x86
and x86_64 for now. It doesn't support other architectures. I found the
build error on arm and decided to send the fix as it was creating noise
on KernelCI. Hence I'm adding condition that memfd_secret should only be
compiled on supported architectures.
Also check in run_vmtests script if memfd_secret binary is present
before executing it.
[1] https://lore.kernel.org/all/20210518072034.31572-7-rppt@kernel.org/
Cc: stable(a)vger.kernel.org
Fixes: 76fe17ef588a ("secretmem: test: add basic selftest for memfd_secret(2)")
Signed-off-by: Muhammad Usama Anjum <usama.anjum(a)collabora.com>
---
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 1a83b70e84535..4ea188be0588a 100644
--- a/tools/testing/selftests/mm/Makefile
+++ b/tools/testing/selftests/mm/Makefile
@@ -53,7 +53,9 @@ TEST_GEN_FILES += madv_populate
TEST_GEN_FILES += map_fixed_noreplace
TEST_GEN_FILES += map_hugetlb
TEST_GEN_FILES += map_populate
+ifneq (,$(filter $(ARCH),arm64 riscv riscv64 x86 x86_64))
TEST_GEN_FILES += memfd_secret
+endif
TEST_GEN_FILES += migration
TEST_GEN_FILES += mkdirty
TEST_GEN_FILES += mlock-random-test
diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
index 03ac4f2e1cce6..36045edb10dea 100755
--- a/tools/testing/selftests/mm/run_vmtests.sh
+++ b/tools/testing/selftests/mm/run_vmtests.sh
@@ -374,8 +374,11 @@ CATEGORY="hmm" run_test bash ./test_hmm.sh smoke
# MADV_POPULATE_READ and MADV_POPULATE_WRITE tests
CATEGORY="madv_populate" run_test ./madv_populate
+if [ -x ./memfd_secret ]
+then
(echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope 2>&1) | tap_prefix
CATEGORY="memfd_secret" run_test ./memfd_secret
+fi
# KSM KSM_MERGE_TIME_HUGE_PAGES test with size of 100
CATEGORY="ksm" run_test ./ksm_tests -H -s 100
--
2.39.2
This small series includes fixes for creation of veth pairs for
networkless kernels & adds tests for turning the different network
interface features on and off in selftests/net/netdevice.sh script.
Changes in v5:
Rectify the syntax for ip add link.
Fix the veth_created condition check.
Changes in v4:
https://lore.kernel.org/all/20240807175717.7775-1-jain.abhinav177@gmail.com/
Move veth creation/removal to the main shell script.
Tested using vng on a networkless kernel and the script works, sample
output below the changes.
Changes in v3:
https://lore.kernel.org/all/20240614113240.41550-1-jain.abhinav177@gmail.co…
Add a check for netdev, create veth pair for testing.
Restore feature to its initial state.
Changes in v2:
https://lore.kernel.org/all/20240609132124.51683-1-jain.abhinav177@gmail.co…
Remove tail usage; use read to parse the features from temp file.
v1:
https://lore.kernel.org/all/20240606212714.27472-1-jain.abhinav177@gmail.co…
```
# selftests: net: netdevice.sh
# No valid network device found, creating veth pair
# PASS: veth0: set interface up
# PASS: veth0: set MAC address
# SKIP: veth0: set IP address
# PASS: veth0: ethtool list features
# PASS: veth0: Turned off feature: rx-checksumming
# PASS: veth0: Turned on feature: rx-checksumming
# PASS: veth0: Restore feature rx-checksumming to initial state on
# Actual changes:
# tx-checksum-ip-generic: off
# tx-tcp-segmentation: off [not requested]
....
....
....
# PASS: veth1: Restore feature tx-nocache-copy to initial state off
# PASS: veth1: Turned off feature: tx-vlan-stag-hw-insert
# PASS: veth1: Turned on feature: tx-vlan-stag-hw-insert
# PASS: veth1: Restore feature tx-vlan-stag-hw-insert to initial state on
# PASS: veth1: Turned off feature: rx-vlan-stag-hw-parse
# PASS: veth1: Turned on feature: rx-vlan-stag-hw-parse
# PASS: veth1: Restore feature rx-vlan-stag-hw-parse to initial state on
# PASS: veth1: Turned off feature: rx-gro-list
# PASS: veth1: Turned on feature: rx-gro-list
# PASS: veth1: Restore feature rx-gro-list to initial state off
# PASS: veth1: Turned off feature: rx-udp-gro-forwarding
# PASS: veth1: Turned on feature: rx-udp-gro-forwarding
# PASS: veth1: Restore feature rx-udp-gro-forwarding to initial state off
# Cannot get register dump: Operation not supported
# SKIP: veth1: ethtool dump not supported
# PASS: veth1: ethtool stats
# PASS: veth1: stop interface
# Removed veth pair
ok 12 selftests: net: netdevice.sh
```
Abhinav Jain (2):
selftests: net: Create veth pair for testing in networkless kernel
selftests: net: Add on/off checks for non-fixed features of interface
tools/testing/selftests/net/netdevice.sh | 53 +++++++++++++++++++++++-
1 file changed, 52 insertions(+), 1 deletion(-)
--
2.34.1
The current support for LLVM and clang in nolibc and its testsuite is
very limited.
* Various architectures plain do not compile
* The user *has* to specify "-Os" otherwise the program crashes
* Cross-compilation of the tests does not work
* Using clang is not wired up in run-tests.sh
This series extends this support.
Signed-off-by: Thomas Weißschuh <linux(a)weissschuh.net>
---
Changes in v2:
- Add support for all architectures
- powerpc: "selftests/nolibc: don't use libgcc when building with clang"
- mips: "tools/nolibc: mips: load current function to $t9"
- s390: "selftests/nolibc: use correct clang target for s390/powerz"
- Expand commit messages
- Use __nolibc_ prefix for custom macros
- Link to v1: https://lore.kernel.org/r/20240728-nolibc-llvm-v1-0-bc384269bc35@weissschuh…
---
Thomas Weißschuh (15):
tools/nolibc: arm: use clang-compatible asm syntax
tools/nolibc: mips: load current function to $t9
tools/nolibc: powerpc: limit stack-protector workaround to GCC
tools/nolibc: compiler: introduce __nolibc_has_attribute()
tools/nolibc: move entrypoint specifics to compiler.h
tools/nolibc: compiler: use attribute((naked)) if available
selftests/nolibc: report failure if no testcase passed
selftests/nolibc: avoid passing NULL to printf("%s")
selftests/nolibc: determine $(srctree) first
selftests/nolibc: add support for LLVM= parameter
selftests/nolibc: add cc-option compatible with clang cross builds
selftests/nolibc: run-tests.sh: avoid overwriting CFLAGS_EXTRA
selftests/nolibc: don't use libgcc when building with clang
selftests/nolibc: use correct clang target for s390/powerz
selftests/nolibc: run-tests.sh: allow building through LLVM
tools/include/nolibc/arch-aarch64.h | 4 +--
tools/include/nolibc/arch-arm.h | 8 +++---
tools/include/nolibc/arch-i386.h | 4 +--
tools/include/nolibc/arch-loongarch.h | 4 +--
tools/include/nolibc/arch-mips.h | 8 ++++--
tools/include/nolibc/arch-powerpc.h | 6 ++--
tools/include/nolibc/arch-riscv.h | 4 +--
tools/include/nolibc/arch-s390.h | 4 +--
tools/include/nolibc/arch-x86_64.h | 4 +--
tools/include/nolibc/compiler.h | 24 +++++++++++-----
tools/testing/selftests/nolibc/Makefile | 41 +++++++++++++++++++---------
tools/testing/selftests/nolibc/nolibc-test.c | 4 +--
tools/testing/selftests/nolibc/run-tests.sh | 16 ++++++++---
13 files changed, 83 insertions(+), 48 deletions(-)
---
base-commit: ae1f550efc11eaf1496c431d9c6e784cb49124c5
change-id: 20240727-nolibc-llvm-3fad68590d4c
Best regards,
--
Thomas Weißschuh <linux(a)weissschuh.net>
Hello Andrii Nakryiko,
This is a semi-automatic email about new static checker warnings.
Commit 8863238993e2 ("selftests/bpf: BPF register range bounds
tester") from Nov 11, 2023, leads to the following Smatch complaint:
./tools/testing/selftests/bpf/prog_tests/reg_bounds.c:1121 parse_reg_state()
warn: variable dereferenced before check 'p' (see line 1119)
./tools/testing/selftests/bpf/prog_tests/reg_bounds.c
1118 p = strpbrk(p, ",)");
1119 if (*p == ')')
1120 break;
1121 if (p)
Was this NULL check supposed to be checking for the NUL terminator?
1122 p++;
1123 }
regards,
dan carpenter
The "initial_nr_hugepages" variable is unsigned long so it takes up to
20 characters to print, plus 1 more character for the NUL terminator.
Unfortunately, this buffer is not quite large enough for the terminator
to fit. Also use snprintf() for a belt and suspenders approach.
Fixes: fb9293b6b015 ("selftests/mm: compaction_test: fix bogus test success and reduce probability of OOM-killer invocation")
Signed-off-by: Dan Carpenter <dan.carpenter(a)linaro.org>
---
tools/testing/selftests/mm/compaction_test.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/mm/compaction_test.c b/tools/testing/selftests/mm/compaction_test.c
index e140558e6f53..2c3a0eb6b22d 100644
--- a/tools/testing/selftests/mm/compaction_test.c
+++ b/tools/testing/selftests/mm/compaction_test.c
@@ -89,9 +89,10 @@ int check_compaction(unsigned long mem_free, unsigned long hugepage_size,
int fd, ret = -1;
int compaction_index = 0;
char nr_hugepages[20] = {0};
- char init_nr_hugepages[20] = {0};
+ char init_nr_hugepages[24] = {0};
- sprintf(init_nr_hugepages, "%lu", initial_nr_hugepages);
+ snprintf(init_nr_hugepages, sizeof(init_nr_hugepages),
+ "%lu", initial_nr_hugepages);
/* We want to test with 80% of available memory. Else, OOM killer comes
in to play */
--
2.43.0
The relative RPATH ("./") supplied to linker options in CFLAGS is resolved
relative to current working directory and not the executable directory,
which will lead in incorrect resolution when the test executables are run
from elsewhere. Changing it to $ORIGIN makes it resolve relative
to the directory in which the executables reside, which is supposedly
the desired behaviour.
Discovered by the check-rpaths script[1][2] that checks for insecure
RPATH/RUNPATH[3], such as relative directories, during an attempt
to package BPF selftests for later use in CI:
ERROR 0004: file '/usr/libexec/kselftests/bpf/urandom_read' contains an insecure runpath '.' in [.]
[1] https://github.com/rpm-software-management/rpm/blob/master/scripts/check-rp…
[2] https://github.com/rpm-software-management/rpm/blob/master/scripts/check-rp…
[3] https://cwe.mitre.org/data/definitions/426.html
Signed-off-by: Eugene Syromiatnikov <esyr(a)redhat.com>
---
tools/testing/selftests/alsa/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/alsa/Makefile b/tools/testing/selftests/alsa/Makefile
index c1ce39874e2b..0f204da9ea8e 100644
--- a/tools/testing/selftests/alsa/Makefile
+++ b/tools/testing/selftests/alsa/Makefile
@@ -6,7 +6,7 @@ LDLIBS += $(shell pkg-config --libs alsa)
ifeq ($(LDLIBS),)
LDLIBS += -lasound
endif
-CFLAGS += -L$(OUTPUT) -Wl,-rpath=./
+CFLAGS += -L$(OUTPUT) -Wl,-rpath=\$$ORIGIN/
LDLIBS+=-lpthread
--
2.28.0
Hello Andrii Nakryiko,
This is a semi-automatic email about new static checker warnings.
Commit c381203eadb7 ("selftests/bpf: add trusted global subprog arg
tests") from Jan 29, 2024, leads to the following Smatch complaint:
./tools/testing/selftests/bpf/progs/verifier_global_ptr_args.c:88 trusted_task_arg_nonnull_fail2()
warn: variable dereferenced before check 'nullable' (see line 86)
./tools/testing/selftests/bpf/progs/verifier_global_ptr_args.c
85 /* should fail, PTR_TO_BTF_ID_OR_NULL */
86 res = subprog_trusted_task_nonnull(nullable);
^^^^^^^^
This is dereferenced
87
88 if (nullable)
^^^^^^^^
NULL check is too late
89 bpf_task_release(nullable);
90
regards,
dan carpenter
Hello,
KernelCI is hosting a bi-weekly call on Thursday to discuss improvements
to existing upstream tests, the development of new tests to increase
kernel testing coverage, and the enablement of these tests in KernelCI.
Below is a list of the tests the community has been working on and their
latest status updates, as discussed in the last meeting held on
2024-08-08:
*KTAP performance counters*
- Upcoming presentation @LPC2024 by Tim Bird on adding benchmark results
to KTAP: https://lpc.events/event/18/contributions/1791/
- Proposing new system to handle benchmark data, composed of 3 parts:
adding syntax to KTAP to support benchmark values, using a set of
external criteria for interpreting benchmark results, an automated tool
to determine and set the reference values used in these criteria.
- One related topic for discussion is where to store the reference files
and the test configuration, including all details that might impact the
results.
*Missing devices kselftest*
- Proposing new kselftest to report devices that go missing in the system:
https://lore.kernel.org/all/20240724-kselftest-dev-exist-v1-1-9bc21aa761b5@…
- Received feedback on the usability of the test and main unknowns about
management of reference files in tests
*Boot time test*
- RFC:
https://lore.kernel.org/all/20240725110622.96301-1-laura.nao@collabora.com/…
- Got feedback on the potential use of scripts from pm-graph. The
bootgraph.py script could be adapted for the test with some
modifications, such as adding support for machine-readable output and
different ftrace configurations.
*Suspend/resume in cpufreq kselftest*
- Sent v2 for patch adding RTC wakeup alarm in the cpufreq kselftest:
https://lore.kernel.org/lkml/20240715192634.19272-1-shreeya.patel@collabora…
- Looking into using the sleepgraph.py script from pm-graph to calculate
suspend/hibernation and resume time:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/too…
- Would require additional configs to be enabled in an automated
environment
*TAP conformance in kselftests and other fixes*
- Some dead selftests were removed:
https://lore.kernel.org/all/20240725110817.659099-1-usama.anjum@collabora.c…
and
https://lore.kernel.org/all/20240725121212.808206-1-usama.anjum@collabora.c…
- Bitmap test module conversion to KUnit was not accepted:
https://lore.kernel.org/lkml/49108735-c776-4b6f-8264-62a827dd7b26@collabora…
- Fixing error when kvm suite is built for unsupported architecure:
https://lore.kernel.org/kvm/c2aaa06e-e86d-4af9-bce4-6067e53cdf39@collabora.…
Please reply to this thread if you'd like to join the call or discuss any
of the topics further. We look forward to collaborating with the community
to improve upstream tests and expand coverage to more areas of interest
within the kernel.
Best regards,
Laura Nao
From: Allison Henderson <allison.henderson(a)oracle.com>
Hi All,
This series is a new selftest that Vegard, Chuck and myself have been
working on to provide some test coverage for rds. I've modified the
scripts to include the feedback from the last version, but let me know
if there's anything missed. Questions and comments appreciated.
Thanks everyone!
Allison
Changes in v2:
- Removed qemu vm creation and related code
- Updated README.txt with examples of running the test with virtme
- Removed init.sh. run.sh now directly calls test.py
- Some clean up done with the return code handling since there is no
vm between the scripts anymore
- Imported ip python function in
tools/testing/selftests/net/lib/py/utils.py into test.py
- Adapted test.py to use the imported ip function, and removed the
local ip wrapper
- Some line wrap clean up
- Link to v1:
https://lore.kernel.org/netdev/20240626012834.5678-3-allison.henderson@orac…
Vegard Nossum (3):
.gitignore: add .gcda files
net: rds: add option for GCOV profiling
selftests: rds: add testing infrastructure
.gitignore | 1 +
Documentation/dev-tools/gcov.rst | 11 +
MAINTAINERS | 1 +
net/rds/Kconfig | 9 +
net/rds/Makefile | 5 +
tools/testing/selftests/Makefile | 1 +
tools/testing/selftests/net/rds/Makefile | 12 +
tools/testing/selftests/net/rds/README.txt | 41 ++++
tools/testing/selftests/net/rds/config.sh | 53 +++++
tools/testing/selftests/net/rds/run.sh | 224 ++++++++++++++++++
tools/testing/selftests/net/rds/test.py | 262 +++++++++++++++++++++
11 files changed, 620 insertions(+)
create mode 100644 tools/testing/selftests/net/rds/Makefile
create mode 100644 tools/testing/selftests/net/rds/README.txt
create mode 100755 tools/testing/selftests/net/rds/config.sh
create mode 100755 tools/testing/selftests/net/rds/run.sh
create mode 100644 tools/testing/selftests/net/rds/test.py
--
2.25.1