linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* 4xx tlbmiss renables interrupts while in kgdb
@ 2001-04-13 23:37 David Blythe
  2001-04-16 22:13 ` Dan Malek
  0 siblings, 1 reply; 2+ messages in thread
From: David Blythe @ 2001-04-13 23:37 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]

The 4xx tlbmiss handler reenables interrupts while handling a page
fault.  Sometimes kgdb generates faults (that are ignored) while
grubbing around in memory for backtraces and such and has the side
effect of leaving interrupts enabled.  Makes debugging drivers more
entertaining.

Here is a small, but not particularly elegant patch to fix it (against
the mvista 010216 release for the 405).
	david

[-- Attachment #2: patch7 --]
[-- Type: text/plain, Size: 1189 bytes --]

Index: arch/ppc/mm/4xx_tlb.c
===================================================================
diff -u -r1.2 4xx_tlb.c
--- arch/ppc/mm/4xx_tlb.c	2001/03/16 20:18:16	1.2
+++ arch/ppc/mm/4xx_tlb.c	2001/04/13 23:27:12
@@ -50,6 +50,9 @@


 /* Global Variables */
+#if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
+extern void (*debugger_fault_handler)(struct pt_regs *);
+#endif

 static pin_entry_t    pin_table[PPC4XX_TLB_SIZE];
 static unsigned long  tlb_next_replace = 0;
@@ -347,6 +350,10 @@
 	dtlb_miss_count++;

 	if (tlbMiss(regs, badaddr, wasWrite, 1)) {
+#if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
+		/* don't enable interrupts while in the debugger */
+		if (!debugger_fault_handler)
+#endif
 		sti();
 		do_page_fault(regs, badaddr, wasWrite);
 		cli();
@@ -362,6 +369,9 @@
 	itlb_miss_count++;

 	if (!current) {
+#if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
+		if (!debugger_fault_handler)
+#endif
 		sti();
 		bad_page_fault(regs, regs->nip);
 		cli();
@@ -369,6 +379,9 @@
 	}

 	if (tlbMiss(regs, regs->nip, 0, 1)) {
+#if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
+		if (!debugger_fault_handler)
+#endif
 		sti();
 		do_page_fault(regs, regs->nip, 0);
 		cli();

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 4xx tlbmiss renables interrupts while in kgdb
  2001-04-13 23:37 4xx tlbmiss renables interrupts while in kgdb David Blythe
@ 2001-04-16 22:13 ` Dan Malek
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Malek @ 2001-04-16 22:13 UTC (permalink / raw)
  To: David Blythe; +Cc: linuxppc-embedded


David Blythe wrote:
>
> The 4xx tlbmiss handler reenables interrupts while handling a page
> fault.

I have completely rewritten the 4xx TLB software, and this no
longer happens.  Please use the linuxppc_2_5 tree from the FSM Labs
BitKeeper tree.

> ...  Sometimes kgdb

Unfortunately, I'm not sure of the state of KGDB in this same
linuxppc_2_5 software.  You should be able to do things like
set breakpoints and examine memory, but some of the single stepping
may not work correctly (yet).


	-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-04-16 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-13 23:37 4xx tlbmiss renables interrupts while in kgdb David Blythe
2001-04-16 22:13 ` Dan Malek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).