Date: Tue, 4 Jun 2019 17:28:49 +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: r348640 - stable/12/sys/riscv/riscv Message-ID: <201906041728.x54HSnwD097941@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906041728.x54HSnwD097941>