The test_target.py script is not longer directly executable
but the test runner would still be pointed at it when used
for iterative development.
BUG=None
TEST=./tools/test_target set vm:aarch64 && source .envrc && cargo test
Change-Id: Id179fe83cd1f449d266576340a2f6f46e63c2878
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3784340
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
When the shared memory feature is enabled, there is a bug in how the
driver handles vfds without an associated pfn. Disable the feature bit
until the bug is fixed.
BUG=b:213532601
TEST=crostini.CopyPaste.wayland_to_x11_buster_stable
Change-Id: Ic5f68e167e8ee8f4c990d0c4d73149e60b3ce908
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3789166
Commit-Queue: David Stevens <stevensd@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
We want the ffmpeg crate to be independent of crosvm - remove a
dependency to base by adding a dedicated trait for types that can be
used as sources to a ffmpeg buffer.
BUG=b:169295147
TEST=v4l2r's simple_decoder can decode a H.264 stream.
Change-Id: I2ae6c2678a6a672746e6fc11a70dee692986db69
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782032
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
This method's result is always used as a dyn AsRawDescriptor, so it's
more flexible to directly implement AsRawDescriptor here instead of
restricting the return type to Event.
BUG=None
TEST=cargo test --features "video-decoder,ffmpeg" -p devices video
Change-Id: Ib911ba671f819106169cde049fda6cb12ebaa4b6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782034
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
The use of AV_CODEC_CAP_DR1 is not obvious from its name alone, so add a
comment about what we are doing here.
BUG=None
TEST=cargo build --features "video-decoder,ffmpeg"
Change-Id: Ib1d38c878ce761fafa85e57076e6d429f63495b5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782033
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Initializing gralloc may spawn threads, so it needs to be done after
sandboxing the wl device. Initializing gralloc requires expanding the
wl device's sandbox. Rather than trying to maintain a new dedicated
minijail configuration for wl, reuse the gpu's configuration. This
should be sufficient, since virglrenderer has to open minigbm within the
sandboxed gpu process.
BUG=None
TEST=ARCVM and crostini GUI on volteer, zorc-arc-r, grunt-arc-r
Change-Id: I291fb59c665a8ba65058a6f55dee959c839bb43c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3787936
Commit-Queue: David Stevens <stevensd@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Tested-by: David Stevens <stevensd@chromium.org>
We only need to enforce a lifetime to the data source of the packet ; we
are not interested in its type. Replace it by () and remove that generic
parameter.
BUG=b:169295147
TEST=cargo build --features "video-decoder,ffmpeg"
Change-Id: Ibd9e976cab9dcc9cf0a44487580eb067211cc9b8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782031
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
The GPU can be heavy on fd usage (fences, dma-bufs, eventfd and
shmemfds per context, etc). Increase the limit.
BUG=b:207515789, b:237224199, b:240092999
TEST=cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.DecodeAccuracyTest
Change-Id: Icae6652d173614a809a5fc27b2c85910d57e6bb3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3788603
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Rob Clark <robdclark@chromium.org>
Tested-by: Rob Clark <robdclark@chromium.org>
Non-trivial rolls are sent to OWNERS, which may not be familiar
with the changes.
BUG=b:239081770
TEST=./infra/recipes.py test run
Change-Id: I55c4c8e9a81812c7238c36e95edd512072df9491
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3785280
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Loading 32-bit images is needed for kvm-unit-tests.
BUG=b:233317135
TEST=boots, new unit tests
Change-Id: I6ba63255e0e2993f3735ef81489f64dbd0bb6374
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764465
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Steven Richman <srichman@google.com>
Tested-by: Steven Richman <srichman@google.com>
Commit-Queue: Steven Richman <srichman@google.com>
Being able to build an AvCodec means that the returned name will be
valid - unless there is a bug in libavcodec itself. Simplify the method
returning the codec's name to not return an Option, but instead a string
representing an invalid codec in the unlikely case we actually get one.
BUG=None
TEST=cargo build --features "video-decoder,ffmpeg"
Change-Id: Ic2c1b5db5391c421ae6f78faabcfe3197090ce17
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782030
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
`available_interrupt_enabled` as a name didn't tell us a whole lot about
what the method did and why. This CL renames it to
`queue_wants_interrupt`, which seems a little closer to describing
interrupt suppression.
This CL also converts the comment to a proper docstring.
BUG=b:235414140
TEST=builds
Change-Id: I885b917d40e6c86c44ff37542999734cdcf00874
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3781295
Commit-Queue: Noah Gold <nkgold@google.com>
Tested-by: Noah Gold <nkgold@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
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>
Refactor how rx messages are processed, so that the processing code can
be shared with the slave_req_fd.
BUG=b:201745804
TEST=launch sibling VM on manatee
Change-Id: Iecb88c5129d7b3aa8c46a64c24cce61f1e0a0b14
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765016
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Update the vvu driver so that it sends and receives data as discrete
vhost-user messages instead of as a byte stream. This will make it
easier for vvu to intercept transmitted messages, and it allows the
receiving code to be somewhat simplified.
The device implementation already processes received data as full
messages, and doesn't currently examine transmitted messages, so it
doesn't need to be updated.
BUG=b:201745804
TEST=launch sibling VM on manatee
Change-Id: I94a7437a28136e682d2002a34e5f0b7d29d9c238
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765015
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Switch virtio-wl to the new shared memory APIs.
Using the shared memory APIs requires establishing mappings based on
shm offset rather than raw pfn. This means virtio-wl needs to manage its
shmem address space itself, rather than relying on
VmMemoryDestination::NewAllocation. To maintain compatibility with older
drivers, a feature bit is used to determine whether drivers expect
mappings to be specified by shm offset or by pfn.
BUG=b:201745804
TEST=launch crostini gui app
TEST=crosvm device wl --wayland-sock $XDG_RUNTIME_DIR/wayland-1 --socket /tmp/vhost.sock
TEST=crosvm ... --vhost-user-wl /tmp/vhost.sock ...
Change-Id: Ia559de7107130440c8f81a30aab1f6b061d15118
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765014
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Rename cras-snd to snd for Vhost User Device. But cras-snd is still used
for crosvm params.
BUG=b:220649000
TEST=tast run vm.AudioAplay.vhost_user_cras and aplay
Change-Id: Id1990a1cc91a25481db823108862d8e0ce320658
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765006
Commit-Queue: Norman Bintang <normanbt@chromium.org>
Tested-by: Norman Bintang <normanbt@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Extract Parameters from common_backend to its own modules.
Move unix specific code for VirtioSnd to virtio::snd::sys::unix.
Expose the unix specific function/enum following the style guide.
BUG=b:233542268
TEST=emerge and call aplay
Change-Id: Id9bbed8dde8df71489742b79d3fdec1b4a42ef76
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765010
Commit-Queue: Norman Bintang <normanbt@chromium.org>
Tested-by: Norman Bintang <normanbt@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Do not use a reference when it's not safe to call minijail.fork() multiple
times.
BUG=b:238646369
TEST=build
Change-Id: I91def471ef64ef11ba32032ccc095d5282362d62
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3779079
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
Tested-by: Junichi Uekawa <uekawa@chromium.org>
The code to manage the EventDevice buffers was a little tricky to
follow. This CL refactors it.
BUG=b:239699447
TEST=builds. Tested downstream.
Change-Id: I979643ed82dc69544d2073d09f55a52a4cc3bb39
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782777
Tested-by: Noah Gold <nkgold@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Noah Gold <nkgold@google.com>
Specify the type so cargo doc can find the right async_from function.
Fixes a warning when running tools/cargo-doc.
BUG=None
TEST=tools/cargo-doc
Change-Id: Ida4431cd663d4b5959a58a707c9c89d7569df986
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764043
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Make the function reference in the docs into a link so it's easier to
follow in the generated HTML docs.
BUG=None
TEST=tools/cargo-doc
Change-Id: I1dbf2f02deb547422c2d8c3a17b892fc96b6f448
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764042
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Permissions should be properly set up now.
BUG=b:239081770
TEST=None
Change-Id: I05906a289791e4296d76bc0f807faa80456bff24
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780869
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Notifies the current crosvm oncalls when post-submit is failing.
BUG=b:238234148
TEST=lucicfg validate
Change-Id: I747f70d3abfb5dd26dedfcb2ed230122e063967f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3783012
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Most of our VhostUserBackends require an Executor to be constructed,
which interferes with our wish to jail them: we want to create the
VhostUserBackend before the child process gets forked, but the forking
process would render the Executor invalid in the child.
Work around this issue by introducing a VhostUserDevice trait which is
supposed to include all the device state without its runtime. Once the
child process is forked, the device can be converted into a
VhostUserBackend using its into_backend() method.
This new trait is illustrated using the Console device.
BUG=b:217480043
TEST=cargo build
Change-Id: Ifc7525aae39da8fdb19fcd237832213c9223a56d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3762973
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Morg <morg@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
A listener is responsible for managing and cleaning up its own
resources, but this can cause problems when jailing device processes.
Typically, the listener is created in the parent thread and then passed
to the device thread so the device thread does not require the
capabilities to allocate the listener's resources. However, when cleanup
time comes, the listener in the child is still responsible for
destroying the resources created by the parent, which may require extra
capabilities. For instance, for a vhost-user socket the listener is
expected to remove the socket file, but we don't necessarily want the
child to be able to remove files from the filesystem...
Fix this by adding a new method, take_parent_process_resources(), that
can be called prior to creating the child process by the parent in order
to obtain the resources that the parent needs to cleanup when the child
process exits. The resources are presented in the form of an opaque box
and must be kept by the parent until the child process exits. After
that, dropping the box will free the resources that we don't want the
child to clean up.
If we are not creating a child process, then the method is simply not
called and the listener will cleanup the resources itself.
BUG=b:218223240
TEST=vhost-user console device gets properly cleaned up.
Change-Id: I7b8c4b700a868f4fd100c45f0e577fddfe8bb216
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3762972
Reviewed-by: Morg <morg@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
send_report used to panic if we tried to send more events than would fit
in the buffer. Now overflow is handled gracefully. We've also increased the
buffer size, which was previously quite tiny, so that we're less likely to drop
events if there is a flood of them.
BUG=b:239699447
TEST=builds. tested downstream.
Change-Id: Ie4b9d927bb75c6a3126de17e781d4a3e18551f7c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780879
Commit-Queue: Noah Gold <nkgold@google.com>
Tested-by: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Directly allocate dma-bufs within the virtio-wl process and remove the
VmMemoryRequest::AllocateAndRegisterGpuMemory type. This is preparation
for migrating to the SharedMemoryMapper interface.
BUG=b:201745804
TEST=Launch arcvm, launch gedit w/crostini, launch gedit w/vhost-user-wl
Change-Id: I232f1fd3dfdb8d7ed068c6b3c2ea23f35d0ddabc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765012
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Make status queue properly optional. As part of this, refactor how the
optional event queue is handled, to prevent exponential growth in the
number of select statements needed to handle optional queues.
BUG=None
TEST=ARCVM boots and balloon works
Change-Id: I55d59875b7e0223a57f1c8c5d0e0d8a4a6b9a26c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3779083
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Currently this only builds and runs for Windows
BUG=b:213149155
TEST=built and presubmits
Change-Id: Icc874da61c987fc36c4c9ccea56bd136d660f453
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764469
Tested-by: Richard Zhang <rizhang@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
When running tools/cl on a branch without an upstream set, ask if the
user would like the script to fix it automatically.
BUG=None
TEST=tools/cl upload # on a new branch with no upstream
Change-Id: Id5f4ee30058a209ac352013159d09278cd92a23b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780873
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
It was missing in some commands. Also runs them when no command
is specified. This will ensure the git hook is installed and
print documentation when calling: "./tools/cl"
BUG=b:239823229
TEST=./tools/cl
Change-Id: Id2248310011f4692cf477ac51d52b578d2f00a8d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780868
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
The doc was long outdated.
BUG=b:239823229
TEST=None
Change-Id: If324c7b3fe22f03df4307a5eed1002465b5cce4d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780867
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
We want to ensure that ChromeOS workflows to not break over time.
This is the primary supported workflow for building and testing
crosvm.
BUG=b:239255196
TEST=led get-builder luci.crosvm.ci:chromeos_amd64-generic | led
edit-recipe-bundle | led launch
https://ci.chromium.org/swarming/task/5c3a9bd9490cad10
Change-Id: I3afed9ebeff3ac2829fc7990ff520c24017ac812
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780866
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>