Skip to content

Commit d799fd7

Browse files
KAGA-KOKOgregkh
authored andcommitted
selftests/rseq: Skip tests if time slice extensions are not available
commit 02b44d9 upstream. Don't fail, skip the test if the extensions are not enabled at compile or runtime. Fixes: 830969e ("selftests/rseq: Implement time slice extension test") Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com> Tested-by: Dmitry Vyukov <dvyukov@google.com> Link: https://patch.msgid.link/20260428224427.597838491%40kernel.org Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5eee2b1 commit d799fd7

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

tools/testing/selftests/rseq/slice_test.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ FIXTURE_SETUP(slice_ext)
124124
{
125125
cpu_set_t affinity;
126126

127+
if (rseq_register_current_thread())
128+
SKIP(return, "RSEQ not supported\n");
129+
130+
if (prctl(PR_RSEQ_SLICE_EXTENSION, PR_RSEQ_SLICE_EXTENSION_SET,
131+
PR_RSEQ_SLICE_EXT_ENABLE, 0, 0))
132+
SKIP(return, "Time slice extension not supported\n");
133+
127134
ASSERT_EQ(sched_getaffinity(0, sizeof(affinity), &affinity), 0);
128135

129136
/* Pin it on a single CPU. Avoid CPU 0 */
@@ -137,11 +144,6 @@ FIXTURE_SETUP(slice_ext)
137144
break;
138145
}
139146

140-
ASSERT_EQ(rseq_register_current_thread(), 0);
141-
142-
ASSERT_EQ(prctl(PR_RSEQ_SLICE_EXTENSION, PR_RSEQ_SLICE_EXTENSION_SET,
143-
PR_RSEQ_SLICE_EXT_ENABLE, 0, 0), 0);
144-
145147
self->noise_params.noise_nsecs = variant->noise_nsecs;
146148
self->noise_params.sleep_nsecs = variant->sleep_nsecs;
147149
self->noise_params.run = 1;

0 commit comments

Comments
 (0)