From owner-svn-src-head@FreeBSD.ORG Wed Apr 25 22:44:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 00A72106564A; Wed, 25 Apr 2012 22:44:08 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E17318FC0C; Wed, 25 Apr 2012 22:44:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3PMi7H2017950; Wed, 25 Apr 2012 22:44:07 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3PMi7Wf017948; Wed, 25 Apr 2012 22:44:07 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201204252244.q3PMi7Wf017948@svn.freebsd.org> From: Stanislav Sedov Date: Wed, 25 Apr 2012 22:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234688 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2012 22:44:08 -0000 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,