lkml.org 
[lkml]   [2022]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 20/30] selftests/rseq: parametrized test: Report/abort on negative concurrency ID
    Date
    Report and abort when a negative concurrency ID value is observed by the
    spinlock test.

    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    ---
    tools/testing/selftests/rseq/param_test.c | 5 +++++
    1 file changed, 5 insertions(+)

    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);
    --
    2.25.1
    \
     
     \ /
      Last update: 2022-11-22 21:44    [W:2.689 / U:0.172 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site