Support for new panic format
cbiffle opened this issue · 0 comments
The humility host
command needs to add support for the new panic format implemented in the Helios kernel. I was hoping to do this before I leave for vacation but it's not looking likely -- so let's get everything I know written down!
Current panic format
The current panic format is fixed-size block emitted by the kernel when things are dire. It uses a fixed COBOL-style record format with NUL-padded strings. This works well enough, but wastes a lot of space -- 88.2% of the last panic I inspected was NULs.
The fixed-size records means it only has space for 16 stack frames, which is not really a lot of stack frames in a complex kernel.
New panic format
The new panic format uses variable-length packets that are concatenated, to opportunistically try to fit more data in.
The C implementation: https://github.com/oxidecomputer/illumos-gate/blob/stlouis/usr/src/uts/oxide/sys/kernel_ipcc.h#L71-L136
Andy's Rust decoder ring: https://gist.github.com/citrus-it/c5aceaed7117226ae3cf4e8302e93da3
Because the format is versioned (first byte) Humility will need to key off that byte and switch the logic to the fancier format. The code Andy used there is probably sufficient, tbh -- the binrw
crate he's using is new to me, but should work once the buffer's read into host RAM.