diff options
author | jchandra <jchandra@FreeBSD.org> | 2010-08-06 09:25:42 +0000 |
---|---|---|
committer | jchandra <jchandra@FreeBSD.org> | 2010-08-06 09:25:42 +0000 |
commit | c3d4f0835cad384499298be886c0a8afc90d5822 (patch) | |
tree | b8c2257f90e86ae2f27e89d0aeab7b2833649fae | |
parent | 913fa4ba381b76ea679254f29c818b63c3702229 (diff) | |
download | FreeBSD-src-c3d4f0835cad384499298be886c0a8afc90d5822.zip FreeBSD-src-c3d4f0835cad384499298be886c0a8afc90d5822.tar.gz |
Fix issue reported by alc :
MIPS doesn't really need to use atomic_cmpset_int() in situations like
this because the software dirty bit emulation in trap.c acquires
the pmap lock. Atomics like this appear to be a carryover from i386
where the hardware-managed TLB might concurrently set the modified bit.
Reviewed by: alc
-rw-r--r-- | sys/mips/mips/pmap.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c index ecba6ff..929a7c6 100644 --- a/sys/mips/mips/pmap.c +++ b/sys/mips/mips/pmap.c @@ -1716,7 +1716,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) vm_page_lock_queues(); PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { - pt_entry_t pbits, obits; + pt_entry_t pbits; vm_page_t m; vm_paddr_t pa; @@ -1745,8 +1745,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) /* Skip invalid PTEs */ if (!pte_test(pte, PTE_V)) continue; -retry: - obits = pbits = *pte; + pbits = *pte; pa = TLBLO_PTE_TO_PA(pbits); if (page_is_managed(pa) && pte_test(&pbits, PTE_D)) { m = PHYS_TO_VM_PAGE(pa); @@ -1757,8 +1756,7 @@ retry: pte_set(&pbits, PTE_RO); if (pbits != *pte) { - if (!atomic_cmpset_int((u_int *)pte, obits, pbits)) - goto retry; + *pte = pbits; pmap_update_page(pmap, sva, pbits); } } |