diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index c8a750297c8f..c72f5d3882bb 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4365,8 +4365,11 @@ pmap_change_attr(vm_offset_t va, vm_size_t size, int mode) offset = va & PAGE_MASK; size = roundup(offset + size, PAGE_SIZE); - /* Only supported on kernel virtual addresses. */ - if (base <= VM_MAXUSER_ADDRESS) + /* + * Only supported on kernel virtual addresses, including the direct + * map but excluding the recursive map. + */ + if (base < DMAP_MIN_ADDRESS) return (EINVAL); /*