From owner-freebsd-ppc@freebsd.org Wed Sep 21 22:12:00 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 37B63BE4509 for ; Wed, 21 Sep 2016 22:12:00 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-49.reflexion.net [208.70.210.49]) (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 E962AE6F for ; Wed, 21 Sep 2016 22:11:58 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 26770 invoked from network); 21 Sep 2016 22:05:03 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 21 Sep 2016 22:05:03 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.00.0) with SMTP; Wed, 21 Sep 2016 18:05:18 -0400 (EDT) Received: (qmail 1836 invoked from network); 21 Sep 2016 22:05:18 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 21 Sep 2016 22:05:18 -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 2306EEC9099; Wed, 21 Sep 2016 15:05:12 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r306065 - in head/sys vs. PowerMacs: Nathan's trail patch included but inappropriate? From: Mark Millard In-Reply-To: <8bc4d151-abcd-b300-9816-b1ca587c86f9@swissmail.org> Date: Wed, 21 Sep 2016 15:05:11 -0700 Cc: freebsd-ppc@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9335F45B-A630-40A8-B270-4659A0B8B11E@dsl-only.net> References: <917EFF5A-D054-4424-9D7D-4E4BEF6072EF@gmail.com> <4bb1046a-225d-66b2-7b00-067f0d6f6c60@gmail.com> <8bc4d151-abcd-b300-9816-b1ca587c86f9@swissmail.org> To: Krzysztof Parzyszek 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: Wed, 21 Sep 2016 22:12:00 -0000 On 2016-Sep-21, at 12:54 PM, Krzysztof Parzyszek wrote: > On 9/21/2016 1:15 PM, Jukka A. Ukkonen wrote: >> Anyhow the old code will not boot on a G5 without a change, neither >> will it boot with Nathan's patch included. Releasing 11.0-stable in >> a state that will not actually boot on one of the supported platforms >> will not look awfully bright either. I guess this is an issue for >> the re team to decide. >=20 > The 11 as it stands does not boot on my PowerMac G5. It hangs before = it starts printing the booting output. The only exception is that when I = enable DDB, it prints two lines about DDB and then hangs. >=20 > It does boot under Qemu though. I don't know what is going on. >=20 > -Krzysztof A couple of possible directions for the PowerMac G5 context: Direction 0: If you know how to get to the loader prompt you might be able to boot by = sidestepping the kernel's use of OpenFirmware. Nathan once asked for = such an experiment (after he checked in -r302214): > One thing it would be great to have some testing on after this change = is=20 > the FDT layer in loader. If you set usefdt=3D1 from the loader prompt,=20= > loader will distill the OF device tree into an FDT and then stop Open=20= > Firmware completely before transferring control to FreeBSD. This = should=20 > avoid any possible problems accessing Open Firmware from the kernel, = as=20 > well as making boot a little faster. > -Nathan The -r302214 changes were to sys/powerpc/aim/aim_machdep.c ad = sys/powerpc/aim/locore64.S . The changes are only in CURRRENT (now 12) from what I see so far. So for that context use of: usefdt=3D1 from the loader before then booting the kernel might manage to boot your = G5. I expect that Nathan would like to know the specifics of the result = either way. (I've not had access to do the experiment that he requested = back in late 2016-June when CURRENT was for 11.) I do not know if the loader and other code in 11.0-STABLE or the like = would allow an 11.0-??? experiment by merging the above two file = versions in with the 11.0 source that you might have. But that gets into = having a buildkernel/installkernel context for powerpc64, possibly via a = cross-build. Direction 1: Have you been able to build and install kernel with one of the following = changes that have been referenced and that Jukka A. Ukkonen tried (up to = minor spacing variations)? Changing: __asm __volatile("mfsprg0 %0\n\t" "mtsprg0 %1\n\t" "mtsprg1 %2\n\t" "mtsprg2 %3\n\t" "mtsprg3 %4\n\t" : "=3D&r"(ofw_sprg0_save) : "r"(ofmsr[1]), "r"(ofmsr[2]), "r"(ofmsr[3]), "r"(ofmsr[4])); in ofw_sprg_prepare(void) to one of: __asm __volatile("mfsprg0 %0\n\t" "mtsprg1 %1\n\t" "mtsprg2 %2\n\t" "mtsprg3 %3\n\t" : "=3D&r"(ofw_sprg0_save) : "r"(ofmsr[2]), "r"(ofmsr[3]), "r"(ofmsr[4])); or: __asm __volatile("mfsprg0 %0\n\t" : "=3D&r"(ofw_sprg0_save) : ); This may require a cross-build of the powerpc64 kernel if you have no = working powerpc64 context that can validly build whatever variant of the = powerpc64 11.0 kernel you want to try with such a change in. This type of experiment would not involve loader-prompt activity. If you have been or are able to try this change to your chosen 11.0 = variant and it fails to help that would be very interesting information, = please let us know the details, including especially Nathan Whitehorn. As stands there has been no checked-in change to address the issues for = Apple Powermac G5's. What has been observed on PowerMac G5's may or may = not have code that can also be compatible with non-Apple powerpc64 = environments that also use Open Firmware. I've never had non-Apple = access for powerpc64 or powerpc so I've no clue about what it takes to = have full compatibility in a single build. If there is such a fully-compatible coding then I expect Nathan would = check in the changes once they are known to work. But if there is no = such compatibile-everywhere change I doubt that G5 PowerMacs will have = priority: things have been problematical for booting PowerMac G5's for = years. So changing which machines are problematical is probably a = Principle of Lease Astonishment violation at this point. =3D=3D=3D Mark Millard markmi at dsl-only.net