Hi,
This series enables deadlock detection for srcu_read_lock() vs
synchronize_srcu().
Again, my first time helping prepare PR, so please take a careful look
and yell at me if there is something wrong. Thanks a lot!
You will also be able to find the series at:
https://github/fbq/linux rcu/lockdep.2023.03.12a
top commit is:
24390de55773
List of changes:
Boqun Feng (4):
locking/lockdep: Introduce lock_sync()
rcu: Annotate SRCU's update-side lockdep dependencies
locking: Reduce the number of locks in ww_mutex stress tests
locking/lockdep: Improve the deadlock scenario print for sync and read
lock
Paul E. McKenney (3):
rcutorture: Add SRCU deadlock scenarios
rcutorture: Add RCU Tasks Trace and SRCU deadlock scenarios
rcutorture: Add srcu_lockdep.sh
include/linux/lockdep.h | 8 +-
include/linux/srcu.h | 34 +++-
kernel/locking/lockdep.c | 64 +++++-
kernel/locking/test-ww_mutex.c | 2 +-
kernel/rcu/rcutorture.c | 185 ++++++++++++++++++
kernel/rcu/srcutiny.c | 2 +
kernel/rcu/srcutree.c | 2 +
.../selftests/rcutorture/bin/srcu_lockdep.sh | 73 +++++++
8 files changed, 359 insertions(+), 11 deletions(-)
create mode 100755 tools/testing/selftests/rcutorture/bin/srcu_lockdep.sh
--
2.39.2
selftests: arm64 below list of test cases fails on Linux next and
Linux mainline builds with clang-16 and gcc-12 kernel booted on
recently configured tuxrun qemu-arm64 (v7.2) enabled with MTE=on.
Am I missing anything on test configs / environment ?
List of selftests: arm64 test failures,
- not ok 38 selftests: arm64: check_buffer_fill # exit=1
- not ok 39 selftests: arm64: check_child_memory # exit=1
- not ok 41 selftests: arm64: check_ksm_options # exit=1
- not ok 42 selftests: arm64: check_mmap_options # exit=1
- not ok 44 selftests: arm64: check_tags_inclusion # exit=1
Reported-by: Linux Kernel Functional Testing <lkft(a)linaro.org>
Test log:
--------
[ 0.000000] Linux version 6.3.0-rc3-next-20230320 (tuxmake@tuxmake)
(Debian clang version 16.0.0
(++20230314094206+fce3e75e01ba-1~exp1~20230314094258.55), Debian LLD
16.0.0) #1 SMP PREEMPT @1679285968
..
[ 0.000000] CPU features: detected: Memory Tagging Extension
..
# selftests: arm64: check_buffer_fill
# 1..20
# not ok 1 Check buffer correctness by byte with sync err mode and mmap memory
# not ok 2 Check buffer correctness by byte with async err mode and mmap memory
# not ok 3 Check buffer correctness by byte with sync err mode and
mmap/mprotect memory
# not ok 4 Check buffer correctness by byte with async err mode and
mmap/mprotect memory
# not ok 5 Check buffer write underflow by byte with sync mode and mmap memory
# not ok 6 Check buffer write underflow by byte with async mode and mmap memory
# ok 7 Check buffer write underflow by byte with tag check fault
ignore and mmap memory
# ok 8 Check buffer write underflow by byte with sync mode and mmap memory
# ok 9 Check buffer write underflow by byte with async mode and mmap memory
# ok 10 Check buffer write underflow by byte with tag check fault
ignore and mmap memory
# not ok 11 Check buffer write overflow by byte with sync mode and mmap memory
# not ok 12 Check buffer write overflow by byte with async mode and mmap memory
# ok 13 Check buffer write overflow by byte with tag fault ignore mode
and mmap memory
# not ok 14 Check buffer write correctness by block with sync mode and
mmap memory
# not ok 15 Check buffer write correctness by block with async mode
and mmap memory
# ok 16 Check buffer write correctness by block with tag fault ignore
and mmap memory
# ok 17 Check initial tags with private mapping, sync error mode and mmap memory
# ok 18 Check initial tags with private mapping, sync error mode and
mmap/mprotect memory
# ok 19 Check initial tags with shared mapping, sync error mode and mmap memory
# ok 20 Check initial tags with shared mapping, sync error mode and
mmap/mprotect memory
# # Totals: pass:10 fail:10 xfail:0 xpass:0 skip:0 error:0
not ok 38 selftests: arm64: check_buffer_fill # exit=1
# selftests: arm64: check_child_memory
# 1..12
# not ok 1 Check child anonymous memory with private mapping, precise
mode and mmap memory
# not ok 2 Check child anonymous memory with shared mapping, precise
mode and mmap memory
# not ok 3 Check child anonymous memory with private mapping,
imprecise mode and mmap memory
# not ok 4 Check child anonymous memory with shared mapping, imprecise
mode and mmap memory
# not ok 5 Check child anonymous memory with private mapping, precise
mode and mmap/mprotect memory
# not ok 6 Check child anonymous memory with shared mapping, precise
mode and mmap/mprotect memory
# not ok 7 Check child file memory with private mapping, precise mode
and mmap memory
# not ok 8 Check child file memory with shared mapping, precise mode
and mmap memory
# not ok 9 Check child file memory with private mapping, imprecise
mode and mmap memory
# not ok 10 Check child file memory with shared mapping, imprecise
mode and mmap memory
# not ok 11 Check child file memory with private mapping, precise mode
and mmap/mprotect memory
# not ok 12 Check child file memory with shared mapping, precise mode
and mmap/mprotect memory
# # Totals: pass:0 fail:12 xfail:0 xpass:0 skip:0 error:0
not ok 39 selftests: arm64: check_child_memory # exit=1
# selftests: arm64: check_ksm_options
# 1..4
# # Invalid MTE synchronous exception caught!
not ok 41 selftests: arm64: check_ksm_options # exit=1
# selftests: arm64: check_mmap_options
# 1..22
# ok 1 Check anonymous memory with private mapping, sync error mode,
mmap memory and tag check off
# ok 2 Check file memory with private mapping, sync error mode,
mmap/mprotect memory and tag check off
# ok 3 Check anonymous memory with private mapping, no error mode,
mmap memory and tag check off
# ok 4 Check file memory with private mapping, no error mode,
mmap/mprotect memory and tag check off
# not ok 5 Check anonymous memory with private mapping, sync error
mode, mmap memory and tag check on
# not ok 6 Check anonymous memory with private mapping, sync error
mode, mmap/mprotect memory and tag check on
# not ok 7 Check anonymous memory with shared mapping, sync error
mode, mmap memory and tag check on
# not ok 8 Check anonymous memory with shared mapping, sync error
mode, mmap/mprotect memory and tag check on
# not ok 9 Check anonymous memory with private mapping, async error
mode, mmap memory and tag check on
# not ok 10 Check anonymous memory with private mapping, async error
mode, mmap/mprotect memory and tag check on
# not ok 11 Check anonymous memory with shared mapping, async error
mode, mmap memory and tag check on
# not ok 12 Check anonymous memory with shared mapping, async error
mode, mmap/mprotect memory and tag check on
# not ok 13 Check file memory with private mapping, sync error mode,
mmap memory and tag check on
# not ok 14 Check file memory with private mapping, sync error mode,
mmap/mprotect memory and tag check on
# not ok 15 Check file memory with shared mapping, sync error mode,
mmap memory and tag check on
# not ok 16 Check file memory with shared mapping, sync error mode,
mmap/mprotect memory and tag check on
# not ok 17 Check file memory with private mapping, async error mode,
mmap memory and tag check on
# not ok 18 Check file memory with private mapping, async error mode,
mmap/mprotect memory and tag check on
# not ok 19 Check file memory with shared mapping, async error mode,
mmap memory and tag check on
# not ok 20 Check file memory with shared mapping, async error mode,
mmap/mprotect memory and tag check on
# not ok 21 Check clear PROT_MTE flags with private mapping, sync
error mode and mmap memory
# not ok 22 Check clear PROT_MTE flags with private mapping and sync
error mode and mmap/mprotect memory
# # Totals: pass:4 fail:18 xfail:0 xpass:0 skip:0 error:0
not ok 42 selftests: arm64: check_mmap_options # exit=1
# selftests: arm64: check_tags_inclusion
# 1..4
# # Unexpected fault recorded for 0xb00ffff97724000-0xb00ffff97724050 in mode 1
# not ok 1 Check an included tag value with sync mode
# # Unexpected fault recorded for 0xc00ffff97724000-0xc00ffff97724050 in mode 1
# not ok 2 Check different included tags value with sync mode
# ok 3 Check none included tags value with sync mode
# # Unexpected fault recorded for 0xc00ffff97724000-0xc00ffff97724050 in mode 1
# not ok 4 Check all included tags value with sync mode
# # Totals: pass:1 fail:3 xfail:0 xpass:0 skip:0 error:0
not ok 44 selftests: arm64: check_tags_inclusion # exit=1
steps to reproduce:
-------
# To install tuxrun on your system globally:
# sudo pip3 install -U tuxrun==0.38.1
#
# See https://tuxrun.org/ for complete documentation.
tuxrun \
--runtime podman \
--device qemu-arm64 \
--boot-args rw \
--kernel https://storage.tuxsuite.com/public/linaro/lkft/builds/2NGM7Z86D9eB4UfDbhPF…
\
--modules https://storage.tuxsuite.com/public/linaro/lkft/builds/2NGM7Z86D9eB4UfDbhPF…
\
--rootfs https://storage.tuxboot.com/debian/bookworm/arm64/rootfs.ext4.xz \
--parameters SKIPFILE=skipfile-lkft.yaml \
--parameters KSELFTEST=https://storage.tuxsuite.com/public/linaro/lkft/builds/2NGM7Z86D9…
\
--image docker.io/lavasoftware/lava-dispatcher:2023.01.0020.gc1598238f \
--tests kselftest-arm64 \
--timeouts boot=30 kselftest-arm64=60
Boot command:
......
/usr/bin/qemu-system-aarch64 \
-cpu max,pauth-impdef=on \
-machine virt,gic-version=3,mte=on \
-nographic \
-nic none \
-m 4G \
-monitor none \
-no-reboot \
-smp 2 \
-kernel Image \
-append \"console=ttyAMA0,115200 rootwait root=/dev/vda debug verbose
console_msg_format=syslog rw earlycon\" \
-drive file=/debian_bookworm_arm64_rootfs.ext4,if=none,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0
Test log links,
Linux next:
https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230320/te…https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230320/te…https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230320/te…https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230320/te…
mainline:
https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.3-rc3/tes…https://qa-reports.linaro.org/lkft/linux-mainline-master/build/v6.3-rc3/tes…
--
Linaro LKFT
https://lkft.linaro.org
When the virtual address range selftest is run on arm64 and x86 platforms,
it is observed that both the low and high VA range iterations are skipped
when the MAP_CHUNK_SIZE is set to 16GB. The MAP_CHUNK_SIZE is changed to
1GB to resolve this issue, following which support for arm64 platform is
added by changing the NR_CHUNKS_HIGH for aarch64 to accommodate up to 4PB
of virtual address space allocation requests. Dynamic memory allocation
of array holding addresses is introduced to prevent overflow of the stack.
Finally, the overcommit_policy is set as OVERCOMMIT_ALWAYS to prevent the
kernel from denying a memory allocation request based on a platform's
physical memory availability.
This series has been tested on 6.3.0-rc1 mainline kernel, both on arm64
and x86 platforms.
Cc: Andrew Morton <akpm(a)linux-foundation.org>
Cc: Shuah Khan <shuah(a)kernel.org>
Cc: linux-mm(a)kvack.org
Cc: linux-kselftest(a)vger.kernel.org
Cc: linux-kernel(a)vger.kernel.org
Chaitanya S Prakash (3):
selftests: Change MAP_CHUNK_SIZE
selftests: Change NR_CHUNKS_HIGH for aarch64
selftests: Set overcommit_policy as OVERCOMMIT_ALWAYS
tools/testing/selftests/mm/run_vmtests.sh | 8 +++++++
.../selftests/mm/virtual_address_range.c | 24 +++++++++++++------
2 files changed, 25 insertions(+), 7 deletions(-)
--
2.30.2
Stack protection is a feature to detect and handle stack buffer
overflows at runtime.
For this to work the compiler and libc have to collaborate.
This patch adds the following parts to nolibc that are required by the
compiler:
* __stack_chk_guard: random sentinel value
* __stack_chk_fail: handler for detected stack smashes
In addition an initialization function is added that randomizes the
sentinel value.
Only support for global guards is implemented.
Register guards are useful in multi-threaded context which nolibc does
not provide support for.
Link: https://lwn.net/Articles/584225/
Signed-off-by: Thomas Weißschuh <linux(a)weissschuh.net>
---
Thomas Weißschuh (5):
tools/nolibc: add definitions for standard fds
tools/nolibc: add helpers for wait() signal exits
tools/nolibc: tests: constify test_names
tools/nolibc: add support for stack protector
tools/nolibc: tests: add test for -fstack-protector
tools/include/nolibc/Makefile | 4 +-
tools/include/nolibc/arch-i386.h | 8 ++-
tools/include/nolibc/arch-x86_64.h | 5 ++
tools/include/nolibc/nolibc.h | 1 +
tools/include/nolibc/stackprotector.h | 48 ++++++++++++++++++
tools/include/nolibc/types.h | 2 +
tools/include/nolibc/unistd.h | 5 ++
tools/testing/selftests/nolibc/Makefile | 12 +++++
tools/testing/selftests/nolibc/nolibc-test.c | 76 ++++++++++++++++++++++++++--
9 files changed, 155 insertions(+), 6 deletions(-)
---
base-commit: b7453ccfdbe0b9e95b488814c53e8cbf8966aae4
change-id: 20230223-nolibc-stackprotector-d4d5f48ff771
Best regards,
--
Thomas Weißschuh <linux(a)weissschuh.net>
Use ksft_finished() after running tests so that resctrl_tests doesn't
return exit code 0 when tests fail.
Consequently, report the MBA and MBM tests as skipped when running on
non-Intel hardware, otherwise resctrl_tests will exit with a failure
code.
Signed-off-by: Peter Newman <peternewman(a)google.com>
---
tools/testing/selftests/resctrl/resctrl_tests.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
index df0d8d8526fc..69ebb0d7fff6 100644
--- a/tools/testing/selftests/resctrl/resctrl_tests.c
+++ b/tools/testing/selftests/resctrl/resctrl_tests.c
@@ -77,7 +77,7 @@ static void run_mbm_test(bool has_ben, char **benchmark_cmd, int span,
ksft_print_msg("Starting MBM BW change ...\n");
- if (!validate_resctrl_feature_request(MBM_STR)) {
+ if (!validate_resctrl_feature_request(MBM_STR) || (get_vendor() != ARCH_INTEL)) {
ksft_test_result_skip("Hardware does not support MBM or MBM is disabled\n");
return;
}
@@ -98,7 +98,7 @@ static void run_mba_test(bool has_ben, char **benchmark_cmd, int span,
ksft_print_msg("Starting MBA Schemata change ...\n");
- if (!validate_resctrl_feature_request(MBA_STR)) {
+ if (!validate_resctrl_feature_request(MBA_STR) || (get_vendor() != ARCH_INTEL)) {
ksft_test_result_skip("Hardware does not support MBA or MBA is disabled\n");
return;
}
@@ -258,10 +258,10 @@ int main(int argc, char **argv)
ksft_set_plan(tests ? : 4);
- if ((get_vendor() == ARCH_INTEL) && mbm_test)
+ if (mbm_test)
run_mbm_test(has_ben, benchmark_cmd, span, cpu_no, bw_report);
- if ((get_vendor() == ARCH_INTEL) && mba_test)
+ if (mba_test)
run_mba_test(has_ben, benchmark_cmd, span, cpu_no, bw_report);
if (cmt_test)
@@ -272,5 +272,5 @@ int main(int argc, char **argv)
umount_resctrlfs();
- return ksft_exit_pass();
+ ksft_finished();
}
base-commit: c9c3395d5e3dcc6daee66c6908354d47bf98cb0c
--
2.40.0.rc1.284.g88254d51c5-goog