selftests/rseq: parametrized test: Report/abort on negative concurrency ID
[linux-2.6-microblaze.git] / tools / testing / selftests / rseq / param_test.c
index cadb9d8..bf951a4 100644 (file)
@@ -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);