This repository was archived by the owner on Nov 8, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
tools/testing/selftests/lkdtm Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,35 @@ static void lkdtm_HARDLOCKUP(void)
286
286
cpu_relax ();
287
287
}
288
288
289
+ static void __lkdtm_SMP_CALL_LOCKUP (void * unused )
290
+ {
291
+ for (;;)
292
+ cpu_relax ();
293
+ }
294
+
295
+ static void lkdtm_SMP_CALL_LOCKUP (void )
296
+ {
297
+ unsigned int cpu , target ;
298
+
299
+ cpus_read_lock ();
300
+
301
+ cpu = get_cpu ();
302
+ target = cpumask_any_but (cpu_online_mask , cpu );
303
+
304
+ if (target >= nr_cpu_ids ) {
305
+ pr_err ("FAIL: no other online CPUs\n" );
306
+ goto out_put_cpus ;
307
+ }
308
+
309
+ smp_call_function_single (target , __lkdtm_SMP_CALL_LOCKUP , NULL , 1 );
310
+
311
+ pr_err ("FAIL: did not hang\n" );
312
+
313
+ out_put_cpus :
314
+ put_cpu ();
315
+ cpus_read_unlock ();
316
+ }
317
+
289
318
static void lkdtm_SPINLOCKUP (void )
290
319
{
291
320
/* Must be called twice to trigger. */
@@ -680,6 +709,7 @@ static struct crashtype crashtypes[] = {
680
709
CRASHTYPE (UNALIGNED_LOAD_STORE_WRITE ),
681
710
CRASHTYPE (SOFTLOCKUP ),
682
711
CRASHTYPE (HARDLOCKUP ),
712
+ CRASHTYPE (SMP_CALL_LOCKUP ),
683
713
CRASHTYPE (SPINLOCKUP ),
684
714
CRASHTYPE (HUNG_TASK ),
685
715
CRASHTYPE (OVERFLOW_SIGNED ),
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ SLAB_FREE_CROSS
31
31
SLAB_FREE_PAGE
32
32
#SOFTLOCKUP Hangs the system
33
33
#HARDLOCKUP Hangs the system
34
+ #SMP_CALL_LOCKUP Hangs the system
34
35
#SPINLOCKUP Hangs the system
35
36
#HUNG_TASK Hangs the system
36
37
EXEC_DATA
You can’t perform that action at this time.
0 commit comments