NetBSD Problem Report #51315

From www@NetBSD.org  Tue Jul  5 22:37:43 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 7AC397A471
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  5 Jul 2016 22:37:43 +0000 (UTC)
Message-Id: <20160705223742.343EE7AAB5@mollari.NetBSD.org>
Date: Tue,  5 Jul 2016 22:37:42 +0000 (UTC)
From: coypu@sdf.org
Reply-To: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Subject: (todo) MIPS1 DIAGNOSTIC assert failed: pcb2->pcb_context.val[_L_SR] & MIPS_SR_INT_IE
X-Send-Pr-Version: www-1.0

>Number:         51315
>Category:       port-mips
>Synopsis:       (todo) MIPS1 DIAGNOSTIC assert failed: pcb2->pcb_context.val[_L_SR] & MIPS_SR_INT_IE
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    skrll
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 05 22:40:00 +0000 2016
>Closed-Date:    Wed Nov 22 20:21:07 +0000 2017
>Last-Modified:  Wed Nov 22 20:21:07 +0000 2017
>Originator:     coypu
>Release:        NetBSD-7.99.33
>Organization:
>Environment:
NetBSD  7.99.33 NetBSD 7.99.33 (GENERIC-DEBUG) #25: Tue Jul  5 22:50:56 IDT 2016  fly@net.Home:/obj/pmax/sys/arch/pmax/compile/GENERIC-DEBUG pmax
>Description:
Booting a DIAGNOSTIC kernel on any MIPS1 machine (or gxemul -e 3max, booting a full install, not installer) panics:

pid 1(init): ABI set to O32 (e_flags=0x1007)
panic: kernel diagnostic assertion "pcb2->pcb_context.val[_L_SR] & MIPS_SR_INT_IE" failed: file "/usr/cvs-src/src/sys/arch/mips/mips/vm_machdep.c", line 150 14.1 0x80034
cpu0: Begin traceback...
pid -1020740368 not found
cpu0: End traceback...
0xc328bd00: cpu_reboot+38 (104,0,0,804e2ca0) ra 80314c5c sz 24
0xc328bd18: vpanic+1b0 (104,0,0,804e2ca0) ra 804139c0 sz 48
0xc328bd48: kern_assert+40 (104,8043adbc,8043faec,8043fb1c) ra 800527e8 sz 32
0xc328bd68: cpu_lwp_fork+218 (104,8043adbc,8043faec,8043fb1c) ra 802837a0 sz 64
0xc328bda8: uvm_lwp_fork+28 (104,8043adbc,8043faec,8043fb1c) ra 802c78c4 sz 32
0xc328bdc8: lwp_create+2d8 (104,8043adbc,8043faec,8043fb1c) ra 802bef4c sz 64
0xc328be08: fork1+44c (104,8043adbc,14,8043fb1c) ra 802bf69c sz 144
0xc328be98: sys_fork+2c (104,8043adbc,c328bf68,8043fb1c) ra 8004ec80 sz 48
0xc328bec8: syscall+260 (104,8043adbc,c328bf68,8043fb1c) ra 80041598 sz 128
0xc328bf48: mips1_systemcall+ec (104,8043adbc,c328bf68,8043fb1c) ra 7de726e0 sz 0

This is because MIPS1 interrupt enable bit is different.
Currently we use just MIPS_SR_INT_IE = 0x1, and initialize lwp0 to have this value in pcb_context.val[_L_SR]. It is later copied to all processes.

A valid assert test for MIPS1 would be:
(STATUS & 0xf) == 0xc

And the initial value (for lwp0) should be set differently, as well.

interrupt changes by hardware (among them, the 'rfe' call in kern_return) change the STATUS according to what MIPS1 should have for enabling interrupts, causing a conflict where the STATUS seems to have interrupts disabled when they are in fact, enabled.

The fixes will not be committed as this bug does not seem to cause an actual problem with real hardware, aside from the DIAGNOSTIC panic.
A fix will cause the second MIPS apocalypse^Wpatch to have merge conflicts, unnecessarily.

A temporary workaround is to comment out the assert.
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sun, 26 Feb 2017 12:33:02 +0000
State-Changed-Why:


Responsible-Changed-From-To: port-mips-maintainer->skrll
Responsible-Changed-By: skrll@NetBSD.org
Responsible-Changed-When: Sun, 26 Feb 2017 19:09:15 +0000
Responsible-Changed-Why:
Take


State-Changed-From-To: closed->open
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Sun, 26 Feb 2017 19:09:15 +0000
State-Changed-Why:
Not fixed yet


State-Changed-From-To: open->closed
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Wed, 22 Nov 2017 20:21:07 +0000
State-Changed-Why:
Fixed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.