Commit graph

9 commits

Author SHA1 Message Date
Vikram Auradkar
2768f223ee clippy: enforce safety block comments
BUG=b:316174930
TEST=none

Change-Id: I5c7811b2c548155aa003e4b71a54bbc16e2f2588
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5120567
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-12-14 18:21:54 +00:00
Dennis Kempin
5cf0a98827 dev_container: Build new container without riscv
Also adds lld, which will be used in a follow-up to improve
linking performance.
Since debian has had a stable release since then, we also
need to upgrade a few library versions in the testvm.

Swap tests that require userfaultfd were able to run without
root before. In the latest version of debian we need to configure
for unprivileged access.
Since this is the case for glinux workstations as well, let's
mark those tests as root-only and let them execute via sudo.

BUG=b:304875018,b:256905223
TEST=presubmit

Change-Id: Ied0b34e248990378a7864b4a394aa21d8f824f71
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5013631
Reviewed-by: Zihan Chen <zihanchen@google.com>
Reviewed-by: Shin Kawamura <kawasin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-11-20 18:34:35 +00:00
Daniel Verkamp
673a730638 Tweaks to placate clippy single_range_in_vec_init
<https://rust-lang.github.io/rust-clippy/master/index.html#single_range_in_vec_init>

Change-Id: I97cfe03c602630bcdb6c8b270f553c7c62e794d5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5007727
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-11-06 23:36:11 +00:00
Shintaro Kawamura
94217cc88b swap: make swap/enable not default
"enable" feature in swap crate was set as default to run
unit/integration tests of the crate. https://crrev.com/c/4486546

However missing `default-features = false` at non-root Cargo.toml cause
other crates (e.g. x86_64) installing userfaultfd always.

This makes the swap/enable non-default. CQ still runs unit/integration tests of the swap crate on aarch64 and x86_64.

BUG=b:281935498
TEST=cargo test -p swap --features=swap/enable

Change-Id: I57436c3cb8cbdfac04c3145cc599261b89cf4e0e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4518090
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-05-12 06:15:16 +00:00
Daniel Verkamp
083dcf75f4 tree-wide: apply nightly rustfmt
BUG=None
TEST=tools/fmt --nightly

Change-Id: Ifb08dd55ccf2a74ef739d7517a64970d24a82405
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4375640
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-03-27 21:30:45 +00:00
Dennis Kempin
b67eaca468 Use custom test harness for tests using fork
forking a process with multiple threads will lead to
undefined behavior. Unfortunately, newer versions of
libtest will spawn multiple threads even when running
a with --test-threads=1.

This change implements a custom, test harness using
libtest-mimic. It mimics the libtest CLI but enforces
a single threaded test process.

BUG=b:270167741
BUG=b:268496046
TEST=tools/run_tests --dut=host

Change-Id: Icef6a1b65bab7f5cd5021c01fbd94487fa0ca5fb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4295157
Reviewed-by: George Burgess <gbiv@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
2023-03-01 21:46:16 +00:00
Shintaro Kawamura
397b103a64 swap: introduce Error type for userfaultfd
This is a refactoring to use original Error type instead of UffdError
from userfaultfd crate. This helps /dev/userfaultfd support which
returns std::io::Error on opening userfaultfd.

This contains a minor change to move register/unregister helpers to
userfaultfd.rs

BUG=b:266642532
TEST=cargo test -p swap

Change-Id: I24079999b018c0f1683fd7b4ee0f97153bd8914d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4196761
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
2023-02-01 01:05:25 +00:00
Dennis Kempin
acc162000f Add conditional compilation for unix-only crates
Instead of configuring which crates to --exclude in
test_config.py, we can use conditional compilation to
exclude code that is not supported on windows.

This allows more fine-grained control and also allows
us to use plain cargo for building without complicated
configuration and exclusions.

BUG=b:265829867
TEST=cargo test --lib --bins --workspace
	--target=x86_64-pc-windows-gnu
	--features=all-mingw64

Change-Id: I8422c3f08053bc27d9896b220876a56bd25543d6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4165868
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-01-19 21:21:59 +00:00
Shintaro Kawamura
fc88a6091d swap: add disable command to vmm-swap
Handling page faults using userfaultfd for all the time after vmm-swap
is enabled originally has overhead. By disabling swapping, we can use
crosvm without the overhead when the crosvm become used heavily again.

This also refactor PageHandler and extract register logic to lib.rs.

BUG=b:215093219
TEST=cargo test -p swap

Change-Id: Id81d84ebe40067b4f19b212f6b81cbaf249c0c3c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4005474
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
2022-11-18 01:23:45 +00:00