freebsd-dev/sys/amd64/amd64
Alan Cox fd2dae0a30 Implement an alternative solution to the amd64 and i386 pmap problem that we
previously addressed in r348246.

This pmap problem also exists on arm64 and riscv.  However, the original
solution developed for amd64 and i386 cannot be used on arm64 and riscv.  In
particular, arm64 and riscv do not define a PG_PROMOTED flag in their level
2 PTEs.  (A PG_PROMOTED flag makes no sense on arm64, where unlike x86 or
riscv we are required to break the old 4KB mappings before making the 2MB
mapping; and on riscv there are no unused bits in the PTE to define a
PG_PROMOTED flag.)

This commit implements an alternative solution that can be used on all four
architectures.  Moreover, this solution has two other advantages.  First, on
older AMD processors that required the Erratum 383 workaround, it is less
costly.  Specifically, it avoids unnecessary calls to pmap_fill_ptp() on a
superpage demotion.  Second, it enables the elimination of some calls to
pagezero() in pmap_kernel_remove_{l2,pde}().

In addition, remove a related stale comment from pmap_enter_{l2,pde}().

Reviewed by:	kib, markj (an earlier version)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D20538
2019-06-09 03:36:10 +00:00
..
apic_vector.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
atpic_vector.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
bios.c sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
bpf_jit_machdep.c Make UMA and malloc(9) return non-executable memory in most cases. 2018-06-13 17:04:41 +00:00
bpf_jit_machdep.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
copyout.c Remove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros. 2019-05-16 22:20:54 +00:00
cpu_switch.S amd64: rewrite cpu_switch.S fragment to reload tss.rsp0 on context switch. 2019-03-16 11:12:02 +00:00
db_disasm.c sys: Replace zero with NULL for pointers. 2017-02-22 02:35:59 +00:00
db_interface.c x86: Report per-cpu IPI TLB shootdown generation in ddb 'show pcpu' output. 2019-01-04 17:25:47 +00:00
db_trace.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
efirt_machdep.c Catch exceptions during EFI RT calls on amd64. 2018-09-02 21:37:05 +00:00
efirt_support.S amd64 ef_rt_arch_call: Preserve %rflags around call into EFI RT service. 2019-06-03 15:32:42 +00:00
elf_machdep.c Remove sv_pagesize, originally introduced with r100384. 2019-03-01 16:16:38 +00:00
exception.S Mitigations for Microarchitectural Data Sampling. 2019-05-14 17:02:20 +00:00
fpu.c Remove lazy FPU switch support from amd64. 2019-06-08 16:03:34 +00:00
gdb_machdep.c Provide KPI for handling of rw/ro kernel text. 2018-03-20 17:43:50 +00:00
genassym.c amd64 ef_rt_arch_call: Preserve %rflags around call into EFI RT service. 2019-06-03 15:32:42 +00:00
in_cksum.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
initcpu.c Add a constant for the LS config MSR on AMD CPUs. 2019-05-23 23:37:11 +00:00
io.c sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
locore.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
machdep.c Make lock-less delayed invalidation operational very early. 2019-05-18 16:19:31 +00:00
mem.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
minidump_machdep.c Print the dump progress indicator after calling dump_start(). 2018-05-01 17:32:43 +00:00
mp_machdep.c x86: store pending bitmapped IPIs in per-cpu areas 2019-05-12 06:36:54 +00:00
mpboot.S x86: improve reservation of AP trampoline memory 2018-04-05 14:39:51 +00:00
pmap.c Implement an alternative solution to the amd64 and i386 pmap problem that we 2019-06-09 03:36:10 +00:00
prof_machdep.c Fix high resolution kernel profiling just enough to not crash at boot 2018-06-02 05:48:44 +00:00
ptrace_machdep.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
sigtramp.S Rename assym.s to assym.inc 2018-03-20 17:58:51 +00:00
support.S x86: spell vpxor %zmm0 as vpxord 2019-05-15 18:13:43 +00:00
sys_machdep.c Add kernel support for Intel userspace protection keys feature on 2019-02-20 09:51:13 +00:00
trap.c Make trap_msg array constant as well. 2019-06-08 19:50:57 +00:00
uio_machdep.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
uma_machdep.c Use vm_page_unwire_noq() instead of directly modifying page wire counts. 2018-02-08 19:28:51 +00:00
vm_machdep.c amd64 pmap: rework delayed invalidation, removing global mutex. 2019-05-16 13:28:48 +00:00
xen-locore.S xen: implement early init helper for PVHv2 2018-07-19 08:44:52 +00:00