Commit a3798e6f authored by Mathieu Desnoyers's avatar Mathieu Desnoyers Committed by Peter Zijlstra

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: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20221122203932.231377-21-mathieu.desnoyers@efficios.com
parent ee31fff0
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment