Page MenuHomeFreeBSD

trap_cfi(9): introduce riscv implementation
Needs ReviewPublic

Authored by mchoo on Sun, Sep 13, 6:19 PM.
Tags
None
Referenced Files
F172856161: D59647.diff
Mon, Sep 21, 3:18 PM
F172855522: D59647.id186617.diff
Mon, Sep 21, 3:12 PM
F172855257: D59647.id186632.diff
Mon, Sep 21, 3:09 PM
F172855229: D59647.id186800.diff
Mon, Sep 21, 3:09 PM
F172855199: D59647.id186800.diff
Mon, Sep 21, 3:09 PM
F172855098: D59647.id186796.diff
Mon, Sep 21, 3:08 PM
F172854836: D59647.id186790.diff
Mon, Sep 21, 3:04 PM
F172854670: D59647.diff
Mon, Sep 21, 3:02 PM

Details

Reviewers
jhb
Group Reviewers
riscv
Summary

This adds trapframe unwinding support through dwarf cfi. It has been tested under lldb.

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 76864
Build 73747: arc lint + arc unit

Event Timeline

mchoo requested review of this revision.Sun, Sep 13, 6:19 PM
mchoo retitled this revision from trap_cfi(9): add assembly interface for riscv to trap_cfi(9): introduce riscv implementation.Tue, Sep 15, 5:33 PM
mchoo edited the summary of this revision. (Show Details)

Is this necessary? Do you not want LLDB to print trapframes as special, like KGDB does, and like GDB does for signal frames?

sys/riscv/include/asm.h
48–50

This seems wrong

Is this necessary? Do you not want LLDB to print trapframes as special, like KGDB does, and like GDB does for signal frames?

An lldb dev working on Darwin's kernel frame unwinding was against porting kgdb's sniffer method to lldb. Instead, he recommended using CFI.

CFI can mark itself as signal frame using .cfi_signal_frame as I wrote in trap_cfi_entry in trap_cfi.h

sys/riscv/include/asm.h
48–50

I didn't want to include .cfi_startproc and .cfi_endproc in ENTRY() and END() but in trap_cfi macros. The only cfi usage I found in riscv was rtld_start, so it is possible to remove .cfi_startproc and endproc from ENTRY() and END() without much refactoring. arm64 is not the case because it has a special security instruction that must be come after cfi_startproc and refactoring them will require too much change.

sys/riscv/include/asm.h
48–50

Let me rephrase: please don't do this. ENTRY and END should have all the boilerplate for a normal function, which they now do not.

Restore ENTRY() and END() changes