amd64: for LA57, connect DMAP directly to PML5, currently reserving 32 slots amd64 pmap: for la57, copy whole kernel pml5 table to user pmap pm_pml5 table amd64: add kva_layout amd64 pmap: do not hardcode 512GB
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
This effectively allows to boot on >4Tb machines and use all memory, not clipping it at 4TB. I tried it on qemu with 8TB configured, the machine boot, but eventually qemu dies on my 64GB w/s due to OOM (really out of swap space).
The sysctl vm.vmtotal looks funny:
System wide totals computed every five seconds: (values in kilobytes) =============================================== Processes: (RUNQ: 1 Disk Wait: 0 Page Wait: 0 Sleep: 1) Virtual Memory: (Total: 4295023404K Active: 4295023404K) Real Memory: (Total: 6192K Active: 6192K) Shared Virtual Memory: (Total: 2704K Active: 2704K) Shared Real Memory: (Total: 2224K Active: 2224K) Free Memory: 8402748544K
and top memory usage line cannot display the free memory size.
One limit that is not yet in place but probably should be added, is to cup the memory by the max size of vm_page_array[] which is put into kpml4. (Previous variant of the paragraph stated that vm_page_array[] is indexed by ints but I retract that).
After this change is discussed, the next action would be to move the large map out of kernel pml4. When done, we can change the KVA layout for amd64 for real, allowing larger kmem if needed.
sys/amd64/amd64/pmap.c | ||
---|---|---|
484 | Right now it cannot. In la57 case, I copy kva_layout_la57 over kva_layout. I do not want to add an indirection through some pointer. I can make kva_layout_la48 and kva_layout_la57 const, and copy either one over real kva_layout, but I do not think it buys much. | |
sys/amd64/include/vmparam.h | ||
189 | VM_MIN/MAX_KERNEL_ADDRESS symbols are required by MI code, so I provide them. |
sys/amd64/amd64/pmap.c | ||
---|---|---|
497 | ||
506 | It would be nice to update the comment in vmparam.h which describes the kernel memory map, to define the layout for LA57 kernels. | |
4390 | It would be nice to initialize PTPs in a consistent style. I find loops easier to read there, as is done in pmap_pinit_pml4_pti(). | |
4949 | IMO it is more clearly written as a loop, like all of the other PMLtop initializations below. | |
sys/amd64/include/vmparam.h | ||
189 | I still find the old names clearer, if only because they're still there on other platforms, even if they are only used in MD code. But it is just a preference. |
sys/amd64/include/vmparam.h | ||
---|---|---|
189 | I tried to convince myself, but lets wait some time more for the decision. |
sys/amd64/include/vmparam.h | ||
---|---|---|
189 | I'm just curious as to why you switched from min and max to low and high. Admittedly, max has usually been a misnomer, because the ranges have not been inclusive of the max values. |
sys/amd64/include/vmparam.h | ||
---|---|---|
189 | I always imagine an address space as growing vertically and having the lowest addresses at bottom. This model leaked into the naming, I guess. |