summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2012-04-06 22:33:13 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2012-04-06 22:33:13 +0000
commita8563567c48866e0d25649d638d1acd18e94fa85 (patch)
tree0d42d0f2f4fa7d53ef39a9f53ef6a29f94cea898 /sys/powerpc/aim
parentf5030474fb1fea82b4ba545206f119d4905496a9 (diff)
downloadFreeBSD-src-a8563567c48866e0d25649d638d1acd18e94fa85.zip
FreeBSD-src-a8563567c48866e0d25649d638d1acd18e94fa85.tar.gz
Execute an initial ptesync if and only if the PTE is actually being
invalidated, as opposed to a ref/changed bit update.
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r--sys/powerpc/aim/moea64_native.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/sys/powerpc/aim/moea64_native.c b/sys/powerpc/aim/moea64_native.c
index 081194f..93187ca 100644
--- a/sys/powerpc/aim/moea64_native.c
+++ b/sys/powerpc/aim/moea64_native.c
@@ -153,13 +153,10 @@ TLBIE(uint64_t vpn) {
vpn &= ~(0xffffULL << 48);
#ifdef __powerpc64__
- sched_pin();
- __asm __volatile("ptesync");
mtx_lock(&tlbie_mutex);
__asm __volatile("tlbie %0" :: "r"(vpn) : "memory");
mtx_unlock(&tlbie_mutex);
__asm __volatile("eieio; tlbsync; ptesync");
- sched_unpin();
#else
vpn_hi = (uint32_t)(vpn >> 32);
vpn_lo = (uint32_t)vpn;
@@ -171,7 +168,6 @@ TLBIE(uint64_t vpn) {
mr %1, %0; \
insrdi %1,%5,1,0; \
mtmsrd %1; isync; \
- ptesync; \
\
sld %1,%2,%4; \
or %1,%1,%3; \
@@ -265,7 +261,9 @@ moea64_pte_clear_native(mmu_t mmu, uintptr_t pt_cookie, struct lpte *pvo_pt,
* As shown in Section 7.6.3.2.3
*/
pt->pte_lo &= ~ptebit;
+ sched_pin();
TLBIE(vpn);
+ sched_unpin();
}
static void
@@ -295,21 +293,16 @@ moea64_pte_unset_native(mmu_t mmu, uintptr_t pt_cookie, struct lpte *pvo_pt,
{
struct lpte *pt = (struct lpte *)pt_cookie;
- pvo_pt->pte_hi &= ~LPTE_VALID;
-
- /* Finish all pending operations */
- isync();
-
- /*
- * Force the reg & chg bits back into the PTEs.
- */
- SYNC();
-
/*
* Invalidate the pte.
*/
+ isync();
+ sched_pin();
+ pvo_pt->pte_hi &= ~LPTE_VALID;
pt->pte_hi &= ~LPTE_VALID;
+ PTESYNC();
TLBIE(vpn);
+ sched_unpin();
/*
* Save the reg & chg bits.
OpenPOWER on IntegriCloud