-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for CheriBSD #36
Commits on Sep 3, 2023
-
microatf: ensure that struct atf_tc_s is large enough
When running the tests on a CheriBSD system on Arm Morello, pointers are 16 bytes, so the implicit size of 8192 bytes is not large enough to hold all of struct atf_tc_impl_s_ and running the tests fails with a bounds violation. To fix this issue, this commit explicitly sizes the array instead of relying on the alignment and adds a static assertion to the source file to ensure this invariant holds. I've also reordered struct atf_tc_impl_s_ to avoid padding on CHERI systems.
Configuration menu - View commit details
-
Copy full SHA for ee4107d - Browse repository at this point
Copy the full SHA ee4107dView commit details -
Safely interpose fcntl() on architectures with bounded variadic argum…
…ents `fcntl()` abuses C variadic arguments to implement optional parameters. We want to forward this argument to the real `fcntl()` call, but doing so is non-portable. On most architectures, we can just read an `intptr_t`/`void*` and this will give us a (semi-)valid result even if no argument/an int was passed instead since `va_arg()` will generally read the next argument register or arbitrary data from the stack. On CHERI-enabled architectures, variadic arguments are tightly bounded, which means that reading a `void*` if an `int` was passed will result in a runtime trap. This commit adds a switch ensures that we read the correct number of bytes from the variadic arguments. This ugly workaround would not be needed if a vfcntl() call taking a va_list existed, or if fcntl just took an intptr_t argument. This reduces the number of test failures on CheriBSD Morello from 210 to 8.
Configuration menu - View commit details
-
Copy full SHA for ee037af - Browse repository at this point
Copy the full SHA ee037afView commit details -
Fix epoll__event_size test on CHERI systems
Some systems such as 64-bit CHERI-RISC-V or Arm Morello have 128-bit pointers, so for them the sizeof(event) assertion needs to be updated.
Configuration menu - View commit details
-
Copy full SHA for 9c17e21 - Browse repository at this point
Copy the full SHA 9c17e21View commit details -
Configuration menu - View commit details
-
Copy full SHA for 48ba3a4 - Browse repository at this point
Copy the full SHA 48ba3a4View commit details -
Use uintptr_t when reading kevs[i].ident
This avoids a warning when building for CheriBSD (Morello purecap).
Configuration menu - View commit details
-
Copy full SHA for 6529f5c - Browse repository at this point
Copy the full SHA 6529f5cView commit details -
Don't run target executables during build when cross-compiling
Trying to run the test executables during the build to get the list of test cases causes my cross-compilation to fail. Skip adding the test cases to CTest in that case (but still build them we can run them manually).
Configuration menu - View commit details
-
Copy full SHA for c8ef343 - Browse repository at this point
Copy the full SHA c8ef343View commit details -
Check errno on startup in timerfd__{reset_to_very_long,unmodified_errno}
Due to a bug in CheriBSD, errno was set non-zero when starting this test, but without these checks the test confusingly failed in the later check which made me think something was wrong in timerfd_create. Check errno on startup to make this more obvious. See CTSRD-CHERI/cheribsd#1424
Configuration menu - View commit details
-
Copy full SHA for ecac389 - Browse repository at this point
Copy the full SHA ecac389View commit details