Subject: Re: Getting "TLB IPI rendezvous failed..."
To: Stephan Uphoff <ups@tree.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 01/25/2005 17:19:24
--0F1p//8PRICkK4MW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Jan 25, 2005 at 04:52:38PM +0100, Manuel Bouyer wrote:
> On Sat, Jan 22, 2005 at 09:21:59AM -0500, Stephan Uphoff wrote:
> > Could you try the attached patch?
> > Please make sure that all your com devices show up.
> 
> OK, I finally got around to try it and have interesting results.
> First, I tried it yesterday, but the RAID parity was not clean, so raidframe
> didn't use both disks. I couldn't get the box to panic.
> I tried again today with a clean parity, I got the panic as expected.
> 
> I added attitional debug printfs, see the attached patch.

here is the patch in question

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

--0F1p//8PRICkK4MW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: i386/db_interface.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/db_interface.c,v
retrieving revision 1.42
diff -u -r1.42 db_interface.c
--- i386/db_interface.c	13 Feb 2004 11:36:13 -0000	1.42
+++ i386/db_interface.c	25 Jan 2005 15:44:59 -0000
@@ -262,6 +262,17 @@
 void
 cpu_Debugger()
 {
+	volatile struct cpu_info *ci;
+	int i;
+	
+	for (i=0; i < X86_MAXPROCS; i++) {
+		ci = cpu_info[i];
+		if (ci == NULL)
+			continue;
+
+		printf("CPU %ld interrupt level 0x%x pending 0x%x depth %d\n",
+		   ci->ci_cpuid, ci->ci_ilevel, ci->ci_ipending, ci->ci_idepth);
+	}
 	breakpoint();
 }
 
@@ -365,6 +376,9 @@
 			db_printf("CPU %ld not paused\n", addr);
 			return;
 		}
+		printf("CPU %ld current interrupt level 0x%x pending 0x%x "
+		    "depth %d\n", ci->ci_cpuid, ci->ci_ilevel,
+		    ci->ci_ipending, ci->ci_idepth);
 	}
 	if (ci->ci_ddb_regs == 0) {
 		db_printf("CPU %ld has no saved regs\n", addr);
Index: i386/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/machdep.c,v
retrieving revision 1.559
diff -u -r1.559 machdep.c
--- i386/machdep.c	20 Oct 2004 04:20:05 -0000	1.559
+++ i386/machdep.c	25 Jan 2005 15:44:59 -0000
@@ -1823,6 +1823,8 @@
 #endif
 	pmap_update(pmap_kernel());
 
+	memset(idt_allocmap, 0, sizeof(idt_allocmap));
+
 	tgdt = gdt;
 	gdt = (union descriptor *)
 		    ((char *)idt + NIDT * sizeof (struct gate_descriptor));
Index: i386/pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/pmap.c,v
retrieving revision 1.180
diff -u -r1.180 pmap.c
--- i386/pmap.c	1 Jan 2005 21:00:06 -0000	1.180
+++ i386/pmap.c	25 Jan 2005 15:44:59 -0000
@@ -3690,9 +3690,18 @@
 
 	while (self->ci_tlb_ipi_mask != 0) {
 #ifdef DIAGNOSTIC
-		if (count++ > 10000000)
+		if (count++ > 10000000) {
+			for (CPU_INFO_FOREACH(cii, ci)) {
+				if (ci == self)
+					continue;
+				printf("CPU %ld interrupt level 0x%x pending "
+				    "0x%x depth %d\n", ci->ci_cpuid,
+				    ci->ci_ilevel, ci->ci_ipending,
+				    ci->ci_idepth);
+			}
 			panic("TLB IPI rendezvous failed (mask %x)",
 			    self->ci_tlb_ipi_mask);
+		}
 #endif
 		x86_pause();
 	}

--0F1p//8PRICkK4MW--