summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/livepatch/Makefile
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <mpdesouza@suse.com>2024-01-12 14:43:52 -0300
committerShuah Khan <skhan@linuxfoundation.org>2024-01-22 10:29:53 -0700
commit6a71770442b5b7cf8f880ca1c0a72456c918c757 (patch)
tree87d53c582666ed3fa5540ac3f841c3303aff34a2 /tools/testing/selftests/livepatch/Makefile
parentc4bbe83d27c2446a033cc0381c3fb6be5e8c41c7 (diff)
downloadlinux-6a71770442b5b7cf8f880ca1c0a72456c918c757.tar.gz
linux-6a71770442b5b7cf8f880ca1c0a72456c918c757.tar.bz2
linux-6a71770442b5b7cf8f880ca1c0a72456c918c757.zip
selftests: livepatch: Test livepatching a heavily called syscall
The test proves that a syscall can be livepatched. It is interesting because syscalls are called a tricky way. Also the process gets livepatched either when sleeping in the userspace or when entering or leaving the kernel space. The livepatch is a bit tricky: 1. The syscall function name is architecture specific. Also ARCH_HAS_SYSCALL_WRAPPER must be taken in account. 2. The syscall must stay working the same way for other processes on the system. It is solved by decrementing a counter only for PIDs of the test processes. It means that the test processes has to call the livepatched syscall at least once. The test creates one userspace process per online cpu. The processes are calling getpid in a busy loop. The intention is to create random locations when the livepatch gets enabled. Nothing is guarantted. The magic is in the randomness. Reviewed-by: Joe Lawrence <joe.lawrence@redhat.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/livepatch/Makefile')
-rw-r--r--tools/testing/selftests/livepatch/Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/selftests/livepatch/Makefile b/tools/testing/selftests/livepatch/Makefile
index 119e2bbebe5d..35418a4790be 100644
--- a/tools/testing/selftests/livepatch/Makefile
+++ b/tools/testing/selftests/livepatch/Makefile
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
+TEST_GEN_FILES := test_klp-call_getpid
TEST_GEN_MODS_DIR := test_modules
TEST_PROGS_EXTENDED := functions.sh
TEST_PROGS := \
@@ -8,7 +9,8 @@ TEST_PROGS := \
test-shadow-vars.sh \
test-state.sh \
test-ftrace.sh \
- test-sysfs.sh
+ test-sysfs.sh \
+ test-syscall.sh
TEST_FILES := settings