Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Feb 2009 22:31:32 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r188349 - projects/releng_7_xen/sys/i386/xen
Message-ID:  <200902082231.n18MVWFu036825@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Sun Feb  8 22:31:31 2009
New Revision: 188349
URL: http://svn.freebsd.org/changeset/base/188349

Log:
  don't touch page tables directly

Modified:
  projects/releng_7_xen/sys/i386/xen/pmap.c

Modified: projects/releng_7_xen/sys/i386/xen/pmap.c
==============================================================================
--- projects/releng_7_xen/sys/i386/xen/pmap.c	Sun Feb  8 22:17:24 2009	(r188348)
+++ projects/releng_7_xen/sys/i386/xen/pmap.c	Sun Feb  8 22:31:31 2009	(r188349)
@@ -3664,14 +3664,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902082231.n18MVWFu036825>