aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Whitehorn <nwhitehorn@FreeBSD.org>2010-06-23 13:47:27 +0000
committerNathan Whitehorn <nwhitehorn@FreeBSD.org>2010-06-23 13:47:27 +0000
commit3aaef367db9985f28984701ddc059dcfbae7d945 (patch)
tree371e0857936efc28fc73ab1e9c513cdd33f7bf44
parenteeca979076e343b07a6964b0caee0c761b8d8beb (diff)
downloadsrc-3aaef367db9985f28984701ddc059dcfbae7d945.tar.gz
src-3aaef367db9985f28984701ddc059dcfbae7d945.zip
MFC r209369:
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 Approved by: re (kib)
Notes
Notes: svn path=/releng/8.1/; revision=209465
-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 8357929e4f28..a7f7b9f5b441 100644
--- a/sys/powerpc/aim/mmu_oea.c
+++ b/sys/powerpc/aim/mmu_oea.c
@@ -670,6 +670,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
@@ -700,12 +701,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));