Enforce the mapping of kernel loadable modules in the uppermost 2GB of the

kernel virtual address space on amd64.
This commit is contained in:
Alan Cox 2008-06-20 06:24:34 +00:00
parent 293ab7c941
commit ac68d1c960
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179887

View File

@ -664,6 +664,13 @@ link_elf_load_file(linker_class_t cls, const char *filename,
goto out;
}
ef->address = (caddr_t) vm_map_min(kernel_map);
/*
* In order to satisfy amd64's architectural requirements on the
* location of code and data in the kernel's address space, request a
* mapping that is above the kernel.
*/
mapbase = KERNBASE;
error = vm_map_find(kernel_map, ef->object, 0, &mapbase,
round_page(mapsize), TRUE, VM_PROT_ALL, VM_PROT_ALL, FALSE);
if (error) {