Do not rely on firmware having pre-enabled the MMU in a reasonable way for
late boot: enable it explicitly after installing the page tables. If booting from an FDT, also make sure to escape the firmware's MMU context early before overwriting firmware page tables. Approved by: re (gjb)
This commit is contained in:
parent
b689d9268f
commit
0081393d79
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=302279
@ -921,7 +921,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
|
||||
Maxmem = powerpc_btop(phys_avail[i + 1]);
|
||||
|
||||
moea_cpu_bootstrap(mmup,0);
|
||||
|
||||
mtmsr(mfmsr() | PSL_DR | PSL_IR);
|
||||
pmap_bootstrapped++;
|
||||
|
||||
/*
|
||||
|
@ -251,6 +251,18 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp)
|
||||
if (mdp == (void *)0x65504150)
|
||||
mdp = NULL;
|
||||
|
||||
#if AIM
|
||||
/*
|
||||
* If running from an FDT, make sure we are in real mode to avoid
|
||||
* tromping on firmware page tables. Everything in the kernel assumes
|
||||
* 1:1 mappings out of firmware, so this won't break anything not
|
||||
* already broken. This doesn't work if there is live OF, since OF
|
||||
* may internally use non-1:1 mappings.
|
||||
*/
|
||||
if (ofentry == 0)
|
||||
mtmsr(mfmsr() & ~(PSL_IR | PSL_DR));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Parse metadata if present and fetch parameters. Must be done
|
||||
* before console is inited so cninit gets the right value of
|
||||
|
Loading…
Reference in New Issue
Block a user