svn commit: r348642 - stable/12/sys/riscv/riscv
Mark Johnston
markj at FreeBSD.org
Tue Jun 4 17:29:49 UTC 2019
Author: markj
Date: Tue Jun 4 17:29:47 2019
New Revision: 348642
URL: https://svnweb.freebsd.org/changeset/base/348642
Log:
MFC r340159 (by jhb):
Rework setting PTE_D for kernel mappings.
Modified:
stable/12/sys/riscv/riscv/pmap.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/riscv/riscv/pmap.c
==============================================================================
--- stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:29:20 2019 (r348641)
+++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:29:47 2019 (r348642)
@@ -2010,13 +2010,20 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v
new_l3 |= PTE_W;
if ((va >> 63) == 0)
new_l3 |= PTE_U;
- else if (prot & VM_PROT_WRITE)
- new_l3 |= PTE_D;
new_l3 |= (pn << PTE_PPN0_S);
if ((flags & PMAP_ENTER_WIRED) != 0)
new_l3 |= PTE_SW_WIRED;
- if ((m->oflags & VPO_UNMANAGED) == 0)
+
+ /*
+ * Set modified bit gratuitously for writeable mappings if
+ * the page is unmanaged. We do not want to take a fault
+ * to do the dirty bit accounting for these mappings.
+ */
+ if ((m->oflags & VPO_UNMANAGED) != 0) {
+ if (prot & VM_PROT_WRITE)
+ new_l3 |= PTE_D;
+ } else
new_l3 |= PTE_SW_MANAGED;
CTR2(KTR_PMAP, "pmap_enter: %.16lx -> %.16lx", va, pa);
More information about the svn-src-all
mailing list