Date: Mon, 18 Nov 2019 15:36:46 +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: r354815 - head/sys/arm64/arm64 Message-ID: <201911181536.xAIFak2S039809@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Mon Nov 18 15:36:46 2019 New Revision: 354815 URL: https://svnweb.freebsd.org/changeset/base/354815 Log: Let arm64 pmap_qenter() and pmap_kenter() unconditionally set NX. As on amd64, there is no need for mappings created by these functions to be executable. Reviewed by: alc, andrew MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22141 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Nov 18 15:28:10 2019 (r354814) +++ head/sys/arm64/arm64/pmap.c Mon Nov 18 15:36:46 2019 (r354815) @@ -1257,12 +1257,8 @@ pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_ KASSERT((size & PAGE_MASK) == 0, ("pmap_kenter: Mapping is not page-sized")); - attr = ATTR_DEFAULT | ATTR_IDX(mode) | L3_PAGE; - if (mode == DEVICE_MEMORY) - attr |= ATTR_XN; - else - attr |= ATTR_UXN; - + attr = ATTR_DEFAULT | ATTR_AP(ATTR_AP_RW) | ATTR_XN | ATTR_IDX(mode) | + L3_PAGE; va = sva; while (size != 0) { pde = pmap_pde(kernel_pmap, va, &lvl); @@ -1377,9 +1373,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) m = ma[i]; pa = VM_PAGE_TO_PHYS(m) | ATTR_DEFAULT | ATTR_AP(ATTR_AP_RW) | - ATTR_UXN | ATTR_IDX(m->md.pv_memattr) | L3_PAGE; - if (m->md.pv_memattr == DEVICE_MEMORY) - pa |= ATTR_XN; + ATTR_XN | ATTR_IDX(m->md.pv_memattr) | L3_PAGE; pte = pmap_l2_to_l3(pde, va); pmap_load_store(pte, pa);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911181536.xAIFak2S039809>