Page MenuHomeFreeBSD

Don't include T_USER in si_trapno reported to userland.
ClosedPublic

Authored by jhb on Jul 22 2020, 4:28 PM.
Tags
None
Referenced Files
F166498398: D25769.id74795.diff
Thu, Aug 13, 8:38 PM
F166485756: D25769.id75007.diff
Thu, Aug 13, 7:54 PM
Unknown Object (File)
Wed, Aug 12, 6:48 AM
Unknown Object (File)
Tue, Aug 11, 5:13 PM
Unknown Object (File)
Mon, Aug 10, 7:43 PM
Unknown Object (File)
Sun, Aug 9, 12:06 PM
Unknown Object (File)
Sun, Aug 9, 9:22 AM
Unknown Object (File)
Sat, Aug 8, 6:56 PM
Subscribers

Details

Summary

Signals are only reported for user traps, so T_USER is redundant. It
is also a software convention and not included in the value reported
by the hardware.

Test Plan
  • some tests in CheriBSD test the value of si_trapno for some tests and I updated them to remove T_USER after this change

Diff Detail

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

Event Timeline

jhb requested review of this revision.Jul 22 2020, 4:28 PM
jhb created this revision.

Is usermode variable in mips/trap.c::trap() redundant ?

This revision is now accepted and ready to land.Jul 23 2020, 10:28 PM
In D25769#571137, @kib wrote:

Is usermode variable in mips/trap.c::trap() redundant ?

Yes, but I think it's more readable. If anything, I would be tempted to remove all the T_USER stuff and instead add a few more if (usermode) checks in the bodies of some of the cases. I'm not super motivated to rewrite all that though.