Commit graph

4273 commits

Author SHA1 Message Date
recipe-roller
1884bfd37f Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8807460800788590689

depot_tools:
a84a16b863
  a84a16b (jojwang@chromium.org)
      [no-sync] Set _should_sync and add flag to control if the exper...

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: Ied7550edf3e8d2735137a98e019de28e276166ab
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3790041
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-07-27 19:08:38 +00:00
Dennis Kempin
1061a4fd02 tools: Fix path to test_target script
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>
2022-07-27 18:07:28 +00:00
recipe-roller
e90ad40006 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8807475899405330961

depot_tools:
882f1e2a9a
  882f1e2 (brucedawson@chromium.org)
      Treat UnitTests failures as presubmit --all errors

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I6f04f37b5a2be3900a4bd4f4fd5b10f6a1d0566a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3789484
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-07-27 15:06:28 +00:00
David Stevens
bdba48b64b wl: disable wl shared memory feature
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>
2022-07-27 07:39:08 +00:00
Alexandre Courbot
49c8cd6160 media: ffmpeg: reduce dependency on base
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>
2022-07-27 07:30:48 +00:00
Alexandre Courbot
6dbad5033c virtio: video: decoder: remove event_pipe() from EventQueue
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>
2022-07-27 02:46:48 +00:00
Alexandre Courbot
8e9ebcbfed virtio: video: decoder: ffmpeg: add comment
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>
2022-07-27 02:43:18 +00:00
David Stevens
01e2724335 devices: wl: initialize gralloc after sandboxing
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>
2022-07-27 01:54:48 +00:00
Alexandre Courbot
ad05940dcf media: ffmpeg: remove generic type from AvPacket
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>
2022-07-27 00:24:18 +00:00
Rob Clark
605573283d crosvm: Increase GPU's fd limit
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>
2022-07-26 22:27:23 +00:00
Dennis Kempin
738325c402 infra: Make denniskempin@ reviewer on all recipe changes
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>
2022-07-26 21:41:21 +00:00
Frederick Mayle
92e4fc9e75 aarch64: Don't add goldfish battery to fdt when not present
TEST=tools/presubmit
BUG=b:239577091,b:240298654

Change-Id: Idb171a4e326fcb2fba5ce788c40b97dcea3058f6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3787271
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-26 21:30:27 +00:00
Steven Richman
e3259f6319 kernel_loader: load elf32 images
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>
2022-07-26 16:10:07 +00:00
Alexandre Courbot
1cb3c121ee media: ffmpeg: simplify codec name method
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>
2022-07-26 03:46:06 +00:00
Noah Gold
7b7de4744b devices: rename interrupt masking method.
`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>
2022-07-25 22:25:36 +00:00
recipe-roller
ea3e862746 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8807639476834124417

recipe_engine:
cfdb92cc69~..4b7ba01b8ce8d4052feff1408188ef7932351b91
  cfdb92c (akashmukherjee@google.com)
      [snoopy] Uprev client provenance reporter tool.
  4b7ba01 (olivernewman@google.com)
      [analyze] Fix py3 incompatibility

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I2274677af1efd0b8739f23f40ac1eaf61adfabc3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3786913
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-07-25 19:51:55 +00:00
recipe-roller
eb781d8daa Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8807645768636838561

recipe_engine:
5db4d2294a
  5db4d22 (mohrr@google.com)
      [lint] Fix Py3 'Disallowed import' failures

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I27943ee42721469009380baa22f813b74d94de31
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3781439
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-07-25 18:05:05 +00:00
Vikram Auradkar
02028483bc devices: resync with downstream
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>
2022-07-25 17:24:15 +00:00
recipe-roller
15e1e977d2 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools, recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8807654577509529489

depot_tools:
9585c93796~..647cfe6bf10efa3e171bed867a455347567007c7
  9585c93 (chanli@chromium.org)
      roll dirmd
  164952a (qyearsley@chromium.org)
      Revert "Update lucicfg from version 1.31.5 to 1.31.6"
  904ca29 (chanli@chromium.org)
      [depot_tools] roll led
  f3edc50 (jojwang@chromium.org)
      [no-sync] Store previous sync commit in memory.
  7298625 (tikuta@chromium.org)
      recipes: use python3 for git_footers.py
  16d08f0 (tperrotta@chromium.org)
      git-cl: parse baseurl arguments eagerly
  0ba2fd4 (brucedawson@chromium.org)
      Get full paths in presubmit traceback stacks
  fcb6206 (tperrotta@chromium.org)
      Add a fetch config for chrome (internal).
  debf640 (tperrotta@chromium.org)
      Add a fetch config for devtools (internal).
  36bf3a8 (tperrotta@chromium.org)
      yapf: remove unused `re` import
  77da3f2 (jojwang@chromium.org)
      Fix flaky testRecursedepsCustomdepsOverride.
  647cfe6 (vapier@chromium.org)
      pylint: drop unversioned program

recipe_engine:
0ade4d7c8f~..8f92d0c510bcddd3c369a14d222ecc18d7c63783
  0ade4d7 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 46e5b6417320 to 9fbd373abf97
  a53cb2c (iannucci@chromium.org)
      [manual_roll] Allow manual_roll to work even when protoc breaks.
  e57338e (iannucci@chromium.org)
      [luciexe] Update engine to emit build streams with MergeBuild.
  65f334b (iannucci@chromium.org)
      [legacy_annotation] Allow recipes to specify legacy mode.
  5226416 (iannucci@chromium.org)
      [legacy_annotations] Only merge properties if legacy_global_nam...
  8f92d0c (iannucci@chromium.org)
      [python3] Allow repos to be python3-only.

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I937ed8fad6dfc4574d4f876f659465d16257d824
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3784097
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-07-25 15:44:05 +00:00
recipe-roller
c3c9a30f42 Roll recipe dependencies (nontrivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8807913781035944545

Please review the expectation changes, and LGTM+CQ.

depot_tools:
90191b14c2
  90191b1 (tikuta@chromium.org)
      recipes: use vpython3 in gerrit recipe modules

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=crosvm-bot@crosvm-packages.iam.gserviceaccount.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I1474a3f19ac83349b0e21afaab1d2963eb8b8bef
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3781675
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-07-25 15:27:25 +00:00
David Stevens
589905763f devices: vhost-user: wl: add vvu support
Add vvu support to vhost-user-wl.

BUG=b:201745804
TEST=launch crostini gui application on ManaTEE

Change-Id: I3f8416c2de0419e4ef517866c964fd0c32b3f2a0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765018
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-07-25 11:38:36 +00:00
David Stevens
5451eaf8b3 devices: vvu: proxy: refactor rx processing
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>
2022-07-25 11:38:36 +00:00
David Stevens
2210612621 devices: vvu: update vvu to frame full messages
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>
2022-07-25 11:38:36 +00:00
David Stevens
3426ed71c9 wl: switch to shared memory regions
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>
2022-07-25 11:34:45 +00:00
Norman Bintang
f4a900b5e9 audio: Rename cras-snd to snd for Vhost User Device
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>
2022-07-25 07:21:45 +00:00
Norman Bintang
0ee75b0c8e audio: Reorganize VirtioSnd unix specific code
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>
2022-07-25 07:08:35 +00:00
Junichi Uekawa
fa0370918f crosvm: Make ProxyDevice to be safer.
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>
2022-07-25 05:44:36 +00:00
Noah Gold
fdfc96bde6 gpu_display: clean up EventDevice buffer mgt.
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>
2022-07-22 20:58:23 +00:00
Daniel Verkamp
84c58c7958 cros_async: fix unknown function warning in docs
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>
2022-07-22 19:50:43 +00:00
Daniel Verkamp
0a5f9fc411 crosvm_control: linkify max_usb_devices reference
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>
2022-07-22 19:50:43 +00:00
recipe-roller
4b08a1d393 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools, recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8807915042097938257

depot_tools:
8168f76753~..f05fcf7051e12e5b561b8811e299096f332157f7
  8168f76 (qyearsley@chromium.org)
      Update lucicfg from version 1.31.4 to 1.31.5
  ea11cc3 (gavinmak@google.com)
      Remove apply_patch_on_gclient property
  26460d8 (thestig@chromium.org)
      Fix typos in PDFium fetch config.
  f05fcf7 (qyearsley@chromium.org)
      Update lucicfg from version 1.31.5 to 1.31.6

recipe_engine:
428eeaebf2
  428eeae (iannucci@chromium.org)
      Update buildbucket protos.

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I8d0cc71f9f87a9b3e1c5ce222e118e6f90a87f88
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3781672
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-07-22 18:48:03 +00:00
Dennis Kempin
cd867d0089 infra: Re-enable recipe roller
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>
2022-07-22 18:27:14 +00:00
Dennis Kempin
2341f7715b infra: Enable post-submit email notifications
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>
2022-07-22 18:19:59 +00:00
Alexandre Courbot
6f8f396312 virtio: vhost-user: introduce VhostUserDevice trait
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>
2022-07-22 04:57:58 +00:00
Alexandre Courbot
eb9e563e4d virtio: vhost: user: allow listener to yield resources for parent process
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>
2022-07-22 04:57:58 +00:00
Noah Gold
5cbe496fde gpu_display: fix overflow in EventDevice
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>
2022-07-22 04:48:28 +00:00
David Stevens
a22f74428b vhost_user: add support for shared memory regions
BUG=b:201745804
TEST=compiles

Change-Id: I389e14f457942398323b01a5ffccf5d9d153dfb2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765013
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
2022-07-22 02:30:59 +00:00
David Stevens
e9673a428a wl: allocate dma-bufs in process
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>
2022-07-22 02:28:09 +00:00
Junichi Uekawa
6e7a617abb crosvm: Make commands work.
Previewing docs, from CONTRIBUTING.md or from the dev_container, it's
`cd docs/book`.

BUG=None
TEST=copy-paste

Change-Id: If56a9f83c6722764b0979b6738f96a0800031da6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3779081
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-22 02:05:48 +00:00
Dennis Kempin
89f754b0be docs: Fix link to building_crosvm.md
BUG=None
TEST=mdbook build docs/book

Change-Id: I5331cb9fed056c8b57171ba3db4d5b2521e6995c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782185
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-22 01:52:58 +00:00
David Stevens
6d7143990a balloon: Improve optional queue handling
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>
2022-07-22 01:27:23 +00:00
Richard
a5df8a52c0 devices: Upstream virtio vsock
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>
2022-07-22 00:29:48 +00:00
Mike Gerow
0c49f872a1 devices: add pflash to provide NVRAM for OVMF
This change adds a pflash implementation similar to the the one QEMU
has[1] for the purpose of giving OVMF a place to store BIOS settings and
UEFI variables. Unlike the QEMU version, though, this one only
implements the parts that OVMF relies on[2], and is therefore much simpler.

[1]: https://github.com/qemu/qemu/blob/HEAD/hw/block/pflash_cfi01.c
[2]: https://github.com/tianocore/edk2/tree/master/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c

TEST=tools/presubmit --all; boot VM under OVMF and confirmed UEFI
variables can be set and are persistent
BUG=b:238344840

Change-Id: I83bebb57006f39c6f0eb7ee4986c6af0e64de0bc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764374
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Mike Gerow <gerow@google.com>
Commit-Queue: Mike Gerow <gerow@google.com>
2022-07-21 23:17:32 +00:00
Vikram Auradkar
2314c4701b crosvm: Fix drift
BUG=b:213146388
TEST=presubmit

Change-Id: I59e6b7ad7aff8d4659c62e310a7955146a10d743
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3777405
Tested-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-07-21 23:13:18 +00:00
Daniel Verkamp
5a4ed32368 tools/cl: add prompt to set upstream branch if missing
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>
2022-07-21 21:51:48 +00:00
Daniel Verkamp
32ba2688bb tools/cl: add prune to usage text
BUG=None
TEST=tools/cl --help

Change-Id: If4e632b00b04c9ab4644c37c039372969abf8c3a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780872
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-07-21 21:44:18 +00:00
Junichi Uekawa
15c09e6d7f crosvm: Spell fix.
BUG=None
TEST=None

Change-Id: I88830bdf8023f8e812e33bf6326f0dd39e970c61
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3779078
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
Tested-by: Junichi Uekawa <uekawa@chromium.org>
2022-07-21 21:34:18 +00:00
Dennis Kempin
290622c389 tools/cl: Always run prerequisites
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>
2022-07-21 18:50:48 +00:00
Dennis Kempin
12d4f71cb2 Update CONTRIBUTING.md
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>
2022-07-21 18:35:51 +00:00
Dennis Kempin
163494513c infra: Add cros_workon flow to chromeos builder
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>
2022-07-21 18:35:51 +00:00