[PATCH v1 9/9] bsp/pc386: Disable interrupt nesting for job handler

Jan Sommer jan.sommer at dlr.de
Sun May 31 14:22:59 UTC 2020


- Fixes timeout for smpipi01 where:
    + Main thread sends perform jobs to worker cpu while it is already
    performing jobs
    + Interrupt on worker cpu performs jobs, but with empty job list
    + Worker cpu continues to execut previous job and adds new job list
    to itself, which is never performed, since the interrupt has already
    been handled
    + Main thread blocks forever on barrier D
---
 bsps/i386/pc386/start/smp-imps.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/bsps/i386/pc386/start/smp-imps.c b/bsps/i386/pc386/start/smp-imps.c
index de593f3c40..0985b8f08f 100644
--- a/bsps/i386/pc386/start/smp-imps.c
+++ b/bsps/i386/pc386/start/smp-imps.c
@@ -768,7 +768,17 @@ static void bsp_inter_processor_interrupt(void *arg)
 
   smp_apic_ack();
 
+  /*
+   * Disallow nesting.
+   */
+   __asm__ __volatile__("cli");
+
   _SMP_Inter_processor_interrupt_handler(_Per_CPU_Get());
+
+   /*
+   * Allow nesting.
+   */
+   __asm__ __volatile__("sti");
 }
 
 void
-- 
2.12.3



More information about the devel mailing list