Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jul 2019 17:00:19 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r350202 - head/sys/arm64/arm64
Message-ID:  <201907211700.x6LH0J4H018263@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sun Jul 21 17:00:19 2019
New Revision: 350202
URL: https://svnweb.freebsd.org/changeset/base/350202

Log:
  With the introduction of software dirty bit emulation for managed mappings,
  we should test ATTR_SW_DBM, not ATTR_AP_RW, to determine whether to set
  PGA_WRITEABLE.  In effect, we are currently setting PGA_WRITEABLE based on
  whether the dirty bit is preset, not whether the mapping is writeable.
  Correct this mistake.
  
  Reviewed by:	markj
  X-MFC with:	r350004
  Differential Revision:	https://reviews.freebsd.org/D21013

Modified:
  head/sys/arm64/arm64/pmap.c

Modified: head/sys/arm64/arm64/pmap.c
==============================================================================
--- head/sys/arm64/arm64/pmap.c	Sun Jul 21 16:35:49 2019	(r350201)
+++ head/sys/arm64/arm64/pmap.c	Sun Jul 21 17:00:19 2019	(r350202)
@@ -3361,7 +3361,7 @@ havel3:
 		CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, pa);
 		TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
 		m->md.pv_gen++;
-		if ((new_l3 & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW))
+		if ((new_l3 & ATTR_SW_DBM) != 0)
 			vm_page_aflag_set(m, PGA_WRITEABLE);
 	}
 
@@ -3554,7 +3554,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t 
 			    va, pmap);
 			return (KERN_RESOURCE_SHORTAGE);
 		}
-		if ((new_l2 & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW))
+		if ((new_l2 & ATTR_SW_DBM) != 0)
 			for (mt = m; mt < &m[L2_SIZE / PAGE_SIZE]; mt++)
 				vm_page_aflag_set(mt, PGA_WRITEABLE);
 	}



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