10fe6f80 mhorne Nov. 19, 2021, 7:05 p.m.
When constructing the set of dumpable pages, use the bitset provided by
the state argument, rather than assuming vm_page_dump invariably. For
normal kernel minidumps this will be a pointer to vm_page_dump, but when
dumping the live system it will not.

To do this, the functions in vm_dumpset.h are extended to accept the
desired bitset as an argument. Note that this provided bitset is assumed
to be derived from vm_page_dump, and therefore has the same size.

Reviewed by:	kib, markj, jhb
MFC after:	2 weeks
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D31992
cgit
1d2d1418 mhorne Nov. 19, 2021, 7:05 p.m.
Don't assume we are dumping the global message buffer, but use the one
provided by the state argument. While here, drop superfluous
cast to char *.

Reviewed by:	markj, jhb
MFC after:	2 weeks
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D31991
cgit
681bd710 mhorne Nov. 19, 2021, 7:05 p.m.
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
cgit
90d4da62 mhorne Nov. 19, 2021, 7:05 p.m.
It is useful for quickly checking an address against the DMAP region.
These definitions exist already on arm64 and riscv.

Reviewed by:	kib, markj
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D32962
cgit
1adebe3c mhorne Nov. 19, 2021, 7:05 p.m.
The minidump code is written assuming that certain global state will not
change, and rightly so, since it executes from a kernel debugger
context. In order to support taking minidumps of a live system, we
should allow copies of relevant global state that is likely to change to
be passed as parameters to the minidumpsys() function.

This patch does the work of parameterizing this function, by adding a
struct minidumpstate argument. For now, this struct allows for copies of
the kernel message buffer, and the bitset that tracks which pages should
be dumped (vm_page_dump). Follow-up changes will actually make use of
these arguments.

Notably, dump_avail[] does not need a snapshot, since it is not expected
to change after system initialization.

The existing minidumpsys() definitions are renamed, and a thin MI
wrapper is added to kern_dump.c, which handles the construction of
the state struct. Thus, calling minidumpsys() remains as simple as
before.

Reviewed by:	kib, markj, jhb
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D31989
cgit
840d7237 gbe Nov. 19, 2021, 7:04 p.m.
-s /debuging/debugging/

MFC after:	3 days
cgit
d7125850 gbe Nov. 19, 2021, 6:59 p.m.
MFC after:	3 days
cgit
8acb6621 gbe Nov. 19, 2021, 6:51 p.m.
- s/availabe/available/

MFC after:	3 days
cgit
3e5ddef0 gbe Nov. 19, 2021, 6:50 p.m.
- s/unavailabe/unavailable/

MFC after:	3 days
cgit
5e21882b gbe Nov. 19, 2021, 6:29 p.m.
- s/conditon/condition/

MFC after:	3 days
cgit
8b11850f gbe Nov. 19, 2021, 6:26 p.m.
- s/maxium/maximum/

MFC after:	3 days
cgit
975e2e3f gbe Nov. 19, 2021, 6:19 p.m.
- s/quering/querying/

Obtained from:	NetBSD
MFC after:	3 days
cgit
bebff615 gbe Nov. 19, 2021, 6:17 p.m.
- s/conditonally/conditionally/

MFC after:	3 days
cgit
b4fbc855 gbe Nov. 19, 2021, 6:16 p.m.
- s/conditons/conditions/

MFC after:	3 days
cgit
15b5c347 gbe Nov. 19, 2021, 6:13 p.m.
- s/conditons/conditions/
- s/unconditonally/unconditionally/

MFC after:	3 days
cgit