Commit Graph

9 Commits

Author SHA1 Message Date
Friday Ortiz
ab38afe95d perf_event: support hardware breakpoints
Implement `PerfEventConfig::Breakpoint`, allowing users to attach
hardware breakpoints. Generate `HW_BREAKPOINT_*` and `struct
bpf_perf_event_data` in support of this feature and update the type of
`PerfEventContext` accordingly.

Add a test exercising R, W, RW, and X breakpoints. Note that R
breakpoints are unsupported on x86, and this is asserted in the test.

Extend the VM integration test harness and supporting infrastructure
(e.g. `download_kernel_images.sh`) to download kernel debug packages and
mount `System.map` in initramfs. This is needed (at least) on the aarch
6.1 Debian kernel which was not compiled with `CONFIG_KALLSYMS_ALL=y`
for some reason, and the locations of globals are not available in
kallsyms. To attach breakpoints to these symbols in the test pipeline,
we need to read them from System.map and apply the KASLR offset to get
their real address. The `System.map` file is not provided in the kernel
package by default, so we need to extract it from the corresponding
debug package. The KASLR offset is computed using `gunzip` which appears
in kallsyms on all Debian kernels tested.

Co-authored-by: Tamir Duberstein <tamird@gmail.com>
2025-11-10 16:33:54 -05:00
Tamir Duberstein
5f046899b5 xtask: teach integration-test vm to consume kernel debs directly
Bundle handling of Debian kernel archives into xtask so callers can pipe
the raw `.deb` paths straight into `cargo xtask integration-test vm …`.
The driver now extracts each archive into `<cache>/kernel-archives`,
locates the matching `vmlinuz-*`, `lib/modules/*`, and config files, and
feeds those into the initramfs build without requiring the user to
pre-run dpkg/tar. With this in place we drop
`.github/scripts/find_kernels.py`, simplify AGENTS.md/CI instructions to
use `find test/.tmp -name '*.deb'`, remove the gnu-tar requirement we no
longer need, and add `tar` as a workspace dependency for the extractor.
2025-10-08 08:59:03 -07:00
Tamir Duberstein
9996f7a300 Allow +debN kernels
Seems 6.12 is now being marked `+deb13`.
2025-08-11 16:20:33 -04:00
Tamir Duberstein
e967d0aea2 Use nul bytes as delimiters 2025-04-08 07:59:35 -04:00
Tamir Duberstein
e692e5ffc5 Remove stale comments
Upstream isn't planning to do this.
2025-04-08 07:59:35 -04:00
Dave Tucker
abe5f743a3 feat: Refactor init into test-distro
The init module contains a small init system for running our integration
tests against a kernel. While we don't need a full-blown linux distro,
we do need some utilities.

Once such utility is `modprobe` which allows us to load kernel modules.
Rather than create a new module for this utility, I've instead
refactored `init` into `test-distro` which is a module that contains
multiple binaries.

The xtask code has been adjusted to ensure these binaries are inserted
into the correct places in our cpio archive, as well as bringing in the
kernel modules.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2025-03-19 19:11:15 +00:00
Tamir Duberstein
f26ccde136 Allow +bpo kernels
Seems 6.10 is now being marked `+bpo`.

Improve error handling while I'm here.
2024-12-30 11:46:35 -05:00
Tamir Duberstein
d1457acc6d ci: cache downloads
We're seeing 429 from Github trying to download gen_init_cpio, so cache
it using actions cache. Since I'm here add this for kernel images as
well to save time waiting on slow Debian servers.
2024-12-23 06:43:18 +01:00
Tamir Duberstein
fbbc2ec050 ci: automatically download latest kernel revs
Let's get off the treadmill.

Switch (almost) all wget usages to curl.
2024-11-11 14:36:35 -05:00