ARM64: ipipe: hard protect against preemption by head domain
authorPhilippe Gerum <rpm@xenomai.org>
Fri, 29 Dec 2017 04:19:42 +0000 (20:19 -0800)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 27 Apr 2018 09:21:34 +0000 (11:21 +0200)
arch/arm64/kernel/signal.c

index 0bdc96c61bc0f2b14f627142a2778409c9c6a7d0..eaab6a4a3cf5d0dba3cb46ec60067afe98296d00 100644 (file)
@@ -744,12 +744,17 @@ static void do_signal(struct pt_regs *regs)
 asmlinkage void do_notify_resume(struct pt_regs *regs,
                                 unsigned int thread_flags)
 {
+#ifdef CONFIG_IPIPE
+       local_irq_disable();
+       hard_local_irq_enable();
+#else
        /*
         * The assembly code enters us with IRQs off, but it hasn't
         * informed the tracing code of that for efficiency reasons.
         * Update the trace code with the current status.
         */
        trace_hardirqs_off();
+#endif
 
        do {
                /* Check valid user FS if needed */
@@ -778,4 +783,9 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
                local_irq_disable();
                thread_flags = READ_ONCE(current_thread_info()->flags);
        } while (thread_flags & _TIF_WORK_MASK);
+
+#ifdef CONFIG_IPIPE
+       local_irq_enable();
+       hard_local_irq_disable();
+#endif
 }