freebsd-dev/sys/i386
Mitchell Horne 681bd71047 minidump: reduce the amount direct accesses to page tables
During a live dump, we may race with updates to the kernel page tables.
This is generally okay; we accept that the state of the system while
dumping may be somewhat inconsistent with its state when the dump was
invoked. However, when walking the kernel page tables, it is important
that we load each PDE/PTE only once while operating on it. Otherwise, it
is possible to have the relevant PTE change underneath us. For example,
after checking the valid bit, but before reading the physical address.

Convert the loads to atomics, and add some validation around the
physical addresses, to ensure that we do not try to dump a non-existent
or non-canonical physical address.

Similarly, don't read kernel_vm_end more than once, on the off chance
that pmap_growkernel() is called between the two page table walks.

Reviewed by:	kib, markj
MFC after:	2 weeks
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D31990
2021-11-19 15:05:52 -04:00
..
acpica x86: duplicate acpi_wakeup.c per i386 and amd64 2021-09-14 00:23:14 +03:00
bios Add CFI start/end proc directives to arm64, i386, and ppc 2020-12-05 00:33:28 +00:00
conf Add a COMPAT_FREEBSD13 kernel option 2021-11-17 03:08:40 +01:00
i386 minidump: reduce the amount direct accesses to page tables 2021-11-19 15:05:52 -04:00
include minidump: Parameterize minidumpsys() 2021-11-19 15:05:52 -04:00
linux linux: mv sys/i386/linux/linux_ptrace{,_machdep}.c 2021-11-03 08:50:17 +00:00
pci i386: clean up empty lines in .c and .h files 2020-09-01 21:19:39 +00:00
Makefile Remove iBCS2, part2: general kernel 2018-12-19 21:57:58 +00:00