]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
x86/irq, context_tracking: Document how IRQ context tracking works and add an RCU...
authorAndy Lutomirski <luto@kernel.org>
Fri, 3 Jul 2015 19:44:34 +0000 (12:44 -0700)
committerIngo Molnar <mingo@kernel.org>
Tue, 7 Jul 2015 08:59:10 +0000 (10:59 +0200)
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: paulmck@linux.vnet.ibm.com
Link: http://lkml.kernel.org/r/e8bdc4ed0193fb2fd130f3d6b7b8023e2ec1ab62.1435952415.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/irq.c

index 88b366487b0e44b613e83d412febfad74381ca92..6233de046c0832e5a236bf5761b04de85b06c86e 100644 (file)
@@ -216,8 +216,23 @@ __visible unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
        unsigned vector = ~regs->orig_ax;
        unsigned irq;
 
+       /*
+        * NB: Unlike exception entries, IRQ entries do not reliably
+        * handle context tracking in the low-level entry code.  This is
+        * because syscall entries execute briefly with IRQs on before
+        * updating context tracking state, so we can take an IRQ from
+        * kernel mode with CONTEXT_USER.  The low-level entry code only
+        * updates the context if we came from user mode, so we won't
+        * switch to CONTEXT_KERNEL.  We'll fix that once the syscall
+        * code is cleaned up enough that we can cleanly defer enabling
+        * IRQs.
+        */
+
        entering_irq();
 
+       /* entering_irq() tells RCU that we're not quiescent.  Check it. */
+       rcu_lockdep_assert(rcu_is_watching(), "IRQ failed to wake up RCU");
+
        irq = __this_cpu_read(vector_irq[vector]);
 
        if (!handle_irq(irq, regs)) {