From owner-freebsd-ppc@freebsd.org Mon Sep 12 21:50:41 2016 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C15C6BD2D66 for ; Mon, 12 Sep 2016 21:50:41 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-186.reflexion.net [208.70.211.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 856FEEDE for ; Mon, 12 Sep 2016 21:50:41 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 20514 invoked from network); 12 Sep 2016 21:50:34 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 12 Sep 2016 21:50:34 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.00.0) with SMTP; Mon, 12 Sep 2016 17:50:26 -0400 (EDT) Received: (qmail 10241 invoked from network); 12 Sep 2016 21:50:25 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 12 Sep 2016 21:50:25 -0000 Received: from [192.168.0.104] (ip70-189-131-151.lv.lv.cox.net [70.189.131.151]) by iron2.pdx.net (Postfix) with ESMTPSA id 2AE71EC8073; Mon, 12 Sep 2016 14:50:33 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: PowerMac G5 hangs/crashes on boot: 10.2, 11.0-RCx From: Mark Millard In-Reply-To: <3177b120-625b-49bb-dbc8-46ea99e46097@freebsd.org> Date: Mon, 12 Sep 2016 14:50:32 -0700 Cc: Krzysztof Parzyszek , freebsd-ppc@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3EC34F05-EF27-404B-816E-9A104105D097@dsl-only.net> References: <6ad00a2d-4213-18b8-7974-534aa3758837@swissmail.org> <0A9EB3C7-F430-4F82-9B09-632754BB82C8@dsl-only.net> <6B075CE8-2AF5-479C-8363-6F5F33A0B62F@dsl-only.net> <5fd3b681-1050-9602-b338-fe0dc5e10642@swissmail.org> <3177b120-625b-49bb-dbc8-46ea99e46097@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 21:50:41 -0000 On 2016-Sep-12, at 2:00 PM, Nathan Whitehorn = wrote: > On 09/11/16 12:04, Krzysztof Parzyszek wrote: >> On 9/10/2016 7:12 PM, Mark Millard wrote: >>>=20 >>> Your report that you have some sort of failure after booting during = the likes of buildkernel is new as far as I know. Sending the list = (and/or a bugzilla report) about the failure mode and related = information may be appropriate and help in the future. (May be I missed = an already existing report.) >>=20 >> I think the issues with hangs are related to the temperature sensors. = I was getting console messages that the media temp sensor was reporting = 120C! I realized that as I replaced the hard drive, I changed the = position of the drive in a way that exposed the sensor to the wind from = the fans (it used to be angled a bit). Following this line of thought, I = stuck a piece of paper in front of the sensor and things seem to work. = At least work better than before. I have ordered a replacement sensor = from eBay, so hopefully that problem will go away. >>=20 >> Regarding your "hack": it works perfectly! So far, my system (10.3 at = the moment) has booted every single time, no exceptions, traps, = unexpected conditions. This is too good to remain as a "hack". I have no = experience debugging the kernel and I don't know ABI the OFW follows, = but I wouldn't mind digging a bit deeper into it, if someone shared some = pointers. >=20 > I've finally understood why this helps. Open Firmware runs in virtual = mode on the Powermac G5. This runs inside the kernel page table, which = preserves all address translations made by OF before the kernel starts; = as a result, the kernel address space is a strict superset of OF's. >=20 > Where this explodes is if OF uses an unmapped SLB entry. The SLB fault = handler runs in real mode and refers to the PCPU pointer in SPRG0, which = blows up the kernel. Having a value of SPRG0 that works for the kernel = is less fatal than preserving OF's value in this case. Actual theory of operation material! Great! I've no clue how I would = have figured out the Apple Open Firmware side of the context so I'd = still be stuck with just observation of the overall change in behavior. Presuming that you are correct: no longer "just a hack". That is great = news. It does sound like the Open Firmware side gets some risk of picking up = the wrong address map with the change. So avoiding Open Firmware in the = kernel via the usefdt=3D1 sounds like it would still be appropriate. > I believe that OF's SPRG0 is maintained only for compatibility with = some G4 Apple hardware, the eMac in particular, but will check and we = can move on with this. I think it should be safe to wrap this in an = #ifdef __powerpc64__. > -Nathan Again I've no clue how I would figure such a thing out. But, if some = powerpc Macs are the only reason GENERIC preserves SPRG0 and preserving = works for the other powerpcs so that detecting PowerMac vs. not is not = really required to decide on the SPRG0 handling (at least for = powerpc64), that too is great news. Thanks for continuing to look into why the SPRG0 change might have a = solid justification! >>=20 >> This is all with powerpc64. >>=20 >> I'll try checking if it helps with 11.0 next. >>=20 >> -Krzysztof >>=20 >> _______________________________________________ >> freebsd-ppc@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-ppc >> To unsubscribe, send any mail to = "freebsd-ppc-unsubscribe@freebsd.org" >>=20 =3D=3D=3D Mark Millard markmi at dsl-only.net