[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)
Jukka A. Ukkonen
jau789 at gmail.com
Sun Sep 18 11:46:08 UTC 2016
On 09/17/16 00:41, Mark Millard wrote:
> 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...
>>
>> __asm __volatile("mfsprg0 %0\n\t"
>> : "=&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.
You asked it and I tested it. I must admit, though, that
I had a kind of an Arthur Dent moment during the test.
Remember the red button on the wall with the sign on
the side telling: "Do not press this button!", and
then Arthur being himself happily presses the button
anyway just to see the warning sign to be illuminated.
I was not quite so lucky.
It seems touching the current sprg0 treatment is a
guaranteed method to panic the system right at the
beginning of autoconfigure.
--jau
More information about the freebsd-ppc
mailing list