diff options
author | Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | 2022-11-22 15:39:22 -0500 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-12-27 12:52:15 +0100 |
commit | a3798e6ffb37481c47773dd1d785c395c0785af8 (patch) | |
tree | 1dcaf6dfc14e1e58ff14cdb9f2c807845742937d /tools/testing/selftests/rseq | |
parent | ee31fff091fa9c185d10844f9caf38784afe4745 (diff) | |
download | lwn-a3798e6ffb37481c47773dd1d785c395c0785af8.tar.gz lwn-a3798e6ffb37481c47773dd1d785c395c0785af8.zip |
selftests/rseq: parametrized test: Report/abort on negative concurrency ID
Report and abort when a negative concurrency ID value is observed by the
spinlock test.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20221122203932.231377-21-mathieu.desnoyers@efficios.com
Diffstat (limited to 'tools/testing/selftests/rseq')
-rw-r--r-- | tools/testing/selftests/rseq/param_test.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/rseq/param_test.c b/tools/testing/selftests/rseq/param_test.c index cadb9d884811..bf951a490bb4 100644 --- a/tools/testing/selftests/rseq/param_test.c +++ b/tools/testing/selftests/rseq/param_test.c @@ -410,6 +410,11 @@ static int rseq_this_cpu_lock(struct percpu_lock *lock) int ret; cpu = get_current_cpu_id(); + if (cpu < 0) { + fprintf(stderr, "pid: %d: tid: %d, cpu: %d: cid: %d\n", + getpid(), (int) rseq_gettid(), rseq_current_cpu_raw(), cpu); + abort(); + } ret = rseq_cmpeqv_storev(RSEQ_MO_RELAXED, RSEQ_PERCPU, &lock->c[cpu].v, 0, 1, cpu); |