The starting point was the implementation at POWER9BSD. From there, I've removed all POWER9 specific code and added a few new methods in PPC64 MMU interface, to isolate platform specific code.
Currently, the new methods are implemented on pseries and PowerNV (D21643).
Details
To generate a minidump, the following steps can be used, on a GENERIC64 kernel:
sysctl debug.kdb.panic=1 db> dump
Reboot and after the system starts up the minidump should be available at /var/crash, provided that dumpdev was configured properly.
With a patched libkvm (D21555) it is then possible to translate addresses and read the dumped memory pages.
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 26740 Build 25093: arc lint + arc unit
Event Timeline
Only a trivial review so far.
sys/kern/kern_dump.c | ||
---|---|---|
295 | I don't think this is needed. minidumps don't work on powerpc64 anyway, so don't even bother with using the ELF fallback that does work on powerpc (more or less). Just call minidumpsys() as below, and make the check "#if !defined(powerpc) || defined(powerpc64)". | |
sys/powerpc/aim/mmu_oea64.c | ||
146 | I don't think this will work correctly. VM_MIN_KERNEL_ADDRESS is 0xe000000000000000UL, which fits the mask perfectly, so will be a false positive. |
sys/powerpc/aim/mmu_oea64.c | ||
---|---|---|
146 | You are right. That explains some missing pages in the dump :) |
- Added startkernel, endkernel to minidump header
This is needed in order to properly handle relocated kernels in libkvm.
Can you add a key/sentinel into the dump structure to say what pmap it's using? libkvm will need it for properly decoding addresses, and that differential will also need to be updated to use the key and select a backend.
- Add mmu_name field to minidump header
- Move dump_pmap_init() to moea64
- Refactor dump_pmap() to allow copy elision