Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1171055

[PATCH v3 15/15] x86/irq: Document how IRQ context tracking works and add an assertion

Path csiph.com!aioe.org!news.lightlink.com!eternal-september.org!feeder.eternal-september.org!weretis.net!feeder4.news.weretis.net!newsfeed.datemas.de!news.albasani.net!tahina.priv.at!bofh.it!news.nic.it!robomod
From Andy Lutomirski <luto@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v3 15/15] x86/irq: Document how IRQ context tracking works and add an assertion
Date Wed, 24 Jun 2015 04:50:03 +0200
Message-ID <pEIVd-554-49@gated-at.bofh.it> (permalink)
References <pEIVb-554-3@gated-at.bofh.it>
X-Original-To x86@kernel.org, linux-kernel@vger.kernel.org
X-Mailer git-send-email 2.4.3
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 41
Organization linux.* mail to news gateway
X-Original-Cc Frédéric Weisbecker <fweisbec@gmail.com>, Rik van Riel <riel@redhat.com>, Oleg Nesterov <oleg@redhat.com>, Denys Vlasenko <vda.linux@googlemail.com>, Borislav Petkov <bp@alien8.de>, Kees Cook <keescook@chromium.org>, Brian Gerst <brgerst@gmail.com>, paulmck@linux.vnet.ibm.com, Andy Lutomirski <luto@kernel.org>
X-Original-Date Tue, 23 Jun 2015 19:46:18 -0700
X-Original-Message-ID <5170d3b1685fe420a8265e70d65e8c354e8b683a.1435113808.git.luto@kernel.org>
X-Original-References <cover.1435113808.git.luto@kernel.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1171055

Show key headers only | View raw


Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 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 88b366487b0e..6233de046c08 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)) {
-- 
2.4.3

--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 00/15] x86: Rewrite exit-to-userspace code Andy Lutomirski <luto@kernel.org> - 2015-06-24 04:50 +0200
  [PATCH v3 10/15] x86/asm/entry/64: Save all regs on interrupt entry Andy Lutomirski <luto@kernel.org> - 2015-06-24 04:50 +0200
  [PATCH v3 04/15] x86: Move C entry and exit code to arch/x86/entry/common.c Andy Lutomirski <luto@kernel.org> - 2015-06-24 04:50 +0200
  [PATCH v3 15/15] x86/irq: Document how IRQ context tracking works and add an assertion Andy Lutomirski <luto@kernel.org> - 2015-06-24 04:50 +0200
  [PATCH v3 13/15] x86/entry: Remove exception_enter from trap handlers Andy Lutomirski <luto@kernel.org> - 2015-06-24 04:50 +0200
  [PATCH v3 05/15] x86/traps: Assert that we're in CONTEXT_KERNEL in exception entries Andy Lutomirski <luto@kernel.org> - 2015-06-24 04:50 +0200

csiph-web