Re: Old PowerMac G5 2-socket/2-cores-each: head -r368820 kernel reports: bus_dmamem_alloc failed to align memory properly

Brandon Bergren bdragon at FreeBSD.org
Tue Dec 22 19:50:57 UTC 2020



On Tue, Dec 22, 2020, at 1:17 PM, Dennis Clarke via freebsd-ppc wrote:
> 
> >>
> >> Try the following in openfirmware before booting:
> >>
> >> dev /memory at 0 100000 1000 do-unmap
> >>
> 
> Getting to the OpenFirmware prompt is a real pain with a PC keyboard but
> I will see if I can figure out the Vulkan salute finger combination.
>

Once you're in, I recommend using:

setenv auto-boot? false
reset-all

so that it automatically enters OF every boot instead of autobooting.

(then you can use "boot" or "mac-boot" to do the actual boot.)
 
> >> There are certain versions of OpenFirmware that leave a page mapped 
> >> with the wrong protections erroneously and this smells like that bug to 
> >> me.
> > 
> > In fact, given the srr0 value in the fault, I am *certain* this is your problem.
> > 
> 
> Lovely.
> 
> > You can use nvedit to make this bugfix permanent for a given machine (We don't have our own guide, but the NetBSD guide @ https://www.netbsd.org/ports/macppc/nvedit.html is usable to apply this patch.)
> > 
> 
> I assure you that I have no idea at all what you are talking about.
> 

OpenFirmware (on Macs at least) has a method for applying patches and workarounds automatically every boot. My suggestion is to add the mapping fix into this so you don't have to reenter the command every time. It's a bit of a pain to do because of how weird the editor is, but it only has to be done once per machine as it gets saved to NVRAM.

By the way, the mapping bug also affects other stuff, like some versions of GRUB, so it's not a FreeBSD-specific problem. Anything that tries to execute from memory addresses 0x100000-100fff before the MMU has been flushed or the stale TLB entry has cycled out will hit the same problem.

The main OpenFirmware version affected by this bug is 4.8.7f1. If your OpenFirmware reports a different version, I would be very interested in hearing it, because I'm the one who originally isolated this bug so I have a personal interest in it.


-- 
  Brandon Bergren
  bdragon at FreeBSD.org


More information about the freebsd-ppc mailing list