Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Nov 2010 04:22:00 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r215160 - in head/sys/powerpc: aim powerpc
Message-ID:  <201011120422.oAC4M0Fs095310@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Fri Nov 12 04:22:00 2010
New Revision: 215160
URL: http://svn.freebsd.org/changeset/base/215160

Log:
  Remove or conditionalize some hypervisor-unfriendly instruction sequences.

Modified:
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/powerpc/mp_machdep.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Fri Nov 12 04:18:19 2010	(r215159)
+++ head/sys/powerpc/aim/mmu_oea64.c	Fri Nov 12 04:22:00 2010	(r215160)
@@ -1136,10 +1136,6 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t
 		moea64_add_ofw_mappings(mmup, mmu, sz);
 	}
 
-#ifdef SMP
-	TLBSYNC();
-#endif
-
 	/*
 	 * Calculate the last available physical address.
 	 */

Modified: head/sys/powerpc/powerpc/mp_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/mp_machdep.c	Fri Nov 12 04:18:19 2010	(r215159)
+++ head/sys/powerpc/powerpc/mp_machdep.c	Fri Nov 12 04:22:00 2010	(r215160)
@@ -78,7 +78,13 @@ machdep_ap_bootstrap(void)
 		;
 
 	/* Initialize DEC and TB, sync with the BSP values */
+#ifdef __powerpc64__
+	/* Writing to the time base register is hypervisor-privileged */
+	if (mfmsr() & PSL_HV)
+		mttb(ap_timebase);
+#else
 	mttb(ap_timebase);
+#endif
 	decr_ap_init();
 
 	/* Serialize console output and AP count increment */
@@ -240,7 +246,13 @@ cpu_mp_unleash(void *dummy)
 	/* Let APs continue */
 	atomic_store_rel_int(&ap_letgo, 1);
 
+#ifdef __powerpc64__
+	/* Writing to the time base register is hypervisor-privileged */
+	if (mfmsr() & PSL_HV)
+		mttb(ap_timebase);
+#else
 	mttb(ap_timebase);
+#endif
 
 	while (ap_awake < smp_cpus)
 		;



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