OpenBSD/src Ytmiv8zsys/arch/amd64/amd64 vector.S pmap.c, sys/arch/amd64/conf ld.script

   Meltdown: implement user/kernel page table separation.

   On Intel CPUs which speculate past user/supervisor page permission checks,
   use a separate page table for userspace with only the minimum of kernel code
   and data required for the transitions to/from the kernel (still marked as
   supervisor-only, of course):
    - the IDT (RO)
    - three pages of kernel text in the .kutext section for interrupt, trap,
      and syscall trampoline code (RX)
    - one page of kernel data in the .kudata section for TLB flush IPIs (RW)
    - the lapic page (RW, uncachable)
    - per CPU: one page for the TSS+GDT (RO) and one page for trampoline
      stacks (RW)

   When a syscall, trap, or interrupt takes a CPU from userspace to kernel the
   trampoline code switches page tables, switches stacks to the thread's real
   kernel stack, then copies over the necessary bits from the trampoline stack.
   On return to userspace the opposite occurs: recreate the iretq frame on the
   trampoline stack, switch stack, switch page tables, and return to userspace.

   mlarkin@ implemented the pmap bits and did 90% of the debugging, diagnosing
     issues on MP in particular, and drove the final push to completion.
   Many rounds of testing by naddy@, sthen@, and others
   Thanks to Alex Wilson from Joyent for early discussions about trampolines
     and their data requirements.
   Per-CPU page layout mostly inspired by DragonFlyBSD.

   ok mlarkin@ deraadt@
VersionDeltaFile
1.52+172-65sys/arch/amd64/amd64/vector.S
1.109+215-15sys/arch/amd64/amd64/pmap.c
1.94+164-26sys/arch/amd64/amd64/locore.S
1.239+76-19sys/arch/amd64/amd64/machdep.c
1.112+78-5sys/arch/amd64/amd64/cpu.c
1.12+50-26sys/arch/amd64/include/frameasm.h
1.1+66-0sys/arch/amd64/include/cpu_full.h
1.7+34-13sys/arch/amd64/amd64/locore0.S
1.64+19-13sys/arch/amd64/amd64/trap.c
1.26+1-28sys/arch/amd64/amd64/gdt.c
1.119+22-7sys/arch/amd64/include/cpu.h
1.50+21-1sys/arch/amd64/amd64/lapic.c
1.9+21-1sys/arch/amd64/conf/ld.script
1.9+12-7sys/arch/amd64/include/asm.h
1.64+15-3sys/arch/amd64/include/pmap.h
1.34+16-1sys/arch/amd64/amd64/genassym.cf
1.7+15-1sys/arch/amd64/include/frame.h
1.12+8-4sys/arch/amd64/amd64/spl.S
1.95+6-1sys/arch/amd64/amd64/identcpu.c
1.24+4-1sys/arch/amd64/include/cpufunc.h
1.68+4-1sys/arch/amd64/include/specialreg.h
1.6+1-2sys/arch/amd64/include/gdt.h
+1,020-24022 files

UnifiedSplitRaw