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
This commit is contained in:
Andrew Turner 2017-04-13 16:57:02 +00:00
parent 8439a7220d
commit 71cb533e98
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=316769
2 changed files with 2 additions and 2 deletions

View File

@ -2728,7 +2728,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
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);

View File

@ -184,7 +184,7 @@ data_abort(struct trapframe *frame, uint64_t esr, uint64_t far, int lower)
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;