NetBSD Problem Report #54942

From www@netbsd.org  Thu Feb  6 09:17:18 2020
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 "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 8D4541A9213
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  6 Feb 2020 09:17:18 +0000 (UTC)
Message-Id: <20200206091717.7EACD1A9251@mollari.NetBSD.org>
Date: Thu,  6 Feb 2020 09:17:17 +0000 (UTC)
From: rokuyama.rk@gmail.com
Reply-To: rokuyama.rk@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Random kernel panic on Quadra 660AV and 840AV
X-Send-Pr-Version: www-1.0

>Number:         54942
>Category:       port-mac68k
>Synopsis:       Random kernel panic on Quadra 660AV and 840AV
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-mac68k-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 06 09:20:00 +0000 2020
>Originator:     Rin Okuyama
>Release:        -HEAD and at least netbsd-9
>Organization:
Department of Physics, Meiji University
>Environment:
Sorry, I cannot physically access my 840AV at the moment.
>Description:
Kernel panics during boot have been reported for AV Macs sometimes in
port-mac68k. For my cases of 840AV, different kinds of panics, e.g.,
illegal instruction, MMU fault, FPU trap, etc., take place randomly
depending on kernel configuration and date of source code. DDB shows
that kernel text around the fault address becomes corrupted when panic
occurs.

I'm almost sure that this is due to DMA. Currently, we halt DMA
controller in kernel driver:

  https://nxr.netbsd.org/xref/src/sys/arch/mac68k/mac68k/psc.c#psc_kill_dma

However, this is too late; we should halt it in Booter. Otherwise,
DMA controller can transfer data to somewhere in low physical address
after Booter copied kernel image there.

Penguin booter for Linux halts DMA controller before copying kernel
image to low physical address.
>How-To-Repeat:
Boot kernel on Quadra 660AV or 840AV.
>Fix:
I've never observed this kind of panics if I use patched version of
Booter, by which DMA engine is halted before copying kernel image:

  http://www.netbsd.org/~rin/BSD_Mac68k_Booter.AV.20190818.bin
  (CAUTION: this version should not work on non-AV Macs)

  Some unorganized notes what I did for Booter:
  http://www.netbsd.org/~rin/Booter/

Unfortunately, this version of Booter is binary-patched and not working
for non-AV Macs; currently I do not have an environment to build Booter
from C codes. I will try to install CodeWarrior to My 840AV, but it may
take some time...

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.