HomeFreeBSD

minidump: Parameterize minidumpsys()

Description

minidump: Parameterize minidumpsys()

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

(cherry picked from commit 1adebe3cd6b1eb0973969e2c4c5d41f174caa304)

Details

Provenance
mhorneAuthored on Nov 17 2021, 3:26 PM
Reviewer
kib
Differential Revision
D31989: minidump: Parameterize minidumpsys()
Parents
R10:a6172e6353ee: amd64: provide PHYS_IN_DMAP() and VIRT_IN_DMAP()
Branches
Unknown
Tags
Unknown