svn commit: r215160 - in head/sys/powerpc: aim powerpc

Nathan Whitehorn nwhitehorn at FreeBSD.org
Fri Nov 12 04:22:00 UTC 2010


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)
 		;


More information about the svn-src-all mailing list