diff options
Diffstat (limited to 'sys/i386/xen/pmap.c')
-rw-r--r-- | sys/i386/xen/pmap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/i386/xen/pmap.c b/sys/i386/xen/pmap.c index 6ad67ff..4ef30f9 100644 --- a/sys/i386/xen/pmap.c +++ b/sys/i386/xen/pmap.c @@ -3713,14 +3713,17 @@ pmap_remove_write(vm_page_t m) retry: oldpte = *pte; if ((oldpte & PG_RW) != 0) { + vm_paddr_t newpte = oldpte & ~(PG_RW | PG_M); + /* * Regardless of whether a pte is 32 or 64 bits * in size, PG_RW and PG_M are among the least * significant 32 bits. */ - if (!atomic_cmpset_int((u_int *)pte, oldpte, - oldpte & ~(PG_RW | PG_M))) + PT_SET_VA_MA(pte, newpte, TRUE); + if (*pte != newpte) goto retry; + if ((oldpte & PG_M) != 0) vm_page_dirty(m); pmap_invalidate_page(pmap, pv->pv_va); |