summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2010-06-20 16:56:48 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2010-06-20 16:56:48 +0000
commit75f3660605fcdf678edb8498311bba6ec652af82 (patch)
treed149d3deda462e2ed43c7212a1c8832a6e6eb428 /sys/powerpc
parente735ee5c8d1c56d4d050c3db2b30b65da1b04642 (diff)
downloadFreeBSD-src-75f3660605fcdf678edb8498311bba6ec652af82.zip
FreeBSD-src-75f3660605fcdf678edb8498311bba6ec652af82.tar.gz
Temporarily disable instruction relocation while setting up the kernel's
IBAT entry in early boot in order to prevent possible faults from races between the instruction cache and the MMU. PR: powerpc/148003 MFC after: 3 days
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/aim/mmu_oea.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c
index df52b62..de83462 100644
--- a/sys/powerpc/aim/mmu_oea.c
+++ b/sys/powerpc/aim/mmu_oea.c
@@ -672,6 +672,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
vm_size_t size, physsz, hwphyssz;
vm_offset_t pa, va, off;
void *dpcpu;
+ register_t msr;
/*
* Set up BAT0 to map the lowest 256 MB area
@@ -702,12 +703,16 @@ moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
/*
* Use an IBAT and a DBAT to map the bottom segment of memory
- * where we are.
+ * where we are. Turn off instruction relocation temporarily
+ * to prevent faults while reprogramming the IBAT.
*/
+ msr = mfmsr();
+ mtmsr(msr & ~PSL_IR);
__asm (".balign 32; \n"
"mtibatu 0,%0; mtibatl 0,%1; isync; \n"
"mtdbatu 0,%0; mtdbatl 0,%1; isync"
:: "r"(battable[0].batu), "r"(battable[0].batl));
+ mtmsr(msr);
/* map pci space */
__asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu));
OpenPOWER on IntegriCloud