-
Notifications
You must be signed in to change notification settings - Fork 1
Testing ‐‐ tcrypt in Github Action (remotely)
Goal: Run tcrypt in Github Actions (CI).
The User Mode Linux (UML) is a compilation mode of the kernel that allows to run a Linux image just as another user program.
The strategy to run tcrypt testing suite is as follows:
- Compile the kernel setting ARCH=UML.
- Create an initramfs image, which contains an
init
script that is the first program Linux executes by default. - Populate init with calls to
modprobe tcrypt <params>
. This will run test and benchmarks. - Dump results to a file.
There are, however, some limitations when using UML.
-
Since UML is activated as an ARCH type, it can only execute kernel code that is not architecture-specific. For example, AES is implemented with generic code, but with ARCH=x64 it also enables the implementation with AES-NI instructions. So, under UML we can only run modules with generic implementations.
-
Getting cycles (
sec=0
or default) is not allowed. The current setup does not forward the cycle counter from "kernel" space to user space. So, we need to pass, for examplesec=2
, to report timings using opers/sec. This may be an advantage to run more iterations of the algorithm and get more measurement stability.
There is a workflow under .github/workflows/crypto-test-harness.yml
which runs the steps mentioned above.
The job activates for every new pull request targeting the cf-zeta
branch.
The job runs on an Ubuntu image, and produces the output file as a Github Artifact, that can be downloaded for further examination.
In this step, we are interested more in executing the kernel tests for algorithms. The timings reported may suffer alterations as the Github runner could start/stop and reallocate CPU resources for the job. However, timings should be congruent to what is observed locally.