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)
Thu, Oct 31, 2:46 PM
Unknown Object (File)
Tue, Oct 22, 4:16 PM
Unknown Object (File)
Sep 22 2024, 2:06 PM
Unknown Object (File)
Sep 22 2024, 6:08 AM
Unknown Object (File)
Sep 18 2024, 11:46 AM
Unknown Object (File)
Sep 17 2024, 7:49 PM
Unknown Object (File)
Sep 17 2024, 11:45 AM
Unknown Object (File)
Sep 17 2024, 3:22 AM
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.