Discussion:
enabling kernel dump options in GENERIC
Conrad Meyer
2018-05-17 17:57:35 UTC
Permalink
Hi,
Over the past couple of years, a number of kernel dump features have
been added: encryption, compression and dumping to a remote host
(netdump). These features are currently all omitted from GENERIC.
I don't have anything substantive to add, but as someone who has
code-reviewed, written, and/or used a bunch of these features at
$DAYJOB, I'd love to see them built by default in GENERIC — even if
disabled by default (compression — the others don't have a sane
default configuration). I don't think GZIO is especially useful if we
enable ZSTDIO, but at the same time I think it's harmless to enable as
an option.

Thanks,
Conrad
Mark Millard via freebsd-arch
2018-05-18 03:58:16 UTC
Permalink
Mark Johnston markj at FreeBSD.org wrote on
Over the past couple of years, a number of kernel dump features have
been added: encryption, compression and dumping to a remote host
(netdump). These features are currently all omitted from GENERIC.
. . .
Therefore, I'd like to propose enabling these features by default
on i386, amd64, arm64, powerpc(64) and sparc64 so that they're available
out of the box in 12.0.
. . .
Bugzilla 214598 (from late 2016) was about
dump for TARGET_ARCH=powerpc64 builds getting
failures like:

KDB: enter: manual escape to debugger
[ thread pid 12 tid 10018 ]
Stopped at .kdb_enter+0x70: ori r0, r0, 0x0
db> dump
Dumping 9 MB (3 chunks)
chunk 0: 10MB (2510 pages) ... ok
chunk 1: 1MB (24 pages) ... ok
chunk 2: 1MB (2 pages)panic: vm_fault: fault on nofault entry, addr: c000000000022000

(A 32-bit powerpc build on the same machine worked
fine for dumping.)

I just tried it with head -r333594 and I got something
similar. (Old and new mention routines with _bus_dma_map_
in the names near the trap in the call stack. I've not
done a detailed comparison.)

So, at least for the old PowerMac G5 so-called "Quad
Core" powerpc64 context that was in use, there may be
problems putting the changes to use --or in any use
of dump.

As for config for the kernel configuration involved:

# more /usr/src/sys/powerpc/conf/GENERIC64vtsc-NODBG
#
# GENERIC -- Custom configuration for the powerpc/powerpc64
#

include "GENERIC64"

ident GENERIC64vtsc-NODBG

makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols

nooptions PS3 # Sony Playstation 3 HACK!!! to allow sc

options KDB # Enable kernel debugger support

options ALT_BREAK_TO_DEBUGGER
options BREAK_TO_DEBUGGER

# For minimum debugger support (stable branch) use:
options KDB_TRACE # Print a stack trace for a panic
options DDB # Enable the kernel debugger
options GDB # HACK!!! ...

# Extra stuff:
#options VERBOSE_SYSINIT # Enable verbose sysinit messages
#options BOOTVERBOSE=1
#options BOOTHOWTO=RB_VERBOSE
#options KTR
#options KTR_MASK=KTR_TRAP
##options KTR_CPUMASK=0xF
#options KTR_VERBOSE

# HACK!!! to allow sc for 2560x1440 display on Radeon X1950 that vt historically mishandled during booting
device sc
#device kbdmux # HACK: already listed by vt
options SC_OFWFB # OFW frame buffer
options SC_DFLT_FONT # compile font in
makeoptions SC_DFLT_FONT=cp437


# Disable any extra checking for. . .
nooptions DEADLKRES # Enable the deadlock resolver
nooptions INVARIANTS # Enable calls of extra sanity checking
nooptions INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS
nooptions WITNESS # Enable checks to detect deadlocks and cycles
nooptions WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
nooptions DIAGNOSTIC
nooptions MALLOC_DEBUG_MAXZONES # Separate malloc(9) zones

device filemon
device geom_label

===
Mark Millard
marklmi26-fbsd at yahoo.com
( dsl-only.net went
away in early 2018-Mar)
Mark Millard via freebsd-arch
2018-05-19 01:14:12 UTC
Permalink
Post by Mark Millard via freebsd-arch
. . .
Bugzilla 214598 (from late 2016) was about
dump for TARGET_ARCH=powerpc64 builds getting
KDB: enter: manual escape to debugger
[ thread pid 12 tid 10018 ]
Stopped at .kdb_enter+0x70: ori r0, r0, 0x0
db> dump
Dumping 9 MB (3 chunks)
chunk 0: 10MB (2510 pages) ... ok
chunk 1: 1MB (24 pages) ... ok
chunk 2: 1MB (2 pages)panic: vm_fault: fault on nofault entry, addr: c000000000022000
(A 32-bit powerpc build on the same machine worked
fine for dumping.)
I just tried it with head -r333594 and I got something
similar. (Old and new mention routines with _bus_dma_map_
in the names near the trap in the call stack. I've not
done a detailed comparison.)
What is the call stack?
I'll have to induce the failure, take a picture of
the screen that results, and hand type in the
material for the fairly modern backtrace (-r333594).
I will not be able to do this until later today.
The bugzilla report has the old backtrace. I did not
quote all the material from that report in the above.
So there is something to compare against once I
supply a modern one.
My apologies, I missed the fact that the backtrace was included in that
PR. Since the problem still occurs and apparently manifests with a
similar backtrace, it wouldn't be useful to retest. I'm afraid I don't
have any suggestions on how to make progress here. Given that the new
options give only a small increase in the kernel size, I'm still
inclined to enable them on powerpc64 for consistency with other
architectures.
Seems reasonable. May be there are other powerpc64 contexts
that can test the updates.

Useful or not, I've updated bugzilla 214598 with a backtrace
from head -r333594 and have updated its one-line summary to
reference -r333594 .

Looks like I missed a 0 in:

0xe7ced0: at 0xc00000006ab17fc

it should be:

0xe7ced0: at 0xc000000006ab17fc

I've no clue why this address has no symbol.

I showed more of the stack this time.

At least now the old and new can be compared. That
is better than forcing folks to rely on my earlier
quick look.
Also: in about a week I'll lose access to the PowerMacs
for an unknown period of time (weeks? months?).
===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)

Mark Johnston
2018-05-17 18:09:27 UTC
Permalink
Post by Conrad Meyer
Hi,
Over the past couple of years, a number of kernel dump features have
been added: encryption, compression and dumping to a remote host
(netdump). These features are currently all omitted from GENERIC.
I don't have anything substantive to add, but as someone who has
code-reviewed, written, and/or used a bunch of these features at
$DAYJOB, I'd love to see them built by default in GENERIC — even if
disabled by default (compression — the others don't have a sane
default configuration). I don't think GZIO is especially useful if we
enable ZSTDIO, but at the same time I think it's harmless to enable as
an option.
Yeah, given that the size increase is very small, I didn't see a reason
to specifically exclude GZIO. I can also imagine a scenario where one
uses GZIO+netdump to send dumps to a host lacking zstd(1).
Loading...