Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Oct 2019 15:03:49 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r353308 - head/sys/riscv/riscv
Message-ID:  <201910081503.x98F3nQk054509@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Oct  8 15:03:48 2019
New Revision: 353308
URL: https://svnweb.freebsd.org/changeset/base/353308

Log:
  Avoid erroneously clearing PGA_WRITEABLE in riscv's pmap_enter().
  
  During a CoW fault, we must check for both 4KB and 2MB mappings before
  clearing PGA_WRITEABLE on the old mapping's page.  Previously we were
  only checking for 4KB mappings.  This was missed in r344106.
  
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation

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

Modified: head/sys/riscv/riscv/pmap.c
==============================================================================
--- head/sys/riscv/riscv/pmap.c	Tue Oct  8 14:59:50 2019	(r353307)
+++ head/sys/riscv/riscv/pmap.c	Tue Oct  8 15:03:48 2019	(r353308)
@@ -2833,7 +2833,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v
 			if ((new_l3 & PTE_SW_MANAGED) == 0)
 				free_pv_entry(pmap, pv);
 			if ((om->aflags & PGA_WRITEABLE) != 0 &&
-			    TAILQ_EMPTY(&om->md.pv_list))
+			    TAILQ_EMPTY(&om->md.pv_list) &&
+			    ((om->flags & PG_FICTITIOUS) != 0 ||
+			    TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list)))
 				vm_page_aflag_clear(om, PGA_WRITEABLE);
 		}
 		pmap_invalidate_page(pmap, va);



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