Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Apr 2017 16:57:02 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r316769 - head/sys/arm64/arm64
Message-ID:  <201704131657.v3DGv2mB033394@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Thu Apr 13 16:57:02 2017
New Revision: 316769
URL: https://svnweb.freebsd.org/changeset/base/316769

Log:
  Rather than checking if the top bit in a virtual address is a 0 or 1
  compare against VM_MAXUSER_ADDRESS as we should have been doing.
  
  Sponsored by:	DARPA, AFRL

Modified:
  head/sys/arm64/arm64/pmap.c
  head/sys/arm64/arm64/trap.c

Modified: head/sys/arm64/arm64/pmap.c
==============================================================================
--- head/sys/arm64/arm64/pmap.c	Thu Apr 13 15:52:45 2017	(r316768)
+++ head/sys/arm64/arm64/pmap.c	Thu Apr 13 16:57:02 2017	(r316769)
@@ -2728,7 +2728,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, 
 		new_l3 |= ATTR_XN;
 	if ((flags & PMAP_ENTER_WIRED) != 0)
 		new_l3 |= ATTR_SW_WIRED;
-	if ((va >> 63) == 0)
+	if (va < VM_MAXUSER_ADDRESS)
 		new_l3 |= ATTR_AP(ATTR_AP_USER) | ATTR_PXN;
 
 	CTR2(KTR_PMAP, "pmap_enter: %.16lx -> %.16lx", va, pa);

Modified: head/sys/arm64/arm64/trap.c
==============================================================================
--- head/sys/arm64/arm64/trap.c	Thu Apr 13 15:52:45 2017	(r316768)
+++ head/sys/arm64/arm64/trap.c	Thu Apr 13 16:57:02 2017	(r316769)
@@ -184,7 +184,7 @@ data_abort(struct trapframe *frame, uint
 		map = &p->p_vmspace->vm_map;
 	else {
 		/* The top bit tells us which range to use */
-		if ((far >> 63) == 1) {
+		if (far >= VM_MAXUSER_ADDRESS) {
 			map = kernel_map;
 		} else {
 			map = &p->p_vmspace->vm_map;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704131657.v3DGv2mB033394>