diff options
author | marius <marius@FreeBSD.org> | 2017-08-04 21:38:34 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2017-08-04 21:38:34 +0000 |
commit | 906a0c765e9a80cec9fae228e40859198da23424 (patch) | |
tree | 561b6f6185ade86240a3bc311dfcde56cbac8721 /sys/amd64 | |
parent | 02a4f810afa44404d8a65015018128ef0ef9acce (diff) | |
download | FreeBSD-src-906a0c765e9a80cec9fae228e40859198da23424.zip FreeBSD-src-906a0c765e9a80cec9fae228e40859198da23424.tar.gz |
MFC: r290156, r318354
pmap_change_attr: Only fixup DMAP for DMAPed ranges
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index d8522c3..834a53b 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -6559,7 +6559,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode) */ for (tmpva = base; tmpva < base + size; ) { pdpe = pmap_pdpe(kernel_pmap, tmpva); - if (*pdpe == 0) + if (pdpe == NULL || *pdpe == 0) return (EINVAL); if (*pdpe & PG_PS) { /* @@ -6632,7 +6632,8 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode) X86_PG_PDE_CACHE); changed = TRUE; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { + if (tmpva >= VM_MIN_KERNEL_ADDRESS && + (*pdpe & PG_PS_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pdpe & PG_PS_FRAME; @@ -6661,7 +6662,8 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode) X86_PG_PDE_CACHE); changed = TRUE; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { + if (tmpva >= VM_MIN_KERNEL_ADDRESS && + (*pde & PG_PS_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pde & PG_PS_FRAME; @@ -6688,7 +6690,8 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode) X86_PG_PTE_CACHE); changed = TRUE; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { + if (tmpva >= VM_MIN_KERNEL_ADDRESS && + (*pte & PG_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pte & PG_FRAME; |