Subject: Re: Ultra 10 stability.
To: Andrew Gillham <gillham@vaultron.com>
From: Martin Husemann <martin@duskware.de>
List: port-sparc64
Date: 12/20/2002 15:07:52
--yrj/dFKFPuw6o+aM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Dec 19, 2002 at 04:52:03PM -0800, Andrew Gillham wrote:

> Is there any kind of workaround to keep from triggering this problem?

Here is my local patch...
It has two states, one that makes the problem happen instantly (machine does
not get up to multi-user) for testing, and the default that avoids the problem.
I had to adjust the length of the delay once when it stopped working.

Martin

--yrj/dFKFPuw6o+aM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="sparc64-pmap.patch"

Index: pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/sparc64/pmap.c,v
retrieving revision 1.130
diff -u -r1.130 pmap.c
--- pmap.c	2002/11/11 10:15:46	1.130
+++ pmap.c	2002/12/20 14:06:36
@@ -1,6 +1,9 @@
 /*	$NetBSD: pmap.c,v 1.130 2002/11/11 10:15:46 chs Exp $	*/
 #undef	NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define	HWREF
+
+#define MH_BREAK_FAST	0
+
 /*
  * 
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -1482,6 +1485,10 @@
 		if (!pm->pm_physaddr)
 			panic("pmap_create");
 		ctx_alloc(pm);
+#if !MH_BREAK_FAST
+		if (pm->pm_ctx == 0)
+			delay(500000);
+#endif
 	}
 	DPRINTF(PDB_CREATE, ("pmap_create(%p): ctx %d\n", pm, pm->pm_ctx));
 	return pm;
@@ -2639,6 +2646,8 @@
 			pv->pv_va &= ~(PV_MOD);
 			simple_unlock(&pmap->pm_lock);
 		}
+
+
 	pv_check();
 #ifdef DEBUG
 	if (pmap_is_modified(pg)) {
@@ -3193,7 +3202,11 @@
 	 * the PROM keeps some locked TLB entries there.
 	 */
 
+#if MH_BREAK_FAST
+	if (ctx == 4 /* numctx - 1 */ ) {
+#else
 	if (ctx == numctx - 1) {
+#endif
 		write_user_windows();
 		while (!LIST_EMPTY(&pmap_ctxlist)) {
 			ctx_free(LIST_FIRST(&pmap_ctxlist));

--yrj/dFKFPuw6o+aM--