diff options
author | Mark Johnston <markj@FreeBSD.org> | 2019-09-03 13:18:51 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2019-09-03 13:18:51 +0000 |
commit | 9d75f0dc75033e8d99c6d9f9328702f4aef27179 (patch) | |
tree | 0cc750f0e8e49196e0b55fa79768d2ee9dd3fd03 /sys/vm/vm_kern.c | |
parent | f5791174df305d2b1f2cf9486c0262b116ff1bbc (diff) | |
download | src-9d75f0dc75033e8d99c6d9f9328702f4aef27179.tar.gz src-9d75f0dc75033e8d99c6d9f9328702f4aef27179.zip |
Notes
Diffstat (limited to 'sys/vm/vm_kern.c')
-rw-r--r-- | sys/vm/vm_kern.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 324c9cce10f6..482ead0d1180 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -759,7 +759,7 @@ kmem_init(vm_offset_t start, vm_offset_t end) vm_map_lock(m); /* N.B.: cannot use kgdb to debug, starting with this assignment ... */ kernel_map = m; - (void) vm_map_insert(m, NULL, (vm_ooffset_t) 0, + (void)vm_map_insert(m, NULL, 0, #ifdef __amd64__ KERNBASE, #else @@ -767,6 +767,18 @@ kmem_init(vm_offset_t start, vm_offset_t end) #endif start, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT); /* ... and ending with the completion of the above `insert' */ + +#ifdef __amd64__ + /* + * Mark KVA used for the page array as allocated. Other platforms + * that handle vm_page_array allocation can simply adjust virtual_avail + * instead. + */ + (void)vm_map_insert(m, NULL, 0, (vm_offset_t)vm_page_array, + (vm_offset_t)vm_page_array + round_2mpage(vm_page_array_size * + sizeof(struct vm_page)), + VM_PROT_RW, VM_PROT_RW, MAP_NOFAULT); +#endif vm_map_unlock(m); /* |