From a96cab58ad7cc50af21547d02408ef758c0d1da5 Mon Sep 17 00:00:00 2001 From: ligd Date: Mon, 28 Jun 2021 16:57:19 +0800 Subject: [PATCH] sched: add depends on ARCH_INTERRUPTSTACK to SMP Change-Id: I7edbbcf314045c5567e30b39b0693672e5d10e9a Signed-off-by: ligd --- sched/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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