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
Differential D32958
aarch64: Add static asssert for context size imp on Nov 12 2021, 6:38 AM. Authored by Tags None Referenced Files
Details
Add a static assert for the mcontext{,32}_t and ucontext32_t Sponsored by: Netflix 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 TimelineComment 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. 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. 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.
|