Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Panic on acorn32 current



Finally had some time to bring my system up to date and found a problem.

Got a panic at start of day (transcribed from a shot of the screen):
fdc0 at pioc0 offset 0x3f0-0x3f7 irq12 drq 0x00002000

uvmfault(0xf036f42c, 217000, 2) -> e
Fatal kernel mode ata abort: 'Translation Fault (P)'
trapframe: 0xf03ccc40
FSR=183bd007, FAR=002170ef, spsr=20000093
r0 =002170ef, r1 =f02f2a65, r2 =0000000d, r3 =00217047
r4 =08000013, r5 =00000066, r6 =f02f2a65, r7 =f0351190
r8 =f02f2a64, r9 =00000005, r10=f02f2a64, r11=f04cccc0
r12=f03ccccc, ssp=f04ccc94, slr=f0027288, pc =f02d90d8

Stopped in pid 0.1 (system) at netbsd:strlcpy+0x30:strb r5, [r0], #001
db>bt
0xf03cccc8: netbsd:irq_claim+0xc
0xf03cccf0: netbsd:intr_claim+0x58
0xf03ccd28: netbsd:fdcattach+0xc0
....

Tracking it back it was introduced quite a while back (rev 1.13) of the file which made the section of the file containg the irq description strings read only (but the irq_claim code writes them).

The following patch fixes this issue and also corrects another bug that causes the interrupt names to get corrupted in systat. The legacy irq counter code expects all the irq names to be the same length and this patch restores that behaviour.

This needs a pullup to 8.0 (which has exactly the same bug). 7.1 is also impacted but I've not actually run the patch there. With this patch applied current and 8.0-BETA actually boot up and work pretty much the same as the previous rather ancient 6.99.40 kernel it was running before and there doesn't appear to be any obvious performance drop with the new code.

I've spotted some other issues:
1. Slight misdetect of the NE2000 derived ethernet chip
2. Hangs when attempt is made to reboot.
3. Bad behaviour in ddb.

I've run into these before and I've got some rather hacky fixes. Once they are cleaned up I'll send out another message with patches for those as well.

Mike

Index: sys/arch/arm/iomd/iomd_irq.S
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/iomd/iomd_irq.S,v
retrieving revision 1.16
diff -u -r1.16 iomd_irq.S
--- sys/arch/arm/iomd/iomd_irq.S	2 Dec 2013 18:36:10 -0000	1.16
+++ sys/arch/arm/iomd/iomd_irq.S	4 Mar 2018 17:02:34 -0000
@@ -412,7 +412,7 @@
 #ifdef IRQSTATS
 /* These symbols are used by vmstat */
 
-	.section .rodata
+	.section .data
 
 	.global	_C_LABEL(_intrnames)
 _C_LABEL(_intrnames):
Index: sys/arch/arm/iomd/iomd_irqhandler.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/iomd/iomd_irqhandler.c,v
retrieving revision 1.22
diff -u -r1.22 iomd_irqhandler.c
--- sys/arch/arm/iomd/iomd_irqhandler.c	25 Oct 2014 10:58:12 -0000	1.22
+++ sys/arch/arm/iomd/iomd_irqhandler.c	4 Mar 2018 17:02:34 -0000
@@ -180,7 +180,9 @@
 	/* Get the interrupt name from the head of the list */
 	char *iptr = _intrnames + (irq * 14);
 	if (handler->ih_name) {
-		strlcpy(iptr, handler->ih_name, 14);
+		/* kvm code expects these to be padded to the 
+		 * field length (13 chars + \0 in our case) */
+		snprintf(iptr, 14, "%-13.13s", handler->ih_name );
 	} else {
 		snprintf(iptr, 14, "irq %2d     ", irq);
 	}
@@ -290,7 +292,9 @@
 	/* Get the interrupt name from the head of the list */
 	char *iptr = _intrnames + (irq * 14);
 	if (irqhandlers[irq] && irqhandlers[irq]->ih_name) {
-		strlcpy(iptr, irqhandlers[irq]->ih_name, 14);
+		/* kvm code expects these to be padded to the 
+		 * field length (13 chars + \0 in our case) */
+		snprintf(iptr, 14, "%-13.13s", handler->ih_name );
 	} else {
 		snprintf(iptr, 14, "irq %2d     ", irq);
 	}


Home | Main Index | Thread Index | Old Index