Skip to content
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

ci: Use architest for running test suite across architectures #266

Merged
merged 40 commits into from
May 28, 2024

Conversation

vadorovsky
Copy link
Member

  • Run a QEMU VM for a target architecture when executing cargo xtask cross run. Use images from the architest repository.
  • Run these tests in CI.

@vadorovsky vadorovsky force-pushed the vadorovsky/architest branch 3 times, most recently from 398cf61 to c3e3016 Compare March 18, 2024 10:05
@vadorovsky vadorovsky force-pushed the vadorovsky/architest branch 9 times, most recently from 44a1295 to d0cc91f Compare March 18, 2024 16:09
@vadorovsky vadorovsky force-pushed the vadorovsky/architest branch 5 times, most recently from 6618c06 to 7f9312d Compare March 21, 2024 13:37
@vadorovsky vadorovsky force-pushed the vadorovsky/architest branch 9 times, most recently from da7e346 to f189880 Compare April 7, 2024 08:24
@vadorovsky vadorovsky marked this pull request as ready for review April 7, 2024 08:24
@vadorovsky vadorovsky force-pushed the vadorovsky/architest branch from 26a31b4 to f818c98 Compare April 7, 2024 20:22
@vadorovsky vadorovsky requested a review from banditopazzo April 8, 2024 06:40
vadorovsky added 26 commits May 27, 2024 08:04
BPF verifier on many kernel version is confused about the state of
register 0 (`BPF_REG_0`) when it's not explicitly set to a value which
is considered safe.

Therefore, always call `BPF_MOV64_IMM(BPF_REG_0, 0)` before exiting the
program.
Before using `error_for_status()`, the `test` command was just carrying
on with using invalid tarball data when a requested tarball was not
present.
Kernel version checks are unreliable:

* Features differ across architectures.
* Linux distros tend to backport features to their stable/LTS kernels.

Instead of relying on version, use small probes (written in eBPF
assembly) to figure out what features are available.
Having this as a test is misleading, because it's always going to fail
on kernels or configurations which don't support eBPF LSM. Such case
should result in graceful rollback to kprobes, not in failign tests.
… objects

This way is more intuitive with the new feature probing mechanism.
The already existing C probe does it well and also catches the lack of
ftrace direct call.
* Add `bpf-features` crate which contains only the `BpfFeatures` struct
  with a static method `all_combinations`, which is then used both by
  `bpf-builder` (to build programs with all feature combinations) and
  and `bpf-common` (to pick the correct program based on detected
  features).
* Add `bpf-feature-autodetect` crate and move feature probes there.
* Add `bpf-features-macros` crate for with the `ebpf_programs_map`
  macro which autogenerates mapping of features to program bytes. The
  program bytes (for all feature sets) are still embedded in the final
  binary.
Don't run them in the `build` workflow.
* Remove the unnecessary check (`offset >= skb->len`). Apparently,
  verifier doesn't expect it.
* Improve error messages.
We already have a more reliable `FEATURE_BPF_LOOP` check for that.
@vadorovsky vadorovsky force-pushed the vadorovsky/architest branch from 22e9e68 to 5e216d3 Compare May 27, 2024 08:10
@vadorovsky vadorovsky merged commit cdeebb3 into main May 28, 2024
21 checks passed
@vadorovsky vadorovsky deleted the vadorovsky/architest branch May 28, 2024 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants