diff --git a/sched/Kconfig b/sched/Kconfig index 644f0cbc2c..e12767c992 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -268,6 +268,7 @@ config SMP default n depends on ARCH_HAVE_MULTICPU depends on ARCH_HAVE_TESTSET + depends on ARCH_INTERRUPTSTACK != 0 select SPINLOCK select SCHED_RESUMESCHEDULER select IRQCOUNT @@ -275,6 +276,17 @@ config SMP Enables support for Symmetric Multi-Processing (SMP) on a multi-CPU platform. + N.B. SMP mode requires the use of ARCH_INTERRUPTSTACK: + + CPU0 thread0 -> IRQ enter -> add thread0 to block_list -> IRQ leave(crash) + || + /\ + / \ + CPU1 thread1 -> block_task -> take thread0 from block_list -> run thread0 + + CPU0 IRQ handler use thread0's stack, but thread0 may switch to CPU1, that + will caused IRQ handler stack corruption. + if SMP config SMP_NCPUS