Replace the source code links with the documentation pages for the
devices that have them.
BUG=None
TEST=mdbook build docs/book
TEST=Verify that devices/index.html links to the right pages
Change-Id: Ie7e61adec9326466b2e1236fed4e768c2d5d3dd9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3691975
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
This change will allow the guest to start a new VVU device backend
after an old VVU device backend process exited due to sibling
disconnection.
More specifically, this CL will allow the vvu-proxy to support scenarios
like follows:
1. A device backend starts in the guest and a sibling VM connects to
the socket.
2. The sibling VM shuts down. Then, the device backend process exists in
the guest. And, the vvu-proxy's state is changed from `Running` to
`Activated`.
3. Return to 1.
Note that we don't support more complicated reconnection scenario such
as:
* reconnection after sibling's unexpected crash
* restart after device backend's unexpected crash
To support the reconnection feature, the vvu-proxy device needs to clean
its status when a sibling disconnected. Specifically, it needs to
* reset virtqueues' state,
* unregister memory regions that it registered via VmMemoryRequest, and
* update the device state from the worker thread.
BUG=b:216407443
TEST=run on workstation; sibling could reconnect after the first
instance exits.
Change-Id: I4c01e6069484ff74a0d643edd6a3b3231fb5c2d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3602361
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reworks the way we organize parameters to this module, and
adds CPU manufacturer detection.
BUG=213152505
TEST=builds
Change-Id: Ibb96f08cacbdfdaff5ef971c3d6d7b901b5d73fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3690369
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Noah Gold <nkgold@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This APIC is used by the userspace irqchip (to be upstreamed soon).
Original author: Steven Richman <srichman@google.com>
BUG=213152505
TEST=builds
Change-Id: I51b89e96af88f2f1c08998b70053fc37bd3cfcaf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3696535
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
This function is used to generate cpuid leaf 15H in some situations.
BUG=213152505
TEST=builds
Change-Id: Ia5a7c46b32f1bdba366a500caa650edb2e3ae99f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3696534
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Noah Gold <nkgold@google.com>
This crate has been copied upstream verbatim. This crate is used as an
audio backend for playback (capture has not been implemented yet).
The next CLs are will upstream the usage of win_audio.
Bug: 232462411
Test: built and presubmits (although this crate won't be built locally or
presubmits yet)
Change-Id: Iae374b2b575fbd19b016cae403a00024896cba56
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3694097
Commit-Queue: Richard Zhang <rizhang@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This CL will:
* Fix the test in ipc_memory_mapper for Windows
* Conditionally compile out the Vfio error for Windows
On Windows, when one end of a Tube is dropped, the underlying named pipe
connection will be severed. `response_tx` could be dropped due to a race
condition, so this CL fixes that.
BUG=b:234497712
TEST=built and ran test
Change-Id: I4a8b475e117639fd3615cbf9e958aac8af1d00f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3696672
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Richard Zhang <rizhang@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 description for the command would get lumped together into a single
line by argh, so move the description of which options are valid
together into the descriptions of those options instead.
BUG=None
TEST=crosvm create_qcow2 --help
Change-Id: Ie465a678de1df063e921d0f308b214c5a6b103c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3694096
Reviewed-by: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
There's some ring related wrapping math for interrupt suppression
(aka VIRTIO_F_EVENT_IDX) that had some documentation, but was still a little
tricky to follow. This CL adds some diagrams & further details.
BUG=none
TEST=n/a
Change-Id: I591661a676eb6506fbfea2afa20da28aaa1722f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3689972
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
This doesn't split iommu submodules into their own sys directory. That
will be done in subsequent CLs.
BUG=b:213149162
TEST=built and presubmits
Change-Id: I66c4e9b7dec730f259b9f94adac5a39cb0d2ff48
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3692397
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The Infra console view is replaced with a list view, since
the builds are no longer just post submit builds.
BUG=b:233913643
TEST=lucicfg validate main.star
Change-Id: Ia1ccc75251ccdb7ae567418235e2bf8b7d6aa16a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3692687
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
To enable the merge bot on luci we had to solve a couple of problems:
- We cannot use http cookies for auth, so added gcloud auth into
merge_bot.
- Switch back to original HEAD after running merge bot. Otherwise
the version of the merge_bot script can change between invocations.
- Do not soft reset when checking out crosvm source.
- For less invasive testing, also added a few more exceptions when
using MERGE_BOT_TEST so it won't email, etc.
- Rename to update_chromeos_merges, as it is more fitting to what
the bot is doing
BUG=b:233913643
TEST=https://ci.chromium.org/swarming/task/5b58ed4497fda510
Change-Id: Iaa9b4821b70a1e90d19637d01856196bd7852ed5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3692686
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
http://crrev.com/c/3592633 make `run_with_listener` generic, but did not
update the cras vhost-user device to use this new version.
BUG=None
TEST=Chrome OS build succeeds.
Change-Id: I82342e3a2505dc97e5cdaa1749b9091fb986fa35
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3694880
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Remove `TestVm`'s `debug` field and print guest outputs unconditionally.
This won't make the test log messy because the output is hidden unless
the test case fails.
BUG=none
TEST=./integration_tests/run
Change-Id: Ica77492229b547f2e244f2751992869b00b78f7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3686716
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Forward crosvm command processes' stdout/stderr to the test process's
stdout so that the messages will be hidden by `cargo test` unless the
test case fails.
BUG=none
TEST=./integration_tests/run with/without additional panic!() in a test
Change-Id: Ife290fb5333fd792cabdad35acea54732f864610
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3686715
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
These fields were reported as never read by the compiler.
BUG=None
TEST=cargo clippy --features "video-decoder,video-encoder,libvda"
Change-Id: I7580fa9161ba8239398bb7a5b547d67c0c2591e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3685675
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Since `Self` implements Copy, these methods can and should take their
parameter by value.
BUG=None
TEST=cargo clippy --features "video-decoder,video-encoder,libvda"
Change-Id: I13c4ed627e4cddc1873cf8fa6e3d5c9ac89eccd5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3685676
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The run_with_listener() method can now be made generic and be used for
both the socket and VVU handlers.
BUG=b:229554679
TEST=vhost-user console device works.
TEST=vvu console device works.
Change-Id: Ic1ae286e573383d6b66c8a406227d6cf51cbd578
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3592633
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
The async methods of the socket VVU handler were calling the non-async
accept() on a dedicated thread so the async method does not get blocked
awaiting for a connection. This socket-specific behavior forces us to
have dedicated code for the socket and VVU handlers.
Fix this by adding a poll_descriptor() method to vmm_vhost's Listener
trait that returns a descriptor that callers can poll on if a call to
accept() can block. This way we can wait for the connection
asynchronously and avoid using a thread for that. It also opens the way
towards factorizing the socket and VVU specific code.
BUG=b:229554679
TEST=vhost-user console device works.
Change-Id: I3fbc96d3904f777c6165b04564f577c553ce55d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3592632
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Add an async_from_local() method, which does the same thing as
async_from() (create an IoSourceExt for asynchronous I/O), but without
the requirement that the passed argument implements Send. Async I/O
sources created that way can only be used in thread-local executors.
BUG=b:229554679
TEST=cargo build
Change-Id: Id4cd0cb177e5fed4b72fab12a6f82f964b9bac28
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3670773
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
All the Path::new(string var) are very repeptitive and completely
unnecessary
Change-Id: I05e86bcf9ad35519cd74ed8de78c4ddabd88abe0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3680296
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
Usage: crosvm disk resize <DISK_INDEX> <NEW_SIZE> <VM_SOCKET>
resize disk
Positional Arguments:
DISK_INDEX disk index
NEW_SIZE new disk size
VM_SOCKET VM Socket path
Options: --help display usage information
Change-Id: I416aae6bc898bef39870a9b3252405b1cdd9bc88
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3680294
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Anton Romanov <romanton@google.com>
Usage: crosvm create_qcow2 <PATH> [<SIZE>] [--backing-file <backing-file>]
Create Qcow2 image given path and size Either SIZE or --backing-file need to be specified
Positional Arguments:
PATH
SIZE
Options: --backing-file path to backing file
--help display usage information
Change-Id: If8e82836cec7edca1b6f8a7173cc2200a7308455
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3675076
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
BUG=None
TEST=mdbook build # test that rustup ref becomes a clickable link
Change-Id: Ieea42a363130ca42cea6db9133e2a8de94a1d275
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3691970
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
A few of the cfg_if blocks got misaligned somewhere along the line, and
cargo fmt won't rewrite code inside macro invocations, so we have to fix
them manually.
BUG=None
TEST=stare at whitespace
Change-Id: I1ccf7aff7c7827a2687ab5fa50cc192c79d6400b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3691968
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@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>
Add the ffmpeg libraries needed by the ffmpeg decoder device backend and
bump the dev_container and testvm to include them.
BUG=b:169295147
TEST=./tools/install-deps
TEST=./tools/dev_container
Change-Id: Ifc07b9599403aa1ed18a96067ada1fa2efa6e13c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3685682
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Our BIOS doesn't set the TSC MSR to 0 on boot, but our hypervisors need
this to be set so they can correctly sync their TSC offsets. This
introduces a generic "reset_msrs" function where we currently reset the
TSC msr, but where we could also reset if we need to in the future.
Cherrypick from downstream branch.
Actual author: Colin Downs-Razouk <colindr@google.com>.
BUG=191981229
TEST=tested downstream
Change-Id: I17b5709411394ae48fb5d7310636636295ebfaad
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3690370
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Noah Gold <nkgold@google.com>
This change enables memory mapping of the vfio device doorbell regions so
we can access the vfio bar more efficiently by limiting the scope of the vvu
device interactions with the guest kernel.
BUG=b:231938067
TEST=built and run, verified vvu communication happens as expected
Change-Id: I16925d99a467d44ce7f74316770f1c665de75433
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3670459
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Morg <morg@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Morg <morg@chromium.org>
The outer set of parentheses is redundant.
BUG=None
TEST=emerge-kevin crosvm
Change-Id: I482e04601b0f7a3ef22221a77c00ef746bbd288a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3691969
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>