TEST=presubmits and this code works downstream
BUG=b:258298873
Change-Id: I7369fb08af474d107d056da8538de86bbc03eeb8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015562
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Commit-Queue: Richard Zhang <rizhang@google.com>
This is needed to build the `devices` crate only for the windows target.
BUG=none
TEST=cargo test --target=x86_64-pc-windows-gnu --features=slirp in devices
Change-Id: I781def962a716e4ee2ea80f3c6d1a426fc92e2e8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4028759
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Port the VAAPI backend to the new cros-codecs crate. This crate now
contains all codec related code and is independent from the rest of the
CrosVM code.
BUG=b:214478588
TEST="cargo test --package devices --lib --features video-decoder --features vaapi -- virtio::video::decoder::backend::vaapi::tests::test_get_capabilities --include-ignored"
Change-Id: Id207c53c0c4200e03ce8793d7c37cb5fbe808829
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3875044
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
libvda is only available on ChromeOS, and being unable to link to it
with regular builds reduces our build coverage.
Add a "libvda-stub" feature that, if enabled, results in dummy C stubs
being build for all the exported libvda functions. This allows builds
with the "libvda" feature to pass, although of course the resulting
video device would immediately crash and thus should not be used.
BUG=b:244619291
TEST=`cargo build --features="video-decoder,video-encoder,libvda-stub"`
completes.
TEST=`cargo build --features="video-decoder,video-encoder,libvda"`
reports link errors against libvda.
TEST=`cargo build --features all-x86_64` builds libvda and completes
without error.
Change-Id: I9bb60f6caf670081d67c91275727f3888272d64b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3947844
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Adds a new error code for when we fail to open a disk image. Also adds
an exit code we were missing upstream.
BUG=b:253348635
TEST=intentionally messed up the disk image path and verified we get
this error.
Change-Id: I197b4c5d80682dd1ee2a42d02df852276d204c17
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3961530
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Noah Gold <nkgold@google.com>
This replaces the handwritten arg parser with the serde_keyvalue
based parser. Eventually we will unify the arg parsing with Unix.
BUG=b:233676779
TEST=cargo b --features all-msvc64,gpu --no-default-features
TEST=cargo t -p vm_control --features all-msvc64,gpu
--no-default-features
TEST=cargo t -p crosvm sys::windows::config::
--features all-msvc64,gpu --no-default-features
Change-Id: I36a563be9767c7e5cbd3ab44f6a9ba23cd64cdb6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3939033
Commit-Queue: Pujun Lun <lunpujun@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
`tracing` conflicts with a crates.io crate. Since we may support tokio
tracing in the future, and want to submit some benchmarks against it
right now, we should rename our crate.
BUG=b:253517247
TEST=presubmit
Change-Id: I32bf64a7ce1830e881bd582e4606932782df65c6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3957598
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
Adds a new message that can be used to map GPU memory via Vulkano.
BUG=b:244622199
TEST=presubmit & downstream
Change-Id: I4018cfda7573d4df2d89225060d5d61c8ac5d3d9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3924935
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Idan Raiter <idanr@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
And enable it in upstream all-linux builds.
The feature is enabled for chromeos by default, so should
be a no-op for chromeos builds.
We can probably simplify the cfg() attributes further by
only enabling the feature for x86, so we do not need the
extra check each time. But that'll require ebuild changes.
BUG=b:244618505
TEST=presubmit
TEST=cargo build --no-default-features --features=vtpm
Change-Id: Ibb33c04ab5e6486969fefc6f3e57503be4eccdf3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3924741
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This allows us to enable the feature in upstream builds.
The feature is automatically enabled for the chromeos feature,
so it should be a noop for ChromeOS builds.
BUG=b:244618505
TEST=presubmit / build_packages implicit-system crosvm
Change-Id: I2ea2d668a0f8c2faa92aad5452df0bf660d85e0e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3919815
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Adds a script that copies the bindings we need upstream. We cannot
use the original repository, as it's part of the large platform2 git
repository, and the original build.rs depends on ChromeOS tooling to
generate these bindings.
So instead, this change adds a script that can be called from a
chromiumos checkout of crosvm to update the upstream bindings.
This allows us to enable certain features that talk to ChromeOS
dbus services. They won't be functional upstream, but at least we
can compile and test the code.
To make things more consistent, we no longer replace the crate
with the ChromeOS version when building for ChromeOS.
BUG=b:244618505
TEST=presubmit
Change-Id: I504cbf6d12b0cb50d9935f5e49b7fa72b692d45c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3919814
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
We want to hide this variable from platforms that don't use it.
BUG=b:213149288
TEST=presubmit
Change-Id: I0d44d2bc50843b86d82b4084f95c8d1a1f750aa6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3895401
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Pujun Lun <lunpujun@google.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Chia-I Wu <olv@google.com>
We already depend on chrono elsewhere, so we might as well use it rather
than rolling our own unsafe wrapper around gmtime_r.
BUG=None
TEST=tools/presubmit --all
Change-Id: I46e4a75ca74f8a02875814f6cb21031db58e1e3a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3795009
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Balloon support can not be compiled out, and don't need to be
disabled at run time.
BUG=b:235887451
TEST=Guest has balloon device by default, does not have balloon
device when disabled. Ballooning via cli functions by default,
return not supported when running vm has ballooning compiled out.
Change-Id: I737851496fe4c14cdbb69c48e6edf1ca9186c15a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3786928
Tested-by: Zihan Chen <zihanchen@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Zihan Chen <zihanchen@google.com>
This closes the deltas between some of the files of the crate. The
changes include
- Enables building/testing balloon module on windows.
- Suppressing dead-code warnings on windows in cross platform files.
- u16 to enum fix.
- Organizing imports.
- Using Descriptor(windows friendly) over RawDescriptor.
- Using Option<Tube> instead of Tube.
- Fix some args parsing on windows.
BUG=213149155
TEST=presubmit and built on windows downstream
Change-Id: Idd2ee81384bc5fade610aa864b2c712ea0a0e0d2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3783010
Tested-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
This adds a sync thread that will call `fsync` once a second. This is a
safety measure since Window OS handles flushing automatically, but has been
proven to be somewhat unreliable.
TEST=built and presubmits
BUG=b:233951530
Change-Id: I7f5922da09fd95999bf8a7a40abc3b6ae796eafc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764466
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Richard Zhang <rizhang@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>
Add a VAAPI video decoder backend. This backend is able to decode frames
by calling into the VAAPI driver in the system. It does so by making use
of a libva wrapper crate that exposes a subset of the VA C code in safe
Rust.
BUG=b:214478588
TEST=virtio::video::decoder::backend::vaapi::tests::test_get_capabilities
passes on Hatch.
Change-Id: I52ac6b5b915d9c3a9b55381e1076c1b5ac0dfb5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3514624
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commented out code reference sandbox crate, which still needs to be
upstreamed
Still need to enable:
* balloon (try_clone not implemented)
* console (Need to enable Serial)
* snd (Unix code not conditionally compiled out)
* gpu (Waiting for graphics team to upstream)
BUG=b:237011316
TEST=ran "./tools/run_tests --target=host --arch=win64 --verbose"
Change-Id: I1b5f7ae575365351184042bc65cffcfd7efe999a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3721870
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>
The previous configuration made us pull in three different versions of
rand, and depending on "*" is a recipe for API incompatibility.
crosvm-fuzz needs to match its rand version to the rand_core used in
common/cros_fuzz, so that will be upgraded separately.
BUG=b:236978141
TEST=cargo build
TEST=emerge-hatch crosvm
Change-Id: I655ed3f156e4ac43afa3122596f62e9caa43b4f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3722184
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
We depend on both lazy_static and once_cell, which do basically the same
thing.
The once_cell crate has a few advantages:
- once_cell is on track to be included into libstd.
(https://github.com/rust-lang/rust/issues/74465)
- once_cell doesn't require macro magic.
Replace the uses of lazy_static with their once_cell equivalents so we
don't need to pull in both crates.
BUG=b:236191006
TEST=tools/presubmit --all
TEST=tools/run_tests --target=host --arch=win64 --build-only
TEST=cargo test --features=plugin
Change-Id: I7cabcd837ef4878e8e8ae635bb4f235a58e4cae3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3707624
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Implement `WhpxSplitIrqChip` for `whpx` (Hyper-V) which has a split IRQ
chip architecture. Add dependencies for the root `whpx` feature on the
`devices/whpx` feature set.
BUG=b:213149158
TEST=Compiled on windows.
Change-Id: I3b0aec441b5abdff3f0266a9467380b0cdc4fdee
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3717187
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
Due to the way we allow arguments to be specified I was not able to
reuse Config structure for cmdline arguments. (eg we allow multiple ways
to specify same config)
There is still some usage of arguments mod that we need to cleanup
later.
Change-Id: Ia0c12d508d0a10d17f58944de71276e5984d69ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3684144
Auto-Submit: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Anton Romanov <romanton@google.com>
Add `tsc` as a device. Includes operations to calibrate and sync the
TSC values across the physical cores in order to minimize variations
found when moving vcpu threads across cores.
BUG=b:234508273
TEST=Compiled.
Change-Id: I5c79deebc9471dacf9d6596384ee77a8811a58bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3682118
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
The virtio video decoder device is currently only available under very
drastic conditions: a build linked against libvda (a ChromeOS-only
library that needs the cros chroot to be built and linked against), and
a ChromeOS-flavored Chrome instance running alongside crosvm, so the
browser can provide the video decoding service through Mojo.
This makes the decoder device very difficult to develop on for
non-Chromies, and also for Chromies actually since they will always need
a DUT to test it on.
This patch introduces an alternative decoder backend based on
ffmpeg's libraries that performs decoding on the host's CPU. It supports both
guest pages and virtio objects as target, and can be considered a
reliable and predictable way to test the decoder in any environment.
We introduce our own ffmpeg bindings after a quick state of the art
revealed that the existing ones were all unsuitable, either for
technical or licensing reasons. Doing so is also not a big effort and
does not add any new external crate dependency to crosvm.
BUG=b:169295147
TEST=cargo test --features "video-decoder,ffmpeg" -p devices ffmpeg
TEST=v4l2r's simple_decoder example decodes test-25fps.h264 properly with the
following command:
./simple_decoder test-25fps.h264 /dev/video0 --input_format h264 --save test-25fps.nv12
TEST=ARCVM Android youtube plays videos correctly when the ffmpeg
backend is used.
Change-Id: Ic9c586193f7939f2a3fe59d009c3666585a8bbc7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3026355
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
On Unix, instead of getting random data from `/dev/urandom`, it will get
it from the `rand` platform agnostic crate instead.
OsRng.fill_bytes on unix will make a syscall to getrandom(2) if
available, otherwise it will read from `dev/urandom` after a succesful
poll to `dev/random`. Regardless of which way a random data is
retrieved, if the entropy pool is not intialized, `fill_bytes` will
block until it is intialized. This shouldn't be a problem because it is
a one time cost.
This CL will also upstream the Windows implementation of the rng device.
BUG=b:213149162
TEST=built and presubmits
Change-Id: Ic017f11795f8006e0bf2a04eb0478b3a3d336507
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3657812
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>
Splits the vhost-user device into unix & Windows components, and
upstreams the Windows side. Note that we can't build devices on Windows
yet in crosvm because we have to upstream a fair bit more first
(net_util, cros_async, the vmm side of the vhost-user device).
Since net_util isn't upstreamed yet, we've made some very minor changes
to keep things consistent & building on Linux.
TEST=unix is tested by bots upstream & downstream; windows is tested by
bots downstream only.
BUG=b:226233737
Change-Id: Ie3f9818ff93c9e0085a5434055f9dc71c6f6851c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3549854
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
As we are going to introduce more media-related crates, reserve the
"media" folder as a placeholder for them, starting with the existing
libvda.
BUG=b:169295147
BUG=b:214478588
TEST=cargo build --features "video-decoder,video-encoder,libvda"
Change-Id: I1b2ec65cbba8b735db3d19845c504546fa1c64ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3565623
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Use our new serde_keyvalue crate to annotate the SerialParameters
structure and allow us to create it from a key-values string. Add tests
to help ensure parsing doesn't break in the future.
The existing arguments can be parsed identically by this new code, so
replace the old serial options.
BUG=b:218223240
TEST=cargo test -p devices serial_device::tests::params_from_key_values
TEST=cargo test parse_serial
Change-Id: I4898a45399b69b87a44f80d3a214daf081b06173
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3439670
Reviewed-by: Anton Romanov <romanton@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Add optional `uuid` argument to `--vvu-proxy` so a user can specify a
UUID that will be stored in virtio_vhost_user_config space so that the
guest can read the value by reading /sys/devices/pci*/*/resources.
We can use this value to allow the guest to know the socket path that
the VVU proxy device uses.
BUG=b:215472603
TEST=pcimem /sys/device/pci.../resource0 0x2008 b*16,
where 0x2008 == (DEVICE_CONFIG_BAR_OFFSET + offset in vvu config)
Change-Id: I99f1d988cb793b44682ddf927837139dabd42cf8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3516669
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
At the moment compiling with the "virgl_renderer" feature enabled but
"x" disabled results in a link error because the virgl_renderer enables
all its platforms without checking. Fix this by enabling the glx
platform only if the x feature has also been enabled.
BUG=b:226033718
TEST=`cargo build --features "virgl_renderer"` passes.
TEST=`cargo build --features "virgl_renderer,x"` passes and enables GLX
in virgl_renderer.
Change-Id: I85041fc2a3db7e49415add69389bee3160ba4a5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3539327
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
As we make progress on upstreaming sys_util, we do not want more
dependencies on sys_util added. This check helps in that cause.
With this change only files that are inside common can depend directly
on sys_util.
Test: python3 ./tools/impl/check_code_hygiene.py common/sys_util_core
Bug: b:213149154
Change-Id: I57a8cb9189d3263a4031338b302cb27da799f4de
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3473344
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Add a crate containing an API for controlling the balloon. This is done
by reusing the API between the control socket and the balloon device.
BUG=b:213962590
TEST=compiles
Change-Id: I5d89d5ebee55162d28ba45ca2c49b7083561b916
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3394440
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
Motivation: get rid of required options vs help boilerplate
BUG=n/a
TEST=run_tests
I've also done some binary size testing as well:
Baseline:
text data bss dec hex filename
5050303 264640 1072 5316015 511daf crosvm
StructOpt:
text data bss dec hex filename
5400901 277104 1072 5679077 56a7e5 crosvm
StructOpt, default-features = false
text data bss dec hex filename
5418437 275872 1072 5695381 56e795 crosvm
argh
text data bss dec hex filename
5024287 262648 1072 5288007 50b047 crosvm
Change-Id: I7ebe09e38d3854c4a0e5c8e3a2aecb123652ce1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3339792
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Anton Romanov <romanton@google.com>
Auto-Submit: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
Add utilities to bind a vfio-pci device, which will be used in
the virtio-vhost-user driver.
This works like the following use of DPDK's devbind script [1].
$ dpdk-devbind -b vfio-pci 'Bus:Slot.Func'
[1]: https://doc.dpdk.org/guides/tools/devbind.html
BUG=b:194137301
TEST=cargo test in devices
Change-Id: I67fb34ae2ad55320231751ea553a2094bb8cdde4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3295303
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-by: Abhishek Bhardwaj <abhishekbh@chromium.org>
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
While running alsa_conformance_test against the virtio-snd device, the
driver will randomly stop getting irq events forever. (vp_interrupt will
never get called).
At the same time, the host device will still see an uncleared
`interrupt_status` so the `trigger_interrupt` -> `signal`
will just drop the interrupt signal on
the host device side. And the device can't be used forever when the
issue happens.
Root cause:
Irq resample events never get handled in the virtio-snd device, so the
interrupt handler in guest just can't get notified if there are some
unhanded interrupts in the irq line during the resample event.
Changes:
- Add `f_resample` future in the run_worker
- Use `select!` from futures crate with `async-await` feature
- Change local interrupt in run_worker to Rc<RefCell<interrupt>>
- Use anyhow::Context for errors
BUG=b:202368198
TEST=vm.AudioAlsaConformance.virtio_cras_snd
TEST=Run alsa_conformance_test multiple times in guest VM
Change-Id: Id1440420dcfeccbbb455b1d342863e430ef4b6f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3317327
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
For the crosvm externalization project, we want to be able to compile
video support without libvda, which is only supported on Chrome OS.
Add an explicit "libvda" feature to crosvm and make all the libvda code
depend on that feature, so any trace of libvda can effectively be
compiled out.
For compatibility, the "libvda" feature is selected by the
"video-decoder" or "video-encoder" features.
BUG=b:161774071
BUG=b:169295147
TEST=`cargo build --features="video-decoder,video-encoder"` results in a
crosvm binary with libvda enabled.
Change-Id: Ice3d3089b73b77f6b009400953063f2cf8f385da
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3026351
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Remove the crates.io patch from the top-level Cargo.toml and make
devices point to the third_party/vmm_vhost location directly, since
vmm_vhost has been forked in crosvm and cannot be replaced by the
crates.io version anymore.
Incidentally fixes this warning from cargo:
warning: patch for `vmm_vhost` uses the features mechanism.
default-features and features will not take effect because the
patch dependency does not support this mechanism
BUG=b:205511695
TEST=cargo build
TEST=tools/presubmit --quick
Change-Id: Id29578b57f7540805cf85a3db9a09542b7b84825
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3299125
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>