Page MenuHomeFreeBSD

[PPC64] Initial kernel minidump implementation
ClosedPublic

Authored by luporl on Sep 6 2019, 2:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 22, 11:57 AM
Unknown Object (File)
Jan 31 2024, 10:57 PM
Unknown Object (File)
Jan 14 2024, 3:51 PM
Unknown Object (File)
Dec 20 2023, 3:46 AM
Unknown Object (File)
Nov 19 2023, 11:53 AM
Unknown Object (File)
Nov 19 2023, 11:53 AM
Unknown Object (File)
Nov 19 2023, 11:53 AM
Unknown Object (File)
Nov 14 2023, 11:51 PM
Subscribers

Details

Summary

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).

Test Plan

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 26375
Build 24835: 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 :)

  • Address jhibbits comments and add missing UMA bits
  • 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

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.

Yes, the last diff adds that, along with a few other improvements.

luporl edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Oct 12 2019, 9:03 PM
This revision was automatically updated to reflect the committed changes.