AMD64 work

Matt Dillon commited a number of files for AMD64 support; it is far from complete at this point. These files come from Peter Wemm’s work on FreeBSD 5. However, he noted that the PMAP/MMU/VM support will be from scratch.

Quoted here is his comments on how that will be done:

“The DFly 64 bit AMD work will have a lot of similarities to the FreeBSD-5
work, but the PMAP/MMU/VM subsystem support is going to be written from
scratch and diverge wildly from F-5.

In particular, it is my intent to entirely do-away with %fs for per-cpu
storage references and instead use the top level PML4 page table (512GB
per entry, 256TB total VM) as a fixed per-cpu entity. Each cpu will get
its own PML4 table. Initially only one entry (512GB of VM) in PML4 will
be used to represent UVM. This is the entry that the thread switch code
changes out. Other entries will be used:

PML4 TABLE (each cpu gets its own table)

* 1 switched entry 512GB of UVM (expandable to more)

* 1 static entry 512GB of KVM

* 1 static entry to map physical memory

* 1 per-cpu entry to map the per-cpu globaldata space.

* Additional entries for recursive page tables, third party
process address space caches (userspaceuserspace copying),
and other features.

This should greatly simplify the PMAP code… no copies of the ‘high’ kernel
PDE entries, for example, and we still have the flexibility of switching out
the whole PML4 table at a later date without interfering with the basic
feature set.