Add a static assert for the mcontext{,32}_t and ucontext32_t
sizes. These are de-factor ABI options and cannot change size ever.
Sponsored by: Netflix
Paths
| Differential D32958 Authored by imp on Nov 12 2021, 6:38 AM.
Details
Summary Add a static assert for the mcontext{,32}_t and ucontext32_t Sponsored by: Netflix Test Plan Found issues with mcontext size in qemu bsd-user, so thought I'd add asserts here to ensure the size doesn't change, and to document said size.
Diff Detail
Event TimelineHerald added a reviewer: manu. · View Herald TranscriptNov 12 2021, 6:38 AM2021-11-12 06:38:26 (UTC+0) Harbormaster completed remote builds in B42749: Diff 98399.Nov 12 2021, 6:38 AM2021-11-12 06:38:28 (UTC+0) imp edited the test plan for this revision. (Show Details)Nov 12 2021, 6:39 AM2021-11-12 06:39:24 (UTC+0) Comment Actions These should also be true in CheriBSD running FreeBSD/arm64 binaries. I'll have to look how we could handle the new extensions where userspace may have access to larger register files, e.g. SVE has 32 registers that could be up to 2048 bytes each. In this case I expect we'll store them in their own variable sized structure that one of the spare fields point to. This revision is now accepted and ready to land.Nov 12 2021, 11:20 AM2021-11-12 11:20:55 (UTC+0) Comment Actions I believe that the general preference is to put this kind of asserts into .c file and not in .h. It is enough to get single error from the build, instead of 40+ from each instance of compiler in the parallel build. Andrew, WRT to new extensions, please look how Intel extensions are handled on x86, in particular getcontextx(3). Indeed we store a pointer to extended part of XSAVE area into existing mcontext(32). Comment Actions I would be fine with moving the assertions to a C file (probably arm64/arm64/machdep.c next to get_mcontext? The 32-bit assertion could perhaps be next to get_mcontext32) Comment Actions
I was going to add several more. My plan was just to add them all to the top of exec_machdep.c on all the architectures, with appropriate ifdefs for 32-bit compat stuff since I was also going to assert on ucontext_t size and sigframe as well. This revision now requires review to proceed.Feb 8 2022, 9:23 PM2022-02-08 21:23:36 (UTC+0) Harbormaster completed remote builds in B44344: Diff 102513.Feb 8 2022, 9:23 PM2022-02-08 21:23:37 (UTC+0) Comment Actions exec_machdep.c seems to be the place that has all the MS signal handling on all the platforms, so it seems like the right place for these. I did one as an example, but will do the others in a similar manner once this gets signed off on. Harbormaster completed remote builds in B44345: Diff 102517.Feb 8 2022, 9:51 PM2022-02-08 21:51:23 (UTC+0)
Harbormaster completed remote builds in B44356: Diff 102531.Feb 8 2022, 11:59 PM2022-02-08 23:59:55 (UTC+0) This revision is now accepted and ready to land.Feb 9 2022, 12:40 AM2022-02-09 00:40:34 (UTC+0)
This revision now requires review to proceed.Feb 10 2022, 7:30 PM2022-02-10 19:30:37 (UTC+0) Harbormaster completed remote builds in B44393: Diff 102619.Feb 10 2022, 7:30 PM2022-02-10 19:30:38 (UTC+0) This revision was not accepted when it landed; it landed in state Needs Review.Feb 10 2022, 9:34 PM2022-02-10 21:34:16 (UTC+0) Closed by commit rG3988ca5aabb2: aarch64: Add static asssert for context size (authored by imp). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 102638 sys/arm64/arm64/exec_machdep.c
sys/arm64/arm64/freebsd32_machdep.c
|
Shouldn't this be lower case?