From owner-freebsd-ppc@FreeBSD.ORG Mon Mar 17 15:30:04 2008 Return-Path: Delivered-To: freebsd-ppc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67126106566B for ; Mon, 17 Mar 2008 15:30:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 55AF58FC15 for ; Mon, 17 Mar 2008 15:30:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m2HFU4WL079501 for ; Mon, 17 Mar 2008 15:30:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m2HFU4wg079498; Mon, 17 Mar 2008 15:30:04 GMT (envelope-from gnats) Date: Mon, 17 Mar 2008 15:30:04 GMT Message-Id: <200803171530.m2HFU4wg079498@freefall.freebsd.org> To: freebsd-ppc@FreeBSD.org From: Peter Grehan Cc: Subject: Re: powerpc/121407: [panic] Won't boot up; strange error message. X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Peter Grehan List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2008 15:30:04 -0000 The following reply was made to PR powerpc/121407; it has been noted by GNATS. From: Peter Grehan To: bug-followup@FreeBSD.org, phillip-murphy@hotmail.com Cc: Subject: Re: powerpc/121407: [panic] Won't boot up; strange error message. Date: Mon, 17 Mar 2008 08:12:32 -0700 I have some more info on this. The PC that it fails at is in moea_bootstrap(), 4d3f98: 60 00 00 00 nop 4d3f9c: 60 00 00 00 nop 4d3fa0: 7d 30 83 a6 mtibatu 0,r9 4d3fa4: 7c 11 83 a6 mtibatl 0,r0 >>4d3fa8: 4c 00 01 2c isync 4d3fac: 7d 38 83 a6 mtdbatu 0,r9 4d3fb0: 7c 19 83 a6 mtdbatl 0,r0 4d3fb4: 4c 00 01 2c isync 4d3fb8: 3d 20 80 00 lis r9,-32768 4d3fbc: 61 29 1f fe ori r9,r9,8190 4d3fc0: 3c 00 80 00 lis r0,-32768 .. and this corresponds to RELENG_7 powerpc/powerpc/mmu_oea.c:moea_bootstrap() /* * Use an IBAT and a DBAT to map the bottom segment of memory * where we are. */ batu = BATU(0x00000000, BAT_BL_256M, BAT_Vs); batl = BATL(0x00000000, BAT_M, BAT_PP_RW); __asm (".balign 32; \n" "mtibatu 0,%0; mtibatl 0,%1; isync; \n" "mtdbatu 0,%0; mtdbatl 0,%1; isync" :: "r"(batu), "r"(batl)); The problem is that the instruction BAT register 0 is being updated underneath code that will then be mapped by it, resulting in races between the G3's instruction decoder, instruction pipe, and the registers being used for i-translation. I saw this problem on all G3's on 6.0, and fixed it after a lot of experiments by cache-aligning the instruction (the .balign directive, and the source of the nop's in the disassembly). 7.0 boots fine on my B&W G3, and 450MHz G3 iMac. However, it appears that there is at least one system out there that still has an issue with this code :( I'll try and fix this once and for all by disabling instruction translation around the IBAT update, and then re-enabling it.