Subject: port-amiga/1944: When ddb writes breakpoints into the kernel text, the kernel panics
To: None <gnats-bugs@gnats.netbsd.org>
From: Niklas Hallqvist <niklas@filippa.appli.se>
List: netbsd-bugs
Date: 01/14/1996 22:14:30
>Number:         1944
>Category:       port-amiga
>Synopsis:       When ddb writes breakpoints into the kernel text, the kernel panics
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 14 16:50:02 1996
>Last-Modified:
>Originator:     Niklas Hallqvist
>Organization:
	Applitron Datasystem AB
>Release:        951218
>Environment:
System: NetBSD filippa.appli.se 1.1_ALPHA NetBSD 1.1_ALPHA (FILIPPA) #562: Mon Dec 11 19:15:43 MET 1995 root@filippa.appli.se:/u3/newex/sys/arch/amiga/compile/FILIPPA amiga


>Description:
	When the debugger writes into the text segment (e.g. when entering
	a breakpoint) a cachectl call is done to flush the appropriate caches.
	However, the cachectl call used is for userland text, not kernel.
	So the kernel will panic if curproc is NULL.
>How-To-Repeat:
	boot into the debugger via loadbsd -D
	enter a breakpoint: "b _pmap_enter"
	continue, "c", and watch the kernel panic.
>Fix:
	Use dma_cachectl instead of cachectl as it deals with kernel virtual
	addresses instead of userlevel dittos.

*** old-NetBSD/src/sys/arch/amiga/amiga/db_memrw.c
--- NetBSD/src/sys/arch/amiga/amiga/db_memrw.c
***************
*** 112,118 ****
  
  	*pte = oldpte;
  	TBIS(dst);
! 	cachectl (4, dst, 1);
  }
  
  /*
--- 112,118 ----
  
  	*pte = oldpte;
  	TBIS(dst);
! 	dma_cachectl (dst, 1);
  }
  
  /*

>Audit-Trail:
>Unformatted: