summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2010-11-12 04:22:00 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2010-11-12 04:22:00 +0000
commit81f6e90db281b9c0caa871391cc4869122c8e872 (patch)
tree0867da53856e1aef205ace54a7fc719b996a7407 /sys/powerpc
parentb5495356b24ecdcdf829764b8e2fd95dea55831c (diff)
downloadFreeBSD-src-81f6e90db281b9c0caa871391cc4869122c8e872.zip
FreeBSD-src-81f6e90db281b9c0caa871391cc4869122c8e872.tar.gz
Remove or conditionalize some hypervisor-unfriendly instruction sequences.
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/aim/mmu_oea64.c4
-rw-r--r--sys/powerpc/powerpc/mp_machdep.c12
2 files changed, 12 insertions, 4 deletions
diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c
index af57834..a2c80c0 100644
--- a/sys/powerpc/aim/mmu_oea64.c
+++ b/sys/powerpc/aim/mmu_oea64.c
@@ -1136,10 +1136,6 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
moea64_add_ofw_mappings(mmup, mmu, sz);
}
-#ifdef SMP
- TLBSYNC();
-#endif
-
/*
* Calculate the last available physical address.
*/
diff --git a/sys/powerpc/powerpc/mp_machdep.c b/sys/powerpc/powerpc/mp_machdep.c
index ee95f86..81c5481a 100644
--- a/sys/powerpc/powerpc/mp_machdep.c
+++ b/sys/powerpc/powerpc/mp_machdep.c
@@ -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)
;
OpenPOWER on IntegriCloud