Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Oct 2019 13:41:27 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r353922 - stable/12/sys/powerpc/aim
Message-ID:  <201910231341.x9NDfRvt022507@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Wed Oct 23 13:41:26 2019
New Revision: 353922
URL: https://svnweb.freebsd.org/changeset/base/353922

Log:
  MFC r353650:
  Clear PGA_WRITEABLE in moea_pvo_remove().

Modified:
  stable/12/sys/powerpc/aim/mmu_oea.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/powerpc/aim/mmu_oea.c
==============================================================================
--- stable/12/sys/powerpc/aim/mmu_oea.c	Wed Oct 23 13:40:39 2019	(r353921)
+++ stable/12/sys/powerpc/aim/mmu_oea.c	Wed Oct 23 13:41:26 2019	(r353922)
@@ -2120,23 +2120,26 @@ moea_pvo_remove(struct pvo_entry *pvo, int pteidx)
 		pvo->pvo_pmap->pm_stats.wired_count--;
 
 	/*
+	 * Remove this PVO from the PV and pmap lists.
+	 */
+	LIST_REMOVE(pvo, pvo_vlink);
+	RB_REMOVE(pvo_tree, &pvo->pvo_pmap->pmap_pvo, pvo);
+
+	/*
 	 * Save the REF/CHG bits into their cache if the page is managed.
+	 * Clear PGA_WRITEABLE if all mappings of the page have been removed.
 	 */
 	if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED) {
-		struct	vm_page *pg;
+		struct vm_page *pg;
 
 		pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.pte.pte_lo & PTE_RPGN);
 		if (pg != NULL) {
 			moea_attr_save(pg, pvo->pvo_pte.pte.pte_lo &
 			    (PTE_REF | PTE_CHG));
+			if (LIST_EMPTY(&pg->md.mdpg_pvoh))
+				vm_page_aflag_clear(pg, PGA_WRITEABLE);
 		}
 	}
-
-	/*
-	 * Remove this PVO from the PV and pmap lists.
-	 */
-	LIST_REMOVE(pvo, pvo_vlink);
-	RB_REMOVE(pvo_tree, &pvo->pvo_pmap->pmap_pvo, pvo);
 
 	/*
 	 * Remove this from the overflow list and return it to the pool



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