diff options
author | Mark Johnston <markj@FreeBSD.org> | 2019-01-04 17:10:16 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2019-01-04 17:10:16 +0000 |
commit | c1959ba49bcc7e762f8fdb2d011ed443b24c96f9 (patch) | |
tree | 00be04f5fa26085f3b2166f85c2e329b4aa4685a /sys | |
parent | b679dc7fee87bad97393363c732f81c6c22ce75b (diff) | |
download | src-c1959ba49bcc7e762f8fdb2d011ed443b24c96f9.tar.gz src-c1959ba49bcc7e762f8fdb2d011ed443b24c96f9.zip |
Fix dirty bit handling in pmap_remove_write().
Reviewed by: jhb, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18732
Notes
Notes:
svn path=/head/; revision=342765
Diffstat (limited to 'sys')
-rw-r--r-- | sys/riscv/riscv/pmap.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 3f6744303895..e3dee2488434 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -2947,15 +2947,13 @@ retry_pv_loop: } } l3 = pmap_l3(pmap, pv->pv_va); -retry: oldl3 = pmap_load(l3); - +retry: if ((oldl3 & PTE_W) != 0) { - newl3 = oldl3 & ~PTE_W; - if (!atomic_cmpset_long(l3, oldl3, newl3)) + newl3 = oldl3 & ~(PTE_D | PTE_W); + if (!atomic_fcmpset_long(l3, &oldl3, newl3)) goto retry; - /* TODO: check for PTE_D? */ - if ((oldl3 & PTE_A) != 0) + if ((oldl3 & PTE_D) != 0) vm_page_dirty(m); pmap_invalidate_page(pmap, pv->pv_va); } |