From owner-freebsd-ppc@freebsd.org Sat Sep 17 01:41:17 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 2CB2ABDD92D for ; Sat, 17 Sep 2016 01:41:17 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-41.reflexion.net [208.70.210.41]) (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 D6AC7EB3 for ; Sat, 17 Sep 2016 01:41:16 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 3350 invoked from network); 16 Sep 2016 21:42:01 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 16 Sep 2016 21:42:01 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.00.0) with SMTP; Fri, 16 Sep 2016 17:41:19 -0400 (EDT) Received: (qmail 29933 invoked from network); 16 Sep 2016 21:41:19 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 16 Sep 2016 21:41:19 -0000 Received: from [192.168.0.105] (ip70-189-131-151.lv.lv.cox.net [70.189.131.151]) by iron2.pdx.net (Postfix) with ESMTPSA id CD308EC7B69; Fri, 16 Sep 2016 14:41:13 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Re: [Bug 205458] 11.0-CURRENT/10-STABLE powerpc64: a PowerMac G5 specific sys/powerpc/ofw/ofw_machdep.c change for reliable PowerMac G5 booting (with lots of RAM) Message-Id: <0F078304-8E8F-4EB1-B721-B6C4B885F118@dsl-only.net> Date: Fri, 16 Sep 2016 14:41:13 -0700 To: FreeBSD PowerPC ML , jau789@gmail.com Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) 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: Sat, 17 Sep 2016 01:41:17 -0000 Jukka A. Ukkonen jau789 at gmail.com wrote on Fri Sep 16 15:36:05 UTC = 2016 : > it seems my PowerMac G5 is perfectly happy with this... >=20 > __asm __volatile("mfsprg0 %0\n\t" > : "=3D&r"(ofw_sprg0_save) > : > ); for the content in ofw_sprg_prepare(void). Interestingly ofw_sprg0_save's use to save and restore requires that the = same processor be in use in the restore side, ofw_sprg_restore(void): = SPRG0 content is processor specific. If the sprg0 save-restore is even required is not obvious to me: being = required would imply that that something else is adjusting it between = the save and restore code executions. The following is just in the form of another simplest-local-changes = experiment/analysis pass, not a "how it should be coded for general = FreeBSD use" form for __powerpc64__ or at least for for = PowerMac/iMac/Xserve G5's specifically. . . Given what is reported above by Jukka it would appear that the above = __asm lines possibly could be removed/disabled if ofw_sprg_restore(void) = also had its __asm line removed/disabled: i.e., __asm __volatile("mtsprg0 %0" :: "r"(ofw_sprg0_save)); would no log be in use to access ofw_sprg0_save. Effectively overall for the intended __powerpc64__ = PowerMac(/iMac?/Xserver?) experimental context ofw_sprg_prepare and = ofw_sprg_restore are then no-ops. In effect ofw_sprg0_save and ofmsr[1] to ofmsr[4] would not be in = significant use. But. . . OF_initial_setup(void *fdt_ptr, void *junk, int (*openfirm)(void *)) still would have __asm references to ofmsr[1] through ofmsr[4] where = they are initialized. You might want to try deleting/disabling the __asm statements in = ofw_sprg_prepare(void) and in ofw_sprg_restore(void) at the same time to = see if it makes any difference. If it does make a difference that would = be interesting and important. Otherwise it helps identify some more = (PowerMac/. . . context specific) unnecessary code. =3D=3D=3D Mark Millard markmi at dsl-only.net