l2_tos_ttl_inherit.sh uses a veth pair to run its tests, but only one
of the veth interfaces runs in a dedicated netns. The other one remains
in the initial namespace where the existing network configuration can
interfere with the setup used for the tests.
Isolate both veth devices in their own netns and ensure everything gets
cleaned up when the script exits.
Link: https://lore.kernel.org/netdev/924f1062-ab59-9b88-3b43-c44e73a30387@alu.uni…
Guillaume Nault (3):
selftests/net: l2_tos_ttl_inherit.sh: Set IPv6 addresses with "nodad".
selftests/net: l2_tos_ttl_inherit.sh: Run tests in their own netns.
selftests/net: l2_tos_ttl_inherit.sh: Ensure environment cleanup on
failure.
.../selftests/net/l2_tos_ttl_inherit.sh | 202 +++++++++++-------
1 file changed, 129 insertions(+), 73 deletions(-)
--
2.30.2
Since [1] the user-space program dma_map_benchmark shares the header file
linux/map_benchmark.h with the kernel driver in kernel/dma/map_benchmark.c.
With latest kernel version this does not compile any more.
While https://kernelnewbies.org/KernelHeaders suggests otherwise, allow it
to use of kernel headers through the uapi/ include direcotry. I assume we can
do so safely, since the controlling user-space program is distributed with
the kernel.
With this change dma_map_benchmark compiles with just the obvious warning
about uapi usage on ARCH=x86 and s390 and runs on ARCH=s390.
[1] commit 8ddde07a3d28 ("dma-mapping: benchmark: extract a common header file for map_benchmark definition")
Signed-off-by: Gerd Bayer <gbayer(a)linux.ibm.com>
---
tools/testing/selftests/dma/dma_map_benchmark.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/dma/dma_map_benchmark.c b/tools/testing/selftests/dma/dma_map_benchmark.c
index 5c997f17fcbd..d49d7ea6a63e 100644
--- a/tools/testing/selftests/dma/dma_map_benchmark.c
+++ b/tools/testing/selftests/dma/dma_map_benchmark.c
@@ -10,7 +10,7 @@
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
-#include <linux/types.h>
+#include <uapi/linux/types.h>
#include <linux/map_benchmark.h>
#define NSEC_PER_MSEC 1000000L
base-commit: 8abacb3356e68261ccd3a2ad74ed6042363e5d0f
--
2.38.1
From: Mirsad Goran Todorovac <mirsad.todorovac(a)alu.unizg.hr>
Adjust size parameter in connect() to match the type of the parameter, to fix "No such file or directory"
error in selftests/net/af_unix/test_oob_unix.c:127.
The existing code happens to work provided that the autogenerated pathname is shorter than
sizeof (struct sockaddr), which is why it hasn't been noticed earlier.
Visible from the trace excerpt:
bind(3, {sa_family=AF_UNIX, sun_path="unix_oob_453059"}, 110) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fa6a6577a10) = 453060
[pid <child>] connect(6, {sa_family=AF_UNIX, sun_path="unix_oob_45305"}, 16) = -1 ENOENT (No such file or directory)
BUG: The filename is trimmed to sizeof (struct sockaddr).
The patch is generated against the "vanilla" torvalds mainline tree 6.2-rc2.
Thanks and regards,
Mirsad Todorovac
Reported-by: Mirsad Goran Todorovac <mirsad.todorovac(a)alu.unizg.hr>
Cc: "David S. Miller" <davem(a)davemloft.net>
Cc: Eric Dumazet <edumazet(a)google.com>
Cc: Jakub Kicinski <kuba(a)kernel.org>
Cc: Paolo Abeni <pabeni(a)redhat.com>
Cc: Shuah Khan <shuah(a)kernel.org>
Cc: Kuniyuki Iwashima <kuniyu(a)amazon.co.jp>
Cc: Florian Westphal <fw(a)strlen.de>
Reviewed-by: Florian Westphal <fw(a)strlen.de>
---
tools/testing/selftests/net/af_unix/test_unix_oob.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/af_unix/test_unix_oob.c b/tools/testing/selftests/net/af_unix/test_unix_oob.c
index b57e91e1c3f2..532459a15067 100644
--- a/tools/testing/selftests/net/af_unix/test_unix_oob.c
+++ b/tools/testing/selftests/net/af_unix/test_unix_oob.c
@@ -124,7 +124,7 @@ void producer(struct sockaddr_un *consumer_addr)
wait_for_signal(pipefd[0]);
if (connect(cfd, (struct sockaddr *)consumer_addr,
- sizeof(struct sockaddr)) != 0) {
+ sizeof(*consumer_addr)) != 0) {
perror("Connect failed");
kill(0, SIGTERM);
exit(1);
--
Mirsad Goran Todorovac
Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu
--
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb, Republic of Croatia
The European Union
From: Ammar Faizi <ammarfaizi2(a)gnuweeb.org>
Hi Willy,
This series is a follow up of our previous discussion about getauxval()
and getpagesize() functions.
It will apply cleanly on top of your "20221227-nolibc-weak-4" branch.
Base commit: b6887ec8b0b0 ("tools/nolibc: add auxiliary vector
retrieval for mips").
I have added a selftest for the getpagesize() function, but I am not
sure how to assert the correctness of getauxval(). I think it is fine
not to add a selftest for getauxval(). If you think we should, please
give some advice on the test mechanism.
Thanks!
Signed-off-by: Ammar Faizi <ammarfaizi2(a)gnuweeb.org>
---
Ammar Faizi (3):
nolibc/stdlib: Implement `getauxval(3)` function
nolibc/sys: Implement `getpagesize(2)` function
selftests/nolibc: Add `getpagesize(2)` selftest
tools/include/nolibc/stdlib.h | 27 ++++++++++++++++++
tools/include/nolibc/sys.h | 21 ++++++++++++++
tools/testing/selftests/nolibc/nolibc-test.c | 30 ++++++++++++++++++++
3 files changed, 78 insertions(+)
base-commit: b6887ec8b0b0c78db414b78e329bf2ce234dedd5
--
Ammar Faizi
From: Ammar Faizi <ammarfaizi2(a)gnuweeb.org>
Hi,
This series adds signal handling support to the nolibc subsystem.
1) Initial implementation of nolibc sigaction(2) function.
Currently, this implementation is only available on the x86-64 arch.
sigaction() needs an architecture-dependent "signal trampoline"
function that invokes the __rt_sigreturn syscall to resume the process
after a signal gets handled.
On Linux x86-64, the "signal trampoline" function has to be written in
inline Assembly to prevent the compiler from controlling the %rsp
(e.g., with -fno-omit-frame-pointer, every function has a pushq
%rbp that makes the %rsp no longer point to struct rt_sigframe).
The "signal trampoline" function is called __arch_restore_rt in this
implementation.
2) signal(2) function.
signal() function is the simpler version of sigaction(). Unlike
sigaction(), which fully controls the struct sigaction, the caller
only cares about the sa_handler when calling the signal() function.
signal() internally calls sigaction(). This implementation is
currently only available on the x86-64 arch. When the sigaction()
function support is expanded to other architectures, this function
will automatically support those architectures. It's basically just
a sigaction() wrapper.
3) Extra nolibc updates.
Apart from the signal handling support. This series also contains
nolibc updates, they are:
- getpagesize() support.
- CFLAGS update.
- fork(2) selftest.
- sigaction(2) selftest.
- signal(2) selftest.
- getpagesize(2) selftest.
There 8 patches in this series. It has been tested on Linux x86-64 arch
and all tests OK.
$ sudo ./nolibc-test
Running test 'syscall'
...
...
66 wait_child = -1 ECHILD [OK]
67 waitpid_min = -1 ESRCH [OK]
68 waitpid_child = -1 ECHILD [OK]
69 write_badf = -1 EBADF [OK]
70 write_zero = 0 [OK]
Errors during this test: 0
Running test 'stdlib'
...
...
14 memcmp_60_20 = 64 [OK]
15 memcmp_20_e0 = -192 [OK]
16 memcmp_e0_20 = 192 [OK]
17 memcmp_80_e0 = -96 [OK]
18 memcmp_e0_80 = 96 [OK]
Errors during this test: 0
Total number of errors: 0
Exiting with status 0
$ make run -j8
Kernel: arch/x86/boot/bzImage is ready (#3)
...
82 test(s) passed.
Signed-off-by: Ammar Faizi <ammarfaizi2(a)gnuweeb.org>
---
It's also available in the Git repository.
The following changes since commit caf5c36025ec9395c8d7c78957b016a284812d23:
srcu: Update comment after the index flip (2022-12-21 09:01:53 -0800)
are available in the Git repository at:
https://github.com/ammarfaizi2/linux-block testing/rfc.v1.2022-12-22.nolibc
for you to fetch changes up to ac79aca684125907bfbefadfd6c6be0ccdfe8b33:
selftests/nolibc: Add `getpagesize(2)` selftest (2022-12-22 09:57:31 +0700)
----------------------------------------------------------------
Ammar Faizi (8):
nolibc/sys: Implement `sigaction(2)` function
nolibc/sys: Implement `signal(2)` function
nolibc/sys: Implement `getpagesize(2)` function
selftests/nolibc: Add `-Wall` and `-Wno-unsed-function` to the CFLAGS
selftests/nolibc: Add `fork(2)` selftest
selftests/nolibc: Add `sigaction(2)` selftest
selftests/nolibc: Add `signal(2)` selftest
selftests/nolibc: Add `getpagesize(2)` selftest
tools/include/nolibc/arch-x86_64.h | 12 +
tools/include/nolibc/sys.h | 224 +++++++++++++++++++
tools/testing/selftests/nolibc/Makefile | 2 +-
tools/testing/selftests/nolibc/nolibc-test.c | 219 +++++++++++++++++-
4 files changed, 454 insertions(+), 3 deletions(-)
base-commit: caf5c36025ec9395c8d7c78957b016a284812d23
--
Ammar Faizi
Commit 6b380799d251 ("selftests/vm: rename selftests/vm to
selftests/mm") in mm-unstable is missing some files that need to be
updated for the renaming. This commit adds the changes.
Fixes: 6b380799d251 ("selftests/vm: rename selftests/vm to selftests/mm") in mm-unstable
Signed-off-by: SeongJae Park <sj(a)kernel.org>
---
tools/testing/selftests/Makefile | 2 +-
tools/testing/selftests/kselftest_deps.sh | 6 +++---
tools/testing/selftests/mm/Makefile | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 41b649452560..56a29f2de8e6 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -85,7 +85,7 @@ TARGETS += tmpfs
TARGETS += tpm2
TARGETS += user
TARGETS += vDSO
-TARGETS += vm
+TARGETS += mm
TARGETS += x86
TARGETS += zram
#Please keep the TARGETS list alphabetically sorted
diff --git a/tools/testing/selftests/kselftest_deps.sh b/tools/testing/selftests/kselftest_deps.sh
index 7424a1f5babc..4bc14d9e8ff1 100755
--- a/tools/testing/selftests/kselftest_deps.sh
+++ b/tools/testing/selftests/kselftest_deps.sh
@@ -12,9 +12,9 @@ usage()
echo -e "Usage: $0 -[p] <compiler> [test_name]\n"
echo -e "\tkselftest_deps.sh [-p] gcc"
-echo -e "\tkselftest_deps.sh [-p] gcc vm"
+echo -e "\tkselftest_deps.sh [-p] gcc mm"
echo -e "\tkselftest_deps.sh [-p] aarch64-linux-gnu-gcc"
-echo -e "\tkselftest_deps.sh [-p] aarch64-linux-gnu-gcc vm\n"
+echo -e "\tkselftest_deps.sh [-p] aarch64-linux-gnu-gcc mm\n"
echo "- Should be run in selftests directory in the kernel repo."
echo "- Checks if Kselftests can be built/cross-built on a system."
echo "- Parses all test/sub-test Makefile to find library dependencies."
@@ -120,7 +120,7 @@ l1_tests=$(grep -r --include=Makefile "^LDLIBS" | \
# Level 2
# Some tests have multiple valid LDLIBS lines for individual sub-tests
# that need dependency checks. Find them and append them to the tests
-# e.g: vm/Makefile:$(OUTPUT)/userfaultfd: LDLIBS += -lpthread
+# e.g: mm/Makefile:$(OUTPUT)/userfaultfd: LDLIBS += -lpthread
# Filter out VAR_LDLIBS to discard the following:
# memfd/Makefile:$(OUTPUT)/fuse_mnt: LDLIBS += $(VAR_LDLIBS)
# Append space at the end of the list to append more tests.
diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile
index 89c14e41bd43..6a4b639b2b2b 100644
--- a/tools/testing/selftests/mm/Makefile
+++ b/tools/testing/selftests/mm/Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
-# Makefile for vm selftests
+# Makefile for mm selftests
-LOCAL_HDRS += $(selfdir)/vm/local_config.h $(top_srcdir)/mm/gup_test.h
+LOCAL_HDRS += $(selfdir)/mm/local_config.h $(top_srcdir)/mm/gup_test.h
include local_config.mk
--
2.25.1
This includes some patches to fix 2 issues on ftrace selftests.
- eprobe filter and eprobe syntax test case were introduced but it
doesn't check whether the kernel supports eprobe filter. Thus the
new test case fails on the kernel which has eprobe but not support
eprobe filter. To solve this issue, add a filter description to
README file [1/3] and run the filter syntax error test only if the
description is found in the README file [2/3].
- Recently objtool adds prefix symbols for the function padding nops,
and the probepoint test case fails because this probepoint test case
tests whether the kprobe event can probe the target function and the
functions next to the target function. But the prefix symbols can not
be probed. Thus these prefix symbols must be skipped [3/3].
Thank you,
---
Masami Hiramatsu (Google) (3):
tracing/eprobe: Fix to add filter on eprobe description in README file
selftests/ftrace: Fix eprobe syntax test case to check filter support
selftests/ftrace: Fix probepoint testcase to ignore __pfx_* symbols
kernel/trace/trace.c | 2 +-
.../test.d/dynevent/eprobes_syntax_errors.tc | 4 +++-
.../selftests/ftrace/test.d/kprobe/probepoint.tc | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
--
Masami Hiramatsu (Google) <mhiramat(a)kernel.org>