Page MenuHomeFreeBSD

Fix makecontext() on MIPS O32.
ClosedPublic

Authored by jhb on Feb 2 2018, 10:51 PM.
Tags
None
Referenced Files
F173558758: D14179.id38891.diff
Sat, Sep 26, 8:32 PM
Unknown Object (File)
Sat, Sep 26, 4:09 AM
Unknown Object (File)
Thu, Sep 24, 3:03 PM
Unknown Object (File)
Thu, Sep 24, 6:55 AM
Unknown Object (File)
Wed, Sep 23, 5:02 AM
Unknown Object (File)
Sat, Sep 12, 4:01 AM
Unknown Object (File)
Thu, Sep 10, 4:25 PM
Unknown Object (File)
Tue, Sep 8, 12:09 PM
Subscribers

Details

Summary

The GP register can be clobbered by the callback, so save it in S1 while
invoking the callback function.

Test Plan
  • the various makecontext tests now pass on o32 instead of core dumping when trying to call ctx_done due to a trashed GP.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I take full blame, and acknowledge spending too much time in code with -G0, and thus being somewhat lazy about gp's treatment.

I'd say that because there are a bunch of different ABI semantics here, the comment could be modified to be more explicit about s1 being callee-saved in o32, while gp is callee-saved in n32 and n64, or something.

Thank you! It's good as-is, or with a comment which is more explicit about register saving responsibility.

This revision is now accepted and ready to land.Feb 3 2018, 1:11 AM
This revision was automatically updated to reflect the committed changes.