Re: 2.6.23-git8: Lock dependency engine debugging failure

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Tuesday, October 16, 2007 - 6:59 am

On Mon, 2007-10-15 at 20:28 -0700, David Hubbard wrote:

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);


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.23-git8: Lock dependency engine debugging failure, David Hubbard, (Mon Oct 15, 8:28 pm)
Re: 2.6.23-git8: Lock dependency engine debugging failure, Peter Zijlstra, (Tue Oct 16, 6:59 am)
Re: 2.6.23-git8: Lock dependency engine debugging failure, David Hubbard, (Tue Oct 16, 8:17 am)