Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Dec 2019 15:57:25 +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: r355294 - stable/12/sys/arm64/arm64
Message-ID:  <201912021557.xB2FvPXn001402@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Mon Dec  2 15:57:25 2019
New Revision: 355294
URL: https://svnweb.freebsd.org/changeset/base/355294

Log:
  MFC r354815:
  Let arm64 pmap_qenter() and pmap_kenter() unconditionally set NX.

Modified:
  stable/12/sys/arm64/arm64/pmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm64/arm64/pmap.c
==============================================================================
--- stable/12/sys/arm64/arm64/pmap.c	Mon Dec  2 15:56:01 2019	(r355293)
+++ stable/12/sys/arm64/arm64/pmap.c	Mon Dec  2 15:57:25 2019	(r355294)
@@ -1179,10 +1179,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;
-
+	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);
@@ -1297,9 +1295,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_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?201912021557.xB2FvPXn001402>