Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757223AbbGGK4B (ORCPT ); Tue, 7 Jul 2015 06:56:01 -0400 Received: from terminus.zytor.com ([198.137.202.10]:60119 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756389AbbGGKzb (ORCPT ); Tue, 7 Jul 2015 06:55:31 -0400 Date: Tue, 7 Jul 2015 03:54:32 -0700 From: tip-bot for Andy Lutomirski Message-ID: Cc: luto@kernel.org, mingo@kernel.org, luto@amacapital.net, keescook@chromium.org, fweisbec@gmail.com, torvalds@linux-foundation.org, peterz@infradead.org, paulmck@linux.vnet.ibm.com, oleg@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com, vda.linux@googlemail.com, riel@redhat.com, bp@alien8.de, tglx@linutronix.de, dvlasenk@redhat.com, brgerst@gmail.com Reply-To: luto@kernel.org, mingo@kernel.org, luto@amacapital.net, fweisbec@gmail.com, keescook@chromium.org, torvalds@linux-foundation.org, peterz@infradead.org, paulmck@linux.vnet.ibm.com, oleg@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org, vda.linux@googlemail.com, riel@redhat.com, bp@alien8.de, tglx@linutronix.de, dvlasenk@redhat.com, brgerst@gmail.com In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/irq, context_tracking: Document how IRQ context tracking works and add an RCU assertion Git-Commit-ID: 0333a209cbf600e980fc55c24878a56f25f48b65 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2602 Lines: 64 Commit-ID: 0333a209cbf600e980fc55c24878a56f25f48b65 Gitweb: http://git.kernel.org/tip/0333a209cbf600e980fc55c24878a56f25f48b65 Author: Andy Lutomirski AuthorDate: Fri, 3 Jul 2015 12:44:34 -0700 Committer: Ingo Molnar CommitDate: Tue, 7 Jul 2015 10:59:10 +0200 x86/irq, context_tracking: Document how IRQ context tracking works and add an RCU assertion Signed-off-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: Denys Vlasenko Cc: Frederic Weisbecker Cc: H. Peter Anvin Cc: Kees Cook Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: paulmck@linux.vnet.ibm.com Link: http://lkml.kernel.org/r/e8bdc4ed0193fb2fd130f3d6b7b8023e2ec1ab62.1435952415.git.luto@kernel.org Signed-off-by: Ingo Molnar --- arch/x86/kernel/irq.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 88b36648..6233de0 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -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)) { -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/