From b0c139d336da1660f9ab33e7d3869145a27e26a3 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 28 Jul 2008 04:59:48 +0000 Subject: [PATCH] Don't allow pmap_change_attr() to be applied to the recursive mapping. --- sys/amd64/amd64/pmap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index c8a750297c8..c72f5d3882b 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); /* -- 2.45.2