svn commit: r306065 - in head/sys vs. PowerMacs: Nathan's trail patch included but inappropriate?

Mark Millard markmi at dsl-only.net
Wed Sep 21 22:12:00 UTC 2016


On 2016-Sep-21, at 12:54 PM, Krzysztof Parzyszek <kristof at swissmail.org> 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.
> 
> 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.
> 
> It does boot under Qemu though.  I don't know what is going on.
> 
> -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 
> the FDT layer in loader. If you set usefdt=1 from the loader prompt, 
> loader will distill the OF device tree into an FDT and then stop Open 
> Firmware completely before transferring control to FreeBSD. This should 
> avoid any possible problems accessing Open Firmware from the kernel, as 
> 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=1

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"
                        : "=&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"
                        : "=&r"(ofw_sprg0_save)
                        : "r"(ofmsr[2]),
                        "r"(ofmsr[3]),
                        "r"(ofmsr[4]));

or:

       __asm __volatile("mfsprg0 %0\n\t"
                        : "=&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.

===
Mark Millard
markmi at dsl-only.net




More information about the freebsd-ppc mailing list