o Implement shared pagetables and switch from 4 to 3 levels page
commit7b9e9617a5cb267994495b0d93211650800b9811
authorbr <br@FreeBSD.org>
Mon, 25 Apr 2016 14:47:51 +0000 (25 14:47 +0000)
committerbr <br@FreeBSD.org>
Mon, 25 Apr 2016 14:47:51 +0000 (25 14:47 +0000)
tree3446cf6cd89c0a18f34a24b846f77f2543f933d7
parent03e30c2263a33640cfa88601e15f6e41b3516d92
o Implement shared pagetables and switch from 4 to 3 levels page
memory system.

RISC-V ISA has only single page table base register for both kernel
and user addresses translation. Before this commit we were using an
extra (4th) level of pagetables for switching between kernel and user
pagetables, but then realized FPGA hardware has 3-level page system
hardcoded. It is also become clear that the bitfile synthesized for
4-level system is untested/broken, so we can't use extra level for
switching.

We are now share level 1 of pagetables between kernel and user VA.
This requires to keep track of all the user pmaps created and once we
adding L1 page to kernel pmap we have to add it to all the user pmaps.

o Change the VM layout as we must have topmost bit to be 1 in the
  selected page system for kernel addresses and 0 for user addresses.
o Implement pmap_kenter_device().
o Create the l3 tables for the early devmap.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
sys/riscv/include/pcpu.h
sys/riscv/include/pmap.h
sys/riscv/include/vmparam.h
sys/riscv/riscv/genassym.c
sys/riscv/riscv/locore.S
sys/riscv/riscv/machdep.c
sys/riscv/riscv/pmap.c
sys/riscv/riscv/swtch.S