[Bug 292494] powerpc64: booting qemu + mac99 results in crash (kernel DSI write trap) after openfirmware call once MMU/PMAP is setup

[email protected] Sun, 18 Jan 2026 18:02:18 +0000
Newsgroups gmane.os.freebsd.devel.ppc
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292494

--- Comment #5 from Adrian Chadd <[email protected]> ---
ok, and also the ofw calls work fine before the MMU is enabled, but once we
flip that and the pmap on, the subsequent call ends up with a null pointer
deref in openfirmware.

See:

```
        /*
         * Bring up MMU
         */
        pmap_mmu_init();
        printf("[adrian] pmap_mmu_init() done\n");
        adrian_of_check("fourth cpu call");
        link_elf_ireloc();
        adrian_of_check("fifth cpu call");
        pmap_bootstrap(startkernel, endkernel);
        printf("[adrian] pmap_bootstrap() done\n");
        adrian_of_check("sixth cpu call");
        mtmsr(psl_kernset & ~PSL_EE);
```

adrian_of_check is doing:

```
static void adrian_of_check(const char *str)
{
        printf("[adrian] attempt %s\n", str);
        phandle_t root, dev;
        root = OF_peer(0);
        dev = OF_child(root);
        (void) root;
        (void) dev;
        printf("[adrian] attempt %s DONE!\n", str);
}
```

It works fine up to after pmap_bootstrap(), that sixth call there fails to
return and hits a DSI on 0x0.

So I have a feeling that either we're passing in trash into openfirmware
/after/ we call pmap_bootstrap(), or the segment register / table shenanigans
being done to try and work around the dmap / memory re-arrangement isn't quite
enough here.

-- 
You are receiving this mail because:
You are the assignee for the bug.