svn commit: r348640 - stable/12/sys/riscv/riscv
Mark Johnston
markj at FreeBSD.org
Tue Jun 4 17:28:50 UTC 2019
Author: markj
Date: Tue Jun 4 17:28:49 2019
New Revision: 348640
URL: https://svnweb.freebsd.org/changeset/base/348640
Log:
MFC r340029 (by jhb):
Set PTE_A and PTE_D for user mappings in pmap_enter().
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:25:45 2019 (r348639)
+++ stable/12/sys/riscv/riscv/pmap.c Tue Jun 4 17:28:49 2019 (r348640)
@@ -2000,13 +2000,15 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v
pa = VM_PAGE_TO_PHYS(m);
pn = (pa / PAGE_SIZE);
- new_l3 = PTE_V | PTE_R | PTE_X;
+ new_l3 = PTE_V | PTE_R | PTE_X | PTE_A;
+ if (flags & VM_PROT_WRITE)
+ new_l3 |= PTE_D;
if (prot & VM_PROT_WRITE)
new_l3 |= PTE_W;
if ((va >> 63) == 0)
new_l3 |= PTE_U;
- else
- new_l3 |= PTE_A | PTE_D;
+ else if (prot & VM_PROT_WRITE)
+ new_l3 |= PTE_D;
new_l3 |= (pn << PTE_PPN0_S);
if ((flags & PMAP_ENTER_WIRED) != 0)
More information about the svn-src-stable-12
mailing list