Page MenuHomeFreeBSD

riscv: Preserve savectx return address with vector support
ClosedPublic

Authored by mchoo on Tue, Sep 15, 1:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 9, 4:30 AM
Unknown Object (File)
Fri, Oct 9, 2:58 AM
Unknown Object (File)
Thu, Oct 8, 11:42 PM
Unknown Object (File)
Wed, Oct 7, 9:52 AM
Unknown Object (File)
Tue, Oct 6, 7:36 PM
Unknown Object (File)
Tue, Oct 6, 4:07 PM
Unknown Object (File)
Tue, Oct 6, 3:44 PM
Unknown Object (File)
Mon, Oct 5, 1:03 PM
Subscribers

Details

Summary

Calling vector_state_store_savectx() overwrites ra with the address of
the following ret instruction. The ret consequently branches to itself
and prevents kernel dumps from progressing past dump_savectx().

Tail-call vector_state_store_savectx() so that it returns directly to
the original savectx() caller.

Fixes: d7a393095cfd ("riscv: Vector Extension (RVV) support.")
Sponsored by: FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mchoo requested review of this revision.Tue, Sep 15, 1:37 AM
This revision is now accepted and ready to land.Tue, Sep 15, 6:40 AM

ping @jhb for mentor approval

I know John well enough (and work with him) to state that my approval here is sufficient for you to land it, and if you want an Approved by: you can put me there