Page MenuHomeFreeBSD

amd64: Add static asssert for context size
ClosedPublic

Authored by imp on Feb 8 2022, 10:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 15, 9:09 AM
Unknown Object (File)
Mar 7 2024, 1:36 PM
Unknown Object (File)
Jan 13 2024, 3:09 PM
Unknown Object (File)
Dec 31 2023, 9:18 AM
Unknown Object (File)
Dec 26 2023, 9:30 AM
Unknown Object (File)
Dec 20 2023, 5:52 AM
Unknown Object (File)
Dec 1 2023, 10:37 AM
Unknown Object (File)
Nov 2 2023, 10:16 PM
Subscribers
None

Details

Summary

Add a static assert for the mcontext{,32}_t and ucontext{,32}_t
sizes. These are de-facto ABI options and cannot change size ever.

Sponsored by: Netflix

Diff Detail

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

Event Timeline

imp requested review of this revision.Feb 8 2022, 10:04 PM
imp created this revision.
sys/amd64/amd64/exec_machdep.c
100

The compat32 asserts should go somewhere in amd64/ia32/ or even compat/ia32.

Indeed, look at compat/ia32/ia32_sysvec.c:78.

sys/amd64/amd64/exec_machdep.c
100

Sure. Looks like I should add siginfo_t as well... I can just remove these and I'll see if there's a more appropriate place for the armv7 ones.

thanks

kib added inline comments.
sys/amd64/amd64/exec_machdep.c
100

siginfo is in fact MI, it is LP64 vs ILP32 at most. You should see it yourself when you added asserts. I belive sys/kern_sig.c would be a better place for such assert, with ABI ifdef.

But I do not insist.

This revision is now accepted and ready to land.Feb 9 2022, 12:39 AM
sys/amd64/amd64/exec_machdep.c
100

I think I'm leaning towards keeping this here because it is MD, even if its size is predictable based on LP64 vs ILP32. There's no code that depends on that happy accident (other than sizes). If there were, I'd be inclined to move it near that code.

sys/amd64/amd64/exec_machdep.c
99

Shouldn't this message be ucontext_t ...?

This revision now requires review to proceed.Feb 10 2022, 7:31 PM
This revision was not accepted when it landed; it landed in state Needs Review.Feb 10 2022, 9:34 PM
This revision was automatically updated to reflect the committed changes.