From owner-freebsd-ppc@FreeBSD.ORG Tue Apr 3 19:26:04 2007 Return-Path: X-Original-To: freebsd-ppc@freebsd.org Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B90316A404 for ; Tue, 3 Apr 2007 19:26:04 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by mx1.freebsd.org (Postfix) with ESMTP id D704913C483 for ; Tue, 3 Apr 2007 19:26:03 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from [192.168.0.13] (dsl-63-249-90-35.cruzio.com [63.249.90.35]) by dommail.onthenet.com.au (MOS 3.7.5a-GA) with ESMTP id CRA76698 (AUTH peterg@ptree32.com.au); Wed, 4 Apr 2007 05:25:59 +1000 (EST) Message-ID: <4612AA47.4060802@freebsd.org> Date: Tue, 03 Apr 2007 12:25:59 -0700 From: Peter Grehan User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) MIME-Version: 1.0 To: Andrew Turner References: <20070331141428.5f7cb6b4@hermies.int.fubar.geek.nz> In-Reply-To: <20070331141428.5f7cb6b4@hermies.int.fubar.geek.nz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-ppc@freebsd.org Subject: Re: Exception in openfirmware calling X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: grehan@freebsd.org List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2007 19:26:04 -0000 > I'm getting a cpu exception on the mtmsr instruction on line 213 in > ofw_machdep.c[1]. A copy of me single stepping through the code is > available at [2]. > > I would appreciate any incite to what is going wrong here so I can fix > it. What is happening is that at the time of the call, the stack is virtually addressed (from the %r1 value of 0xD575A898 in the dump). EFIKA OpenFirmware runs in real mode, so the effect of the mtmsr instruction is to disable virtual addressing, but the saved value is being stored on the stack which is no longer valid. A quick'n'dirty fix is to make all the local variables in this routine static. A correct fix is to have different openfirmware() routines for different implementations - as I've mentioned, I'm (slowly) doing this for G5 support. later, Peter.