freebsd-skq/sys/dev/hyperv/vmbus
kib e3089a0318 i386 4/4G split.
The change makes the user and kernel address spaces on i386
independent, giving each almost the full 4G of usable virtual addresses
except for one PDE at top used for trampoline and per-CPU trampoline
stacks, and system structures that must be always mapped, namely IDT,
GDT, common TSS and LDT, and process-private TSS and LDT if allocated.

By using 1:1 mapping for the kernel text and data, it appeared
possible to eliminate assembler part of the locore.S which bootstraps
initial page table and KPTmap.  The code is rewritten in C and moved
into the pmap_cold(). The comment in vmparam.h explains the KVA
layout.

There is no PCID mechanism available in protected mode, so each
kernel/user switch forth and back completely flushes the TLB, except
for the trampoline PTD region. The TLB invalidations for userspace
becomes trivial, because IPI handlers switch page tables. On the other
hand, context switches no longer need to reload %cr3.

copyout(9) was rewritten to use vm_fault_quick_hold().  An issue for
new copyout(9) is compatibility with wiring user buffers around sysctl
handlers. This explains two kind of locks for copyout ptes and
accounting of the vslock() calls.  The vm_fault_quick_hold() AKA slow
path, is only tried after the 'fast path' failed, which temporary
changes mapping to the userspace and copies the data to/from small
per-cpu buffer in the trampoline.  If a page fault occurs during the
copy, it is short-circuit by exception.s to not even reach C code.

The change was motivated by the need to implement the Meltdown
mitigation, but instead of KPTI the full split is done.  The i386
architecture already shows the sizing problems, in particular, it is
impossible to link clang and lld with debugging.  I expect that the
issues due to the virtual address space limits would only exaggerate
and the split gives more liveness to the platform.

Tested by: pho
Discussed with:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D14633
2018-04-13 20:30:49 +00:00
..
amd64 Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
i386 i386 4/4G split. 2018-04-13 20:30:49 +00:00
hyperv_busdma.c
hyperv_machdep.h
hyperv_reg.h hyperv: Allow userland to ro-mmap reference TSC page 2016-12-15 03:32:24 +00:00
hyperv_var.h hyperv/timesync: Support "sent TC" to improve accuracy. 2016-12-08 05:37:39 +00:00
hyperv.c Correct comment typo in Hyper-V 2018-03-30 02:25:12 +00:00
vmbus_br.c hyperv/vmbus: Add __FBSDID 2016-10-14 05:47:59 +00:00
vmbus_brvar.h hyperv/vmbus: Add functions to test RX/TX bufring emptiness 2016-09-28 04:08:20 +00:00
vmbus_chan.c hyperv/vmbus: Nuke unnecessary critical sections. 2016-12-28 03:07:58 +00:00
vmbus_chanvar.h hyperv/vmbus: Add channel polling support. 2016-12-12 05:04:55 +00:00
vmbus_et.c hyperv: Update copyright for the files changed in 2017 2017-08-14 06:00:50 +00:00
vmbus_if.m hyperv/vmbus: Add DEVMETHOD to map cpu to event taskq. 2016-11-30 07:45:05 +00:00
vmbus_reg.h hyperv/vmbus: Stringent header length and total length check. 2016-09-05 03:21:31 +00:00
vmbus_res.c hyperv/vmbus: Reorganize vmbus device tree 2017-05-10 05:28:14 +00:00
vmbus_var.h hyperv/vmbus: Nuke unnecessary critical sections. 2016-12-28 03:07:58 +00:00
vmbus_xact.c hyperv/vmbus: Add result polling support for xact API. 2016-11-28 07:27:08 +00:00
vmbus.c PTI for amd64. 2018-01-17 11:44:21 +00:00