svn commit: r234688 - head/sys/arm/arm
Stanislav Sedov
stas at FreeBSD.org
Wed Apr 25 22:44:08 UTC 2012
Author: stas
Date: Wed Apr 25 22:44:07 2012
New Revision: 234688
URL: http://svn.freebsd.org/changeset/base/234688
Log:
- Disable MMU before reconfiguring the pagetables in the trampoline code.
Otherwise we might end up overwriting the PTEs we're currently using
for some reason.
Reviewed by: cognet
Modified:
head/sys/arm/arm/elf_trampoline.c
Modified: head/sys/arm/arm/elf_trampoline.c
==============================================================================
--- head/sys/arm/arm/elf_trampoline.c Wed Apr 25 21:59:56 2012 (r234687)
+++ head/sys/arm/arm/elf_trampoline.c Wed Apr 25 22:44:07 2012 (r234688)
@@ -614,6 +614,17 @@ __start(void)
(unsigned int)&func_end + 800 , 0);
if (altdst > dst)
dst = altdst;
+
+ /*
+ * Disable MMU. Otherwise, setup_pagetables call below
+ * might overwrite the L1 table we are currently using.
+ */
+ cpu_idcache_wbinv_all();
+ cpu_l2cache_wbinv_all();
+ __asm __volatile("mrc p15, 0, %0, c1, c0, 0\n"
+ "bic %0, %0, #1\n" /* MMU_DISABLE */
+ "mcr p15, 0, %0, c1, c0, 0\n"
+ :"=r" (pt_addr));
} else
#endif
dst = 4 + load_kernel((unsigned int)&kernel_start,
More information about the svn-src-head
mailing list