mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Make preparations for increasing the size of the kernel virtual
address space on the amd64 architecture. The amd64 architecture requires kernel code and global variables to reside in the highest 2GB of the 64-bit virtual address space. Thus, KERNBASE cannot change. However, KERNBASE is sometimes used as the start of the kernel virtual address space. Henceforth, VM_MIN_KERNEL_ADDRESS should be used instead. Since KERNBASE and VM_MIN_KERNEL_ADDRESS are still the same address, there should be no visible effect from this change (yet).
This commit is contained in:
parent
f2dc0faad0
commit
293ab7c941
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179886
@ -119,7 +119,7 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
|
||||
addr = trunc_page(v);
|
||||
eaddr = round_page(v + c);
|
||||
|
||||
if (addr < (vm_offset_t)KERNBASE)
|
||||
if (addr < VM_MIN_KERNEL_ADDRESS)
|
||||
return (EFAULT);
|
||||
for (; addr < eaddr; addr += PAGE_SIZE)
|
||||
if (pmap_extract(kernel_pmap, addr) == 0)
|
||||
|
@ -1673,7 +1673,7 @@ pmap_release(pmap_t pmap)
|
||||
static int
|
||||
kvm_size(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
unsigned long ksize = VM_MAX_KERNEL_ADDRESS - KERNBASE;
|
||||
unsigned long ksize = VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS;
|
||||
|
||||
return sysctl_handle_long(oidp, &ksize, 0, req);
|
||||
}
|
||||
@ -1703,7 +1703,7 @@ pmap_growkernel(vm_offset_t addr)
|
||||
|
||||
mtx_assert(&kernel_map->system_mtx, MA_OWNED);
|
||||
if (kernel_vm_end == 0) {
|
||||
kernel_vm_end = KERNBASE;
|
||||
kernel_vm_end = VM_MIN_KERNEL_ADDRESS;
|
||||
nkpt = 0;
|
||||
while ((*pmap_pde(kernel_pmap, kernel_vm_end) & PG_V) != 0) {
|
||||
kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
|
||||
|
@ -605,7 +605,7 @@ trap_pfault(frame, usermode)
|
||||
vm_offset_t eva = frame->tf_addr;
|
||||
|
||||
va = trunc_page(eva);
|
||||
if (va >= KERNBASE) {
|
||||
if (va >= VM_MIN_KERNEL_ADDRESS) {
|
||||
/*
|
||||
* Don't allow user-mode faults in kernel address space.
|
||||
*/
|
||||
|
@ -74,8 +74,8 @@ struct pmc;
|
||||
|
||||
#define PMC_IN_KERNEL_STACK(S,START,END) \
|
||||
((S) >= (START) && (S) < (END))
|
||||
#define PMC_IN_KERNEL(va) (((va) >= DMAP_MIN_ADDRESS && \
|
||||
(va) < DMAP_MAX_ADDRESS) || ((va) >= KERNBASE && \
|
||||
#define PMC_IN_KERNEL(va) (((va) >= DMAP_MIN_ADDRESS && \
|
||||
(va) < DMAP_MAX_ADDRESS) || ((va) >= VM_MIN_KERNEL_ADDRESS && \
|
||||
(va) < VM_MAX_KERNEL_ADDRESS))
|
||||
|
||||
#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS)
|
||||
|
@ -33,7 +33,7 @@
|
||||
* Stack trace.
|
||||
*/
|
||||
#define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \
|
||||
|| ((va) >= KERNBASE && (va) < VM_MAX_KERNEL_ADDRESS))
|
||||
|| ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS))
|
||||
|
||||
struct amd64_frame {
|
||||
struct amd64_frame *f_frame;
|
||||
|
Loading…
Reference in New Issue
Block a user