Gunyah hypervisor requires some VM configuration to be described on the
devicetree. Add a trait to VmAArch64 to allow a hypervisor
implementation to provide the needed info.
BUG=b:253416076
Change-Id: I07091518b856add0c1644bf6a857460da7ff2b3b
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4379521
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
The base crate has some nifty abstractions but also
pulls in things like minijail, audio_streams and
various random items.
This prevents true cross-platform interoperatibility,
which requires the ability to upload to crates.io
with relative ease.
This change removes the base crate. The replacement
strategy is two fold:
- For things like SafeDescriptor which don't have
adequate solutions on crates.io, just copy it
internally. I think SafeDescriptor in particular --
since it works on bot Windows/Linux should probably
be made into a separate crate long-term since it is
generically valuable. Similarly for the Event and
WaitContext APIs. For now, live with the duplication.
- Otherwise, the nix crate does most of the Linux
specific items.
The cross-domain context type has a lot of dependencies
on Linux sockets / epoll. This is refactored to look more
like the Fuchsia solution, which uses std::sync::mspc
channels to connect to an utility Wayland FIDL library.
The rest of Rutabaga mostly relies just on SafeDescriptor
and the ability to clone it. rutabaga_gralloc allows
provides shared memory used via virtwl.
Another thing to call out is zerocopy is now strongly
versioned to the latest stable release on crates.io
I also got rid of #[cfg(feature = "virgl_renderer_next")]
on the renderer server fd, since it was complicating the
refactoring. SafeDescriptor works everywhere and adding
the #ifdef should be reserved for the lowest-levels of
platform specific code when possible.
Overall, this makes compiling on Fuchsia hosts much
simpler.
BUG=b:273555494
TEST= - run cross_domain context type, see Wayland apps
- note there is a previous bug in cross domain
when resizing windows, it occurs before this CL.
The reason seems to be raciness and can likely be fixed
gfxstream-like seqno.
- run gfxstream + virgl on Linux, verify everything works.
Change-Id: I7519f2b8ed0cd57c47980d4e76403057498cf064
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4353700
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
This tracks librust-log-dev, which is at version 0.4.17-3 in the
Debian package tracker.
It may be possible to use another version too.
BUG=b:273555494
TEST=rutabaga_test
Change-Id: Ib0aaca5800f22960dad89b4e138a0dd5fefcb9c2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4353699
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
crrev.com/c/4363328 updated the minijail version to one that requires a
new bindgen version, but it neglected to update Cargo.lock to match.
BUG=b:274724137
TEST=cargo check
Fixes: 1801f6fd1c ("third_party/minijail: Update to latest main")
Change-Id: I7b513cedf00a131485876b654184b4b91bf89951
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4363333
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Add snapshot to vCPU for x86 and x86_64 arch.
BUG=b:266515147
BUG=b:232437513
Test=crosvm run && crosvm snapshot take img_name socket
Change-Id: I65d059a7537c713e9ef6c1456a7aeae2b6bc4728
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4237759
Auto-Submit: Elie Kheirallah <khei@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Elie Kheirallah <khei@google.com>
File backend will write audio playback to files. Every PCM playback
stream will have its own file.
Changes:
* Add playback_path and playback_size to virtio::snd::Parameters
* Add new file_backend file in virtio::snd
* Add virtio-snd arg help.
BUG=b:233542268
TEST=run crosvm with --virtio-snd backend=file and call aplay
Change-Id: Iaec01f52292f1181b0137fa3c8d8c2b2b9e7cc49
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4306260
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
FileStream can be used to output audio playback buffer to a file. It
receives a memory mapped file and makes it act as an audio buffer.
BUG=b:233542268
TEST=emerge crosvm
Change-Id: I2b013fe0422db8475145537adf9c36492f52ae26
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4306259
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Adds a build time compilation check for the generated crosvm_control.h
BUG=b:271789981
TEST=CQ, apply crrev/4237140 and observe build failure due to C compile
error
Change-Id: I57867894a975aa0a48f989051bb4243bf97f57e8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4333206
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Kameron Lutes <kalutes@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
This CL adds an initial implementation of trace points for
passthroughfs and also adds an initial stub for tracing our fuse server
implementation too.
BUG=b:261641906
TEST=ran crosvm with virtiofs and saw trace points being hit
Change-Id: I88502f33997db0030c53405b5f9fbed84aabc773
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4110129
Reviewed-by: Christian Blichmann <cblichmann@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Morg <morg@chromium.org>
This reverts commit 821f544301.
Reason for revert: breaks builds and is not terribly important at the moment
Original change's description:
> crosvm_control: split into inner and outer crates
>
> since the crosvm_control crate is build as a cdylib, the functions are
> not able to be used from other rust code. this patch moves all actual
> implementation into an inner crosvm_control_rust crate, and has the
> outer crosvm_control crate import and expose all of the inner code.
>
> Change-Id: Ib05d5df8bb138680f3e77a8837b1103854c0b316
> Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4276641
> Commit-Queue: Maciek Swiech <drmasquatch@google.com>
> Reviewed-by: Dennis Kempin <denniskempin@google.com>
Change-Id: I2fb1b8b6337b58d69074e63b5ed81771402e616f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4305342
Auto-Submit: Maciek Swiech <drmasquatch@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This allowes fixture to read these settings from env and thus allow
scripts to pass in desired testing configs without requiring a
custom-built rust test harness.
Test command below run in dev container with strace package installed
can produce debug level logs and separate per-process strace results
in designated files.
TEST=CROSVM_CARGO_TEST_E2E_WRAPPER_CMD="strace -ff --output=/workspace/stracetest" CROSVM_CARGO_TEST_LOG_LEVEL_DEBUG=1 CROSVM_CARGO_TEST_LOG_FILE=/workspace/logtest.log ./tools/bench boot
BUG=b:258316090
Change-Id: I5b0eb373802722075242e33027585d702da77e59
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4297485
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
since the crosvm_control crate is build as a cdylib, the functions are
not able to be used from other rust code. this patch moves all actual
implementation into an inner crosvm_control_rust crate, and has the
outer crosvm_control crate import and expose all of the inner code.
Change-Id: Ib05d5df8bb138680f3e77a8837b1103854c0b316
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4276641
Commit-Queue: Maciek Swiech <drmasquatch@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
The monitor process uses the `jail` crate which devices use to create
sandbox.
The syscalls listed in the seccomp filter policy file is originally
generated from a profile by strace. Also there are additional syscalls
from common_device.policy:
* another variant of syscalls in the profile
* clone, dup, readlinkat
* the basic set which will be added by minijail compiler anyway.
* restart_syscall, exit, exit_group, rt_sigreturn
* syscalls appears only on DUT (not workstation).
* set_robust_list, sigaltstack, rseq
Used `common_device.policy` as a reference for syscalls which require
detailed conditions (e.g. clone, mmap, openat, etc).
This adds seccomp filter policy only for x86_64. The policy files for
other architectures will be added later.
BUG=b:258351526
TEST=manually tested
Change-Id: I3e584449ed9330a57ae1d2bd6c56a7554b6584ef
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4253073
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
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>
Add a minijail's mode of operation where an always-allow seccomp
filter is attached to forked device processes. This facilitates
capturing seccomp filters used by each device process separately.
TESTED=./tools/build_release -- --features seccomp_trace && strace -ff crosvm --log-level debug run <args>
BUG=b:258316090
Change-Id: Ic4d3f5178e6a2dcbd748d101db43574f3224ff78
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4289510
Commit-Queue: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This allows us to print a more useful error message if the
wayland-scanner tool is not present.
BUG=None
TEST=cargo build # with and without wayland-scanner present
Change-Id: I8909e064621cb4d71bc8ec96d76df8a2b4c4fc88
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4294676
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
What is changing in this CL?
* IRQ control tubes (aka MSI tubes used by devices to register new
interrupts) and IRQ handling is moving out of run_control.
* IRQ handling is moving to its own dedicated thread.
* To support this, SysAllocator is moving behind an Arc<Mutex<..>>. We
already do this on Windows without ill effect.
Why are we making these changes?
* IRQ handling is about to get more complex due to the flushing
operations needed by snapshotting. Attempting this with the IRQ
processing coupled to run_control would be extremely messy.
* run_control is massive. Moving code out of it will help improve readability.
* Though most interrupts on KVM avoid this loop as a hot path, having it
on a dedicated thread seems better than sharing it with everything
else that runs on the run_control thread.
* On Windows, we moved IRQ handling out of run_control from necessity
(it has to be delegated to a thread pool). By doing something similar
on unix, our overall technique for IRQ handling no longer diverges
between platforms.
BUG=b:269652166
BUG=b:266514201
TEST=ran the example vm & verified the kernel could boot.
Change-Id: I02b8bf60666cd67b76388cb8ccd04a7c21f2003c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4262525
Reviewed-by: Elie Kheirallah <khei@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Steven Moreland <smoreland@google.com>
Creates the jail create and move all policy files and helper methods to
the crate to make jail helpers available to outside of the main crate
(i.e. swap crate).
This also move devices::Minijail and JailConfig to jail crate.
BUG=b:258351526
TEST=cargo build
Change-Id: If9a148bdb3b18f8b746875d47d1077fb17707c18
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4230456
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
This CL removed many uses of DataInit in devices. Some paddings
are manually added/fixed to allow AsBytes to derive without ABI
changes.
TESTED=CQ
BUG=b:204409584
Change-Id: I1f8c2d5304fc8e685cc3e5166c73481f6a3f78f7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4235224
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
userfaultfd(2) syscall requires CAP_SYS_PTRACE of root user namespace.
For better permission control /dev/userfaultfd was introduced from Linux
6.1. Since ARCVM runs inside a sandbox user namespace and enabling
/proc/sys/vm/unprivileged_userfaultfd opens up userfaultfd to the entire
system, crosvm for ARCVM has to use /dev/userfaultfd to create a
userfaultfd.
For systems which do not have /dev/userfaultfd, the Factory falls back
to userfaultfd(2).
BUG=b:268145007
BUG=b:266642532
TEST=manual test
Change-Id: I44b657877093d2a75627432619c1233b7ac2464e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4196763
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
`crosvm snapshot take ...` will write the contents of guest memory to a
file and `crosvm restore apply ...` will read that file to overwrite
guest memory.
To start with, the file is chosen by adding a ".mem" extension to the
snapshot file path. We should consider a better approach in the future,
maybe put them both in a tar file or have the user supply a directory
instead of a file path.
BUG=b:266514791
Change-Id: Ic05f94223fb74674bd57dcd2f848055b31eb5fdc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4215313
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Thie effort is splitted into multiple CLs, to reduce change size
and also make bisecing breakages easier.
TESTED=CQ only
BUG=b:204409584
Change-Id: Ie90f171bd5f74b732df3129e94733f3b34621092
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4210751
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
- Revbum to 0.1.1, 0.1.0-{anything} causes data_model
0.1.0 to be downloaded since it's a higher release number.
- Also, add include LICENSE in the package includes for
data_model.
- Also, use the correct version when not using path in rutabaga_gfx.
BUG=b:173630595
TEST=compile
Change-Id: I68af3eb1fa4ab89a77968f784e388b10c94d8b97
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4209693
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
This implements the equivalent logic on crosvm as
UFFD_FEATURE_EVENT_FORK. When each device process forks, the ProxyDevice
creates userfaultfd and send it to the monitor process by
SwapController::on_process_forked().
Crosvm does not have any child processes which may access the guest
memory except device processes as of now. Crosvm forks
virgl_render_server, but the mmap is not preserved in the process on
execve(2) since it is a different binary. Also no device process forks
grandchild processes according to the seccomp policy.
We actually can't use UFFD_FEATURE_EVENT_FORK because the feature does
not support non-root user namespace (go/uffd-fork-user-ns) and ARCVM
runs in a non-root user namespace.
This also adds syscalls to seccomp policies for devices to allow the
processes to create and setup a userfaultfd.
BUG=b:266641923
TEST=manually tested
Change-Id: Ide3088e1e95ae3c8259e3f4324124b3376e760b7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4194228
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
In cargo nextest, tests will be executed in a separate process for
each test.
This means we cannot use in-process locks or counters to ensure
tests will not conflict with each other.
BUG=b:261600801
TEST=CQ
Change-Id: Ifb5d16295fa2ec76a4036222961769dfaea18a32
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4190035
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Enabling vmm-swap copies all the guest memory to the staging memory
while freezing whole the crosvm. Reducing the latency of it is
important.
The most time consuming part of enabing vmm-swap is pure memory copy
which easily can be executed on the multi-thread.
BUG=b:263830401
TEST=cargo test -p swap
Change-Id: I307ad1c459158113cc654e7ba1541381a38b65bb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4142083
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Adds a fall-back to cros_fuzz when compiled without
fuzzing enabled that will just produce a main fn entrypoint
with the fuzzing code.
This allows the fuzzing code to be compiled, but won't produce
functional fuzzing binaries.
BUG=b:265829867
FIXES=b:244631591
TEST=crosvm CQ
cargo +nightly fuzz run --fuzz-dir crosvm-fuzz --features upstream-fuzz crosvm_block_fuzzer
Change-Id: Ib2602aab5c5373cb2a71dca0d8419640a00c6725
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4167143
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
- Don't build cross-domain -- uses too many Unix like features.
Once we have a good idea on which abstractions display integration
should use, we can start incrementingly re-enabling it.
- Stub out common base things for now. First we probably want to
fill out the stub before we determining a long-term soluton.
BUG=b:173630595
TEST=build rutabaga using Fuchsia SDK
(context: https://fxbug.dev/114169)
Change-Id: I21db796f59ba7dbf1101a50ae0be482a32e69cc8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4081627
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Replace the OS-specific /dev/urandom with the cross-platform rand crate.
BUG=b:265031416
TEST=Boot aarch64 Linux kernel on lazor
Change-Id: I6eb3ab4c5b45bc8296ade92b5b5e30da78d039d2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3855345
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Drop a few unused kvm dependencies and only require minijail on unix
platforms.
The aarch64 platform won't be functional on Windows yet, but it's at
least possible to drop it from the WIN64_DISABLED_CRATES list.
BUG=None
TEST=tools/dev_container tools/run_tests --platform=mingw64
TEST=tools/dev_container tools/run_tests --platform=aarch64
Change-Id: If48b935afe1295820b6d78cfde3e8634a3e397db
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4167144
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
data_model is probably going away in the future, but
until we can release it as pre-release alpha for internal
efforts.
(context: https://fxbug.dev/114169)
BUG=b:173630595
TEST=compile
Change-Id: Ie13ec3ab9083d315c78a035b532132296a8fb651
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4082333
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
This avoids duplicate versions of clap in the upcoming minijail update.
BUG=None
TEST=tools/presubmit --all
Change-Id: I61a5ee4268dff53b71b2a1f2140b2d00c0e269ba
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4133839
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This provides the kernel with an early source of entropy for its random
number generator.
The kernel supports for this was added in commit 68b8e9713c8e
("x86/setup: Use rng seeds from setup_data"):
<https://lore.kernel.org/all/20220710172921.51545-1-Jason@zx2c4.com/>
Earlier kernels will ignore the unknown setup_data entry.
BUG=b:265031416
TEST=Boot x86-64 Linux bzImage with added printk in rng seed init
Change-Id: I627aa8663bd61b04ca311d4d095e1c121fda8543
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3855344
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
We only use this for testing, and this can be replaced at low cost by a
method returning a &dyn Any and having the tests perform the cast on it.
Since downcast_rs gets in the way of some of the refactoring we want to
do, let's remove it.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I343e0a8e0f219f6bcf3cbc5efac82a1ed999a9a0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4123651
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Using the cached page size shift has several performance benefits listed
at the comment of the file.
BUG=b:260543132
TEST=cargo test -p swap
Change-Id: Ic7a19135b7a2e29c032c73fa7dca1d853cdb5e48
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4125177
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Shin Kawamura <kawasin@google.com>
Use the log crate instead of base for logging. This resolves to the
same, and allows us to remove the dependency to base and to make this
crate an independent project.
BUG=b:214478588
TEST=libva decoder can successfully be used from a Linux guest.
Change-Id: I795f1661704b0985b4e11966d204486579bb0d59
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4111638
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
This feature has nothing specific to Windows in its implementation, so
pull it up to the portable part of the Serial device.
The unit test is slightly modified to avoid the need for the regex
crate. This was the only use of regex in devices, so it can be dropped
from Cargo.toml.
BUG=None
TEST=cargo test -p devices serial
TEST=tools/run_tests --platform=mingw64
Change-Id: I3073e90d71bda3c9f6da1df3a3b657e62e087302
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4126251
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This CL adds a new backend for the cros_tracing crate. This backend can
be enabled by building crosvm with the trace_marker feature enabled.
When the feature is not enabled, no extra overhead incurs as the default
NOOP cros_tracing crate will be compiled in instead.
BUG=b:259501910
TEST=compiled and ran crosvm with and without `--features trace_marker`
Change-Id: Ia4b929b042712a458b7d54c0362d6fda90db9e9f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4075413
Reviewed-by: Christian Blichmann <cblichmann@google.com>
Auto-Submit: Morg <morg@chromium.org>
Commit-Queue: Morg <morg@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Currently the only way to open a DRM device for libva is to scan the
list of DRM render nodes using udev. This works nicely for the general
case, but requires a few extra ioctls that are not currently added in
the video device process seccomp allowlist so we would like to get rid
of it.
One can also argue that how to detect the DRM device should be left to
the application, so this CL allows users to explicitly specify which DRM
device they want to open. As a helper, it also adds an iterator over
standard DRM render nodes locations to provide similar functionality
without requiring extra ioctls.
BUG=b:262824148
TEST=ARCVM can start and create a VAAPI-backed video device without
triggering seccomp policy failures.
Change-Id: I241c4834361ec1e8455a4307093850a7b3cef276
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4112728
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>