Page MenuHomeFreeBSD

Move td_sigqueue to the end of struct thread
ClosedPublic

Authored by badger on Apr 26 2017, 9:06 PM.

Details

Summary

In order to preserve KBI in stable branches, replace the existing
td_sigqueue slot with padding and move the expanded (as of r315949)
td_sigqueue to the end of the struct.

Test Plan

I checked the offset of td_lend_user_pri (the first member after
the original td_sigqueue) in struct proc on a couple of architectures and
ensured that it was the same as it was before r315949.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

badger created this revision.Apr 26 2017, 9:06 PM
badger edited the summary of this revision. (Show Details)Apr 26 2017, 9:07 PM
kib accepted this revision.Apr 26 2017, 9:23 PM

I think, it might be useful to add _Static_assert() on stable branches that e.g. offsetof(struct thread, td_pflags) is equal to the specific hard-coded values for i386, amd64 and arms. Then such issues can be catched automatically.

IMO the asserts would be useful even for head, but then some explanation in the comment might be warranted.

This revision is now accepted and ready to land.Apr 26 2017, 9:23 PM
jhb edited edge metadata.Apr 26 2017, 11:08 PM

Also, to be clear, this would just be a direct commit to stable/{10,11}, it would not go into HEAD.

jhb accepted this revision.Apr 26 2017, 11:09 PM
vangyzen accepted this revision.Apr 27 2017, 1:35 PM
In D10515#217891, @jhb wrote:

Also, to be clear, this would just be a direct commit to stable/{10,11}, it would not go into HEAD.

Understood, and thank you.

This revision was automatically updated to reflect the committed changes.