Re: [PATCH v1 2/2] selftests/rseq: Fix mm_cid test failure

From: Shuah Khan
Date: Tue Oct 08 2024 - 17:29:18 EST


On 10/8/24 08:56, Mathieu Desnoyers wrote:
On 2024-10-04 21:18, Shuah Khan wrote:
On 10/3/24 18:44, Mathieu Desnoyers wrote:
Adapt the rseq.c/rseq.h code to follow GNU C library changes introduced by:

commit 2e456ccf0c34 ("Linux: Make __rseq_size useful for feature detection (bug 31965)")

Without this fix, rseq selftests for mm_cid fail:

./run_param_test.sh
Default parameters
Running test spinlock
Running compare-twice test spinlock
Running mm_cid test spinlock
Error: cpu id getter unavailable

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CC: Boqun Feng <boqun.feng@xxxxxxxxx>
CC: "Paul E. McKenney" <paulmck@xxxxxxxxxxxxxxxxxx>
Cc: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
CC: Carlos O'Donell <carlos@xxxxxxxxxx>
CC: Florian Weimer <fweimer@xxxxxxxxxx>
---
  tools/testing/selftests/rseq/rseq.c | 109 +++++++++++++++++++---------
  tools/testing/selftests/rseq/rseq.h |  10 +--
  2 files changed, 76 insertions(+), 43 deletions(-)


Looks good to me.

Acked-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>

Peter, Ingo - let me know if you plan to take this through
one of your trees. Otherwise I will pick it up.

Hi Shuah,

I just discussed with Peter on IRC, and if you can pick up
this rseq selftest fix through your tree it would be very much
appreciated,


Thank you for checking. Looks like it doesn't apply to my tree.

2e456ccf0c34 isn't in 6.12 yet?

Also a couple things you could fix. Please cc linux-kselftest
when you send the next revision with these fixed.

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
#114: FILE: tools/testing/selftests/rseq/rseq.c:110:
+unsigned get_rseq_min_alloc_size(void)

WARNING: Prefer 'fallthrough;' over fallthrough comment
#221: FILE: tools/testing/selftests/rseq/rseq.c:218:
+ case ORIG_RSEQ_FEATURE_SIZE: /* Fallthrough. */

thanks,
-- Shuah