summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/mem.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-05-23 05:04:54 +0000
committerpeter <peter@FreeBSD.org>2003-05-23 05:04:54 +0000
commiteea63ec45a461d952c1d8475e776a659c6d0da7f (patch)
tree42ee5a0610b13a0d25a11750527875816da85e00 /sys/amd64/amd64/mem.c
parent40b279d76093e6ddc4bcd1eecb07a90ccc00467c (diff)
downloadFreeBSD-src-eea63ec45a461d952c1d8475e776a659c6d0da7f.zip
FreeBSD-src-eea63ec45a461d952c1d8475e776a659c6d0da7f.tar.gz
Major pmap rework to take advantage of the larger address space on amd64
systems. Of note: - Implement a direct mapped region using 2MB pages. This eliminates the need for temporary mappings when getting ptes. This supports up to 512GB of physical memory for now. This should be enough for a while. - Implement a 4-tier page table system. Most of the infrastructure is there for 128TB of userland virtual address space, but only 512GB is presently enabled due to a mystery bug somewhere. The design of this was heavily inspired by the alpha pmap.c. - The kernel is moved into the negative address space(!). - The kernel has 2GB of KVM available. - Provide a uma memory allocator to use the direct map region to take advantage of the 2MB TLBs. - Fixed some assumptions in the bus_space macros about the ability to fit virtual addresses in an 'int'. Notable missing things: - pmap_growkernel() should be able to grow to 512GB of KVM by expanding downwards below kernbase. The kernel must be at the top 2GB of the negative address space because of gcc code generation strategies. - need to fix the >512GB user vm code. Approved by: re (blanket)
Diffstat (limited to 'sys/amd64/amd64/mem.c')
-rw-r--r--sys/amd64/amd64/mem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c
index 38a6e13..dd403f7 100644
--- a/sys/amd64/amd64/mem.c
+++ b/sys/amd64/amd64/mem.c
@@ -63,6 +63,7 @@
#include <machine/frame.h>
#include <machine/psl.h>
#include <machine/specialreg.h>
+#include <machine/vmparam.h>
#include <vm/vm.h>
#include <vm/pmap.h>
@@ -177,7 +178,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
addr = trunc_page(uio->uio_offset);
eaddr = round_page(uio->uio_offset + c);
- if (addr < (vm_offset_t)VADDR(0, 0, PTDPTDI, 0))
+ if (addr < (vm_offset_t)KERNBASE)
return (EFAULT);
for (; addr < eaddr; addr += PAGE_SIZE)
if (pmap_extract(kernel_pmap, addr) == 0)
OpenPOWER on IntegriCloud