mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: David Hubbard <david.c.hubbard@gmail.com>
Cc: Linux kernel <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: 2.6.23-git8: Lock dependency engine debugging failure
Date: Tue, 16 Oct 2007 15:59:33 +0200	[thread overview]
Message-ID: <1192543173.27435.96.camel@twins> (raw)
In-Reply-To: <4dfa50520710152028i4a976200s88fbbb7f1cc2da9@mail.gmail.com>

On Mon, 2007-10-15 at 20:28 -0700, David Hubbard wrote:
> I am not subscribed to LKML, so please CC me in replies. I am
> reporting a regression when CONFIG_DEBUG_LOCKDEP is enabled in
> 2.6.23-git8. The error occurs immediately before loading init.
> Complete dmesg and kernel config are attached.
> 
> [   28.528074] VFS: Mounted root (ext3 filesystem) readonly.
> [   28.528090] Freeing unused kernel memory: 212k freed
> [   28.537431] Write protecting the kernel read-only data: 1036k
> [   28.622874] WARNING: at kernel/lockdep.c:2658 check_flags()

Could you try if the below patch works for you?

--
Subject: lockdep: fix fault vs irq tracing

Ensure we fixup the IRQ state before we hit any locking code.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/mm/fault_32.c |   10 ++++++++++
 arch/x86/mm/fault_64.c |   10 ++++++++++
 2 files changed, 20 insertions(+)

Index: linux-2.6/arch/x86/mm/fault_32.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/fault_32.c
+++ linux-2.6/arch/x86/mm/fault_32.c
@@ -308,6 +308,16 @@ fastcall void __kprobes do_page_fault(st
 	int write, si_code;
 	int fault;
 
+#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
+	/*
+	 * We can fault from pretty much anywhere, fix up the IRQ state.
+	 */
+	if (raw_irqs_disabled())
+		trace_hardirqs_off();
+	else
+		trace_hardirqs_on();
+#endif
+
 	/* get the address */
         address = read_cr2();
 
Index: linux-2.6/arch/x86/mm/fault_64.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/fault_64.c
+++ linux-2.6/arch/x86/mm/fault_64.c
@@ -311,6 +311,16 @@ asmlinkage void __kprobes do_page_fault(
 	unsigned long flags;
 	siginfo_t info;
 
+#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
+	/*
+	 * We can fault from pretty much anywhere, fix up the IRQ state.
+	 */
+	if (raw_irqs_disabled())
+		trace_hardirqs_off();
+	else
+		trace_hardirqs_on();
+#endif
+
 	tsk = current;
 	mm = tsk->mm;
 	prefetchw(&mm->mmap_sem);



  reply	other threads:[~2007-10-16 13:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-16  3:28 David Hubbard
2007-10-16 13:59 ` Peter Zijlstra [this message]
2007-10-16 15:17   ` David Hubbard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1192543173.27435.96.camel@twins \
    --to=peterz@infradead.org \
    --cc=david.c.hubbard@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®