Page MenuHomeFreeBSD

trap_cfi(9): introduce powerpc implemenation
Needs ReviewPublic

Authored by mchoo on Sun, Sep 13, 6:19 PM.
Tags
None
Referenced Files
F173038826: D59651.id.diff
Wed, Sep 23, 2:13 AM
F172970068: D59651.id186621.diff
Tue, Sep 22, 12:40 PM
F172967082: D59651.id186807.diff
Tue, Sep 22, 12:02 PM
Unknown Object (File)
Tue, Sep 22, 5:08 AM
Unknown Object (File)
Tue, Sep 22, 5:06 AM
Unknown Object (File)
Tue, Sep 22, 12:30 AM
Unknown Object (File)
Mon, Sep 21, 10:50 PM
Unknown Object (File)
Mon, Sep 21, 10:15 PM
Subscribers

Details

Reviewers
jhb
jhibbits
adrian
Group Reviewers
PowerPC
Summary

MFC after: 2 weeks
MFC to: stable/14, stable/15
Sponsored by: FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
No Test Coverage
Build Status
Buildable 76942
Build 73825: arc lint + arc unit

Event Timeline

mchoo requested review of this revision.Sun, Sep 13, 6:19 PM

ooo whats this do!

Early in this year, I created a PR on lldb side that does trapframe unwinding similar to what KGDB does, but one contributors from Apple was against it. Instead, he suggested using CFI directives for unwinding special frames which is what Apple folks do for debugging Darwin. I thought it was a good idea because a) no major changes needed on LLDB side and b) this is more "standard" (DWARF) way of debugging across call frames.

I've tested trapframe unwinding on amd64 with fully CFI-patched kernel and lldb. It gives equivalent result to KGDB for backtrace and more accurate result for inspecting registers as KGDB displays some amd64 GPRs with values from earlier frames instead of marking them unavailable. I haven't tested the fully CFI-patched kernel for other architectures, but this revision only introduces necessary helpers and doesn't add anything to the kernel binary, so I think it's fine. If you want to see the full series of patches, see here. I'll upstream these once I finish all the tests (currently CFI looks fine on ELF inspection, but I need to run the kernels)

  • trap_cfi(9): add assembly interface for powerpc
  • trap_cfi(9): add exception handler CFI for powerpc

I could not open HPT mmu minidump through libkvm, so this hasn't been tested yet similar to armv7 (D59650)

mchoo retitled this revision from trap_cfi(9): add assembly interface for powerpc to trap_cfi(9): introduce powerpc implemenation.Tue, Sep 15, 5:37 PM

I could not open HPT mmu minidump through libkvm, so this hasn't been tested yet similar to armv7 (D59650)

Applying D59719 lets me extract and debug ppc64le dumps. I can confirm frame unwinding works. Ready for review.