Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jun 2010 13:13:14 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r209464 - stable/8/sys/powerpc/aim
Message-ID:  <201006231313.o5NDDEbU074827@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Wed Jun 23 13:13:14 2010
New Revision: 209464
URL: http://svn.freebsd.org/changeset/base/209464

Log:
  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

Modified:
  stable/8/sys/powerpc/aim/mmu_oea.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/ixgbe/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/powerpc/aim/mmu_oea.c
==============================================================================
--- stable/8/sys/powerpc/aim/mmu_oea.c	Wed Jun 23 12:17:13 2010	(r209463)
+++ stable/8/sys/powerpc/aim/mmu_oea.c	Wed Jun 23 13:13:14 2010	(r209464)
@@ -670,6 +670,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k
 	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 k
 
 	/*
 	 * 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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006231313.o5NDDEbU074827>