Commit graph

5378 commits

Author SHA1 Message Date
Alexandre Courbot
feba776773 media: cros-codecs: factorize dummy backends
The dummy backends behave the same regardless of the codec, so factorize
their declaration as well as their implementation of VideoDecoderBackend
to avoid duplicate code.

BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs

Change-Id: Ibaa694b885c1ccf969aed3a0cb167a254e0eaab5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4060492
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-11-30 01:21:49 +00:00
Daniel Verkamp
430f3eeb02 base: replace WaitStatus with std::process::ExitStatus
No need to reinvent the wheel - the standard library provides a
reasonable equivalent of this type.

BUG=None
TEST=tools/presubmit

Change-Id: Id7abada4c955a6e87bca735e7879dab2a38cb33c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4062051
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-30 00:31:31 +00:00
Daniel Verkamp
d570328520 swap: remove Cargo.toml data_model patch
Fixes compiler warning:

  warning: patch for the non root package will be ignored, specify patch
  at the workspace root:
  [...]/src/platform/crosvm/swap/Cargo.toml
  [...]/src/platform/crosvm/Cargo.toml

The top-level crosvm/Cargo.toml already specifies the patch, so we can
just remove it from swap/Cargo.toml

BUG=None
TEST=cargo build --features=swap
TEST=emerge-brya crosvm

Change-Id: Icdb9c7745478552ac01f07bdd5c799feff3f69a0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4062050
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-29 23:33:36 +00:00
recipe-roller
e8334d74aa 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/8796124855259523825

depot_tools:
141be0c7fe
  141be0c (chanli@chromium.org)
      [depot_tools] roll led

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: I9bd7e9311045300d08afdc02ffe0701171ecff73
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4064112
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-11-29 22:07:42 +00:00
Dennis Kempin
b157bda3ee tools/run_tests: Run some tests as root
Testing tap functionality requires root privileges. The crosvmdev
user of our dev_container is set up for passwordless sudo, so we can
seamlessly execute these tests via sudo.

For running on the developer workstation directly, this will prompt
for a password, which is disruptive to workflows. The --no-root
option can be used to prevent this and skip the tests in question.

BUG=None
TEST=tools/run_tests [--no-root]

Change-Id: I731887837affceb76152466f0006c4ee51a19234
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4063237
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-11-29 19:40:36 +00:00
recipe-roller
354bd50590 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/8796177074670177601

recipe_engine:
67bac822e5
  67bac82 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 7d56fc0f58a4 to 7a04ca7c0fd3

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: I607d0fca71f8a0821f0edecdd1bd301edd806825
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4063303
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-11-29 08:18:57 +00:00
Shintaro Kawamura
eee4f337df swap: log metrics of vmm-swap
This is for debugging purpose.

BUG=b:215093219
TEST=none

Change-Id: Idb5e09c2e06b719bff9ab7a0ead4d55f1f44c304
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4060494
Auto-Submit: Shin Kawamura <kawasin@google.com>
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
2022-11-29 07:38:38 +00:00
Richard Otap
c2ff5b359e devices: virtio: vsock: Use async locks in async contexts
In the vsock code, we use a mutex to protect our connections `HashMap`
so that we can have access to them from multiple async tasks. We were
using a regular synchronous mutex for this, which could cause the async
tasks to block on these mutexes, possibly leading to blocking up the
executor and deadlocking vsock.

We haven't observed any bugs or deadlocks that are directly attributable
to this; it's likely that we are managing to avoid this by not holding
the lock over await points. We should still fix this for correctness, as
we have no way to otherwise enforce that future changes should uphold
the current guarantees.

BUG: b:247548758
TEST: Built and ran crosvm downstream.
Change-Id: I8928514be491f111887fbf1adac7a3f8b38219dd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4062047
Commit-Queue: Richard Otap <rotap@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
2022-11-29 04:12:33 +00:00
Richard Otap
2594731840 devices: virtio: vsock: Use async event without reset
When receiving guest data, we wait on an event after writing them out to
the named pipe so that we know that the write has completed. This resets
the event. Then we call `GetOverlappedResult` with `bWait` set. While
this does behave correctly because `GetOverlappedResult` checks the
internal status of the request before waiting, there's no need to have
the event get reset here.

BUG: b:255635953
TEST: Built and ran crosvm downstream.
Change-Id: Ic031821dda1e7ae696dfafa812afa4c0b6cff0ec
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4062049
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Richard Otap <rotap@google.com>
2022-11-29 04:09:19 +00:00
Richard Otap
616e84ae54 win_util: Fix DLL notification tests
The DLL notification tests were flaky because we were trying to test an
operation that is somewhat asynchronous from the actions of the test
itself. We would see failures at a pretty low rate because the DLL we
were trying to observe unloads for would not necessarily unload
immediately, or within a short timeout of when we would expect it to
unload.

This was exacerbated by the test using the same DLL for the load and
unload portions of the test. This would add another layer of
nondeterminism about what the state of the test runner process was which
we were trying to deterministically observe.

We can fix this by doing two things:

  1. Introduce some synchronization to allow us to wrangle the
     asynchronous nature of the test.
  2. Use different DLLs for the load and unload tests.

By implementing these changes, the flakiness doesn't appear anymore
after running the test a few thousand times.

BUG: b:229288169
TEST: cargo test --package win_util --lib -- dll_notification
Change-Id: Id6aa216ed91bd9e13523118bcee1b352d511a883
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4062048
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Richard Otap <rotap@google.com>
2022-11-29 04:03:47 +00:00
recipe-roller
2595d3d679 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/8796193432384060785

depot_tools:
fc04ff1628
  fc04ff1 (jwata@google.com)
      Call ninja.py from compile_single_file.py

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: Ia02a3c1aaf001c3158fee84e7e980e8cb9c375dd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4063231
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-11-29 03:56:58 +00:00
Takaya Saeki
c2e4e70b4f seccomp: Make the compiler fail on error
Currently, build.rs doesn't handle errors from the seccomp compiler
correctly, and build.rs doesn't fail. Due to that, when you have a bug
in seccomp policy files, `cargo build` fails in later stages with
misleading error messages complaining about missing file.

With this change, build.rs fails when the seccomp compiler fails. Since
the build phase fails correctly, cargo shows the stderr from the seccomp
compiler correctly.

BUG=None
TEST=build succeeds

Change-Id: I5645ffabd5ece8888053ac62014bb8ca22d3b9bb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4054809
Commit-Queue: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Zihan Chen <zihanchen@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-11-29 02:05:32 +00:00
recipe-roller
a540b26e1b 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/8796203498914022753

depot_tools:
9a6aa08468
  9a6aa08 (victorvianna@google.com)
      Suggest --no-fetch flag after git rebase-update conflict

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: Iad8f1f34da3766a62362a135d6652cff96899792
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4062845
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-11-29 01:18:12 +00:00
Alexandre Courbot
171752d9ee serde_keyvalue: fix parsing of quoted strings in a sequence
Parsing a quoted string as the last element of a sequence would fail
since ']' was not recognized as a separator. Fix this and factorize the
code recognizing separators into a single function to prevent this kind
of issue from happening again in the future.

BUG=None
TEST=cargo test -p serde_keyvalue

Change-Id: I1367da843787c40fb6c15a615d7cd036bddd1381
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4054812
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-11-29 00:24:44 +00:00
Dennis Kempin
ad37ad97dd Remove mold dependency
We will not be using mold and will explore other linker alternatives.
Even though the package was installed, it was not actually used
anywhere. So it's safe to remove.

BUG=None
TEST=None

Change-Id: Iffcd6704d22b6b09d17ce8da8f44253b8ccdf9da
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4062836
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
2022-11-28 23:12:49 +00:00
recipe-roller
7f177878c5 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/8796212928781561201

depot_tools:
84edf22d0e
  84edf22 (vapier@chromium.org)
      repo: update to 2.30 launcher

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: I89e867d8f9eed9fb0c22c840eb6e20858683fc3c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4062052
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-11-28 22:50:27 +00:00
recipe-roller
e80ae2471a 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/8796220485714742881

depot_tools:
738b48a0bf
  738b48a (travislane@google.com)
      Avoid full fetches with gclient sync --no-history

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: I2db4a20fa24edd3edb92ad317921561cc36b2de5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4060242
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-11-28 20:46:06 +00:00
Changyuan Lyu
c3da0b936f cmdline: Add Gpu only when feature gpu is on
crosvm could not compile without this patch if feature `gpu` is not
turned on.

TEST=tools/presubmit
BUG=b:260607247

Change-Id: Idcaad60862d56d8e0ebb47b3bbec42da757e3162
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4060240
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Idan Raiter <idanr@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-11-28 20:21:03 +00:00
Daniel Verkamp
f50029e071 kernel_loader: accept physical address offset
This interprets the p_paddr field of ELF program headers as an offset
into physical RAM on aarch64 systems, which is a change in behavior. We
pass an offset of 0 on x86-64, so it makes no difference there.

BUG=b:254601048
BUG=b:255697205
TEST=cargo test -p kernel_loader

Change-Id: I9ebaa285c4cde1f70cb7752e91ff4520e06dc82f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4035738
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-28 19:41:53 +00:00
Daniel Verkamp
94f130c23d crosvm: remove argument module
Everything has been migrated to argh and serde_keyvalue, so we can
remove the old argument parsing code now.

The parse_hex_or_decimal() function is still used in a few places in
config.rs, so move it there for now.

BUG=b:255223604
TEST=cargo build

Change-Id: Ic2d66a7fac7c3ff00b9521c56a719dd23883284b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4049038
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-11-28 19:22:30 +00:00
Daniel Verkamp
a444d2592e config: parse --userspace-msr with serde_keyvalue
This removes the last caller of parse_key_value_options().

BUG=b:255223604
TEST=cargo test

Change-Id: Ia17eb320094ee3d46f0db238f2077163e257b7f8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4049037
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-28 19:18:06 +00:00
Keiichi Watanabe
2eb36ff983 base: syslog: Preserve stderr FD when spawning
We need to keep stderr FD when spawning processes. Otherwise, log
messages won't be emitted to stderr.
This affects the cases where we spawn device processes such as:
* "crosvm run" without --disable-sandbox,
* virtiofs device, which create its own jail,
* "crosvm devices", which spawn sub processes

BUG=none
TEST=check log messages in virtio-{block,fs} are shown in stderr

Change-Id: If60845d73290a42c863e6c6f4e75869644f659d0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4054212
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-28 19:12:37 +00:00
Daniel Verkamp
ea7a5f2b3a devices: pci: stub: parse arguments with serde_keyvalue
Migrate the --stub-pci-device parameters to serde_keyvalue from
parse_key_value_options().

The deprecated `multifunction` option is dropped, as the only caller was
crosvm-direct.sh and it has since been fixed.

BUG=b:255223604
TEST=cargo test -p devices stub
TEST=Run crosvm with --stub-pci-device options; lspci

Change-Id: I3ed0cf52179020bcd1665540dc9bc9e66e17b85e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4049030
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-28 18:55:40 +00:00
recipe-roller
14caa2558e 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/8796231807336053585

depot_tools:
d83509c0c3
  d83509c (gavinmak@google.com)
      Move presubmit_canned_checks tests under tests/ and fix

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: If20322f42e5e2679046198d6b22f5142ca7c5201
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4060239
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-11-28 17:47:35 +00:00
Pujun Lun
d17c3e78b5 crosvm: fix the default value of use_vulkan for Windows.
Missed an "s" in the feature flag.

BUG=b:254284360
TEST=presubmit

Change-Id: Iecdb93daca291bc65e61019b484569e25010241e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4059394
Commit-Queue: Pujun Lun <lunpujun@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-11-28 16:40:44 +00:00
Daniel Almeida
ea95da182d video: decoder: vaapi: refactor BufferMapping through AsBufferHandle
BufferMapping could previsouly hold a BufferHandle. Make it more generic
so that it can hold types that can convert themselves to a BufferHandle
instead.

This also simplifies the type considerably, as it only takes a single type
parameter instead of two.

BUG=b:214478588
TEST="cargo build --features=video-decoder,vaapi; Fluster still works"

Change-Id: Idcaf4d0a074609e3155daa596e262810149fe037
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4046944
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-11-28 04:32:49 +00:00
Daniel Almeida
0d7683960a video: decoder: vaapi: move VaapiDecoderSession closer to its impl
Move VaapiDecoderSession closer to its impl for tidiness. Also, if
BufferMapping - which is currently in the middle of them - is extended,
we do not want to widen this gap even further.

BUG=b:214478588
TEST="cargo build --features=video-decoder,vaapi"

Change-Id: I1045e04a313e5d7ee62b313f42923333192ac722
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4046943
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-11-28 04:22:06 +00:00
recipe-roller
ab112e8148 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/8796493535133803569

depot_tools:
0115386a26
  0115386 (brucedawson@chromium.org)
      Switch from VS 2017/2019 support to VS 2019/2022

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: I1c5dcf11b18fc15d422087ecfa1b4c0cdd93bedc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4058046
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-11-25 20:29:04 +00:00
Pujun Lun
38182f458e crosvm: merge --gpu-display into --gpu in CLI.
Now that serde_keyvalue is capable of parsing vectors and
sub-structs, we are making the following pattern the official way
of providing display parameters:

--gpu backend=3d,displays=[[mode=windowed[800,600]],\
    [mode=borderless_full_screen]]

The reasons for this change are:
(1) We will likely use this syntax for other CLI options as well.
(2) We only support one single virtual GPU as of today, but
    technically we could support multiple. When we add that
    support, there is no ambiguity as to which display is connected
    to which GPU with this syntax.

For backwards compatibility, we will preserve the following ways to
provide display parameters:
(1) --gpu width=800,height=600 (which implies windowed mode)
(2) --gpu-display mode=windowed,width=800,height=600 \
        --gpu-display mode=borderless_full_screen

BUG=b:254284360
TEST=presubmit

Change-Id: I7f0078b7cf7554c1e93882afce47a4a2a3170a78
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3984545
Commit-Queue: Pujun Lun <lunpujun@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-11-24 18:06:22 +00:00
Pujun Lun
81f42c1a36 crosvm: update CLI syntax for specifying DPI for displays.
The current syntax is:
--gpu-display horizontal-dpi=100,vertical-dpi=200

We would like to change that to:
--gpu-display dpi=[100,200]

We will keep the backward compatibility for now, but the caller
should not use both of syntax at the same time.

FixedGpuDisplayParameters is introduced for backward compatibility
support, and it will be removed once the old syntax is deprecated.

BUG=b:260101753
TEST=presubmit

Change-Id: I66a31c448ecc1eba60f6d1cbcbc753315c6c1df6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4049340
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
Commit-Queue: Pujun Lun <lunpujun@google.com>
2022-11-24 17:43:55 +00:00
Takaya Saeki
e299f02d3f seccomp: allow clone3 to video_device on x86
Recently, common_device.policy added clone3. It is included by most
devices through include, but the video device missed it since it doesn't
include common_device.policy due to some policy override.

This commit adds clone3 to the policy of the video device to fix that
problem. With this fix, the video device successfully runs in the
sandbox on newer kernels.

BUG=None
TEST=a vm with a video device launches with the sandbox enabled

Change-Id: Idc2dee824e863f3ee43cfd6ce76656e36d6200c0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4053447
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Takaya Saeki <takayas@chromium.org>
2022-11-24 09:40:27 +00:00
Alexandre Courbot
cd34ddcff7 docs: book: document how to specify command-line options and configuration files
Document the format and rules for specifying command-line options, and
add a section on how configuration files can also be used.

BUG=b:218223240
TEST=mdbook build

Change-Id: Ieec40315b7ae8212c6a5b60280440abc9a5e92e6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4040820
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-11-24 09:28:57 +00:00
Keiichi Watanabe
e060d6c639 e2e_tests: Add vhost-user block with devices command
BUG=b:243127910
TEST=./e2e_tests/run

Change-Id: I22dfc4e1d75ff0b310a5f624568b390d2dba6c1e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4054811
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-24 09:16:00 +00:00
Keiichi Watanabe
6adf8e8a15 crosvm: cmdline: Improve "devices"'s help for block device
Describe the `vhost=<socket>` option, which is not in `crosvm run`'s
help.

BUG=none
TEST=crosvm devices --help

Change-Id: If95e3eaf8d11632de9034a3ac3b44ecd377e887a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4054810
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-11-24 09:16:00 +00:00
Keiichi Watanabe
d9d74da342 e2e_tests: Add vhost-user block test
BUG=b:243127910
TEST=./e2e_tests/run

Change-Id: Iae16498f79f1395a6aa7ab834addc3e30d767164
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3820966
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-24 08:49:34 +00:00
Keiichi Watanabe
6ec82a2305 e2e_tests: fixture: Move VM-specific logic to a separate module
To prepare adding more fixtures such as logic for vhost-user device,
move the existing code to create a VM to a separate module.
Specifically, move the all code in e2e_tests/tests/fixture/mod.rs into
e2e_tests/tests/fixture/vm.rs.

BUG=b:243127910
TEST=./e2e_tests/run

Change-Id: I23e6e5db35ce09b5003f37a9a44f9fda8f502809
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4028760
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-24 08:14:05 +00:00
Keiichi Watanabe
c789769acf devices: virtio: fs: Include tag name in worker thread name
This will allow us to identify virtiofs threads in tracing tools such
as perfetto.

BUG=b:260038313
TEST=run arcvm

Change-Id: I198b599a3f710742fc549ab6ae376ad4cb661fc0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4045667
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-24 04:57:25 +00:00
Keiichi Watanabe
5e35436666 devices: virtio: Shorten virtio worker threads' names
Rename each virtio device's worker thread name to the form of
"v_{device type}".
e.g. "v_blk" for virtio-blk

This change allows us to embed more information in the thread names
whose length must not exceed 15. For example, we can embed ID for each
block device thread so we can distinguish threads in `ps` and tracing
tools.

BUG=b:260038313
TEST=CQ

Change-Id: I039421c46e9b28f2cb82f7fc644929ba325e895a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4045666
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-24 04:52:45 +00:00
Keiichi Watanabe
5b456d31f9 vmm_vhost: slave_req_hander: Wait before vhost-user message body
When vhost-user front-end send a vhost-user message via Unix domain
socket, a message header is sent first with optional attached files.
Then, a message body is sent as a separate packet if necessary.
However, the existing implementation blocks only before a
message header coming and assumed that the message body is ready when
the header comes. So, there was a race and `handle_request` could return
`EAGAIN`.

This CL splits SlaveReqHandler::handle_request() into recv_header() and
process_message() so a caller can wait between the header and the
additional payload.

On VVU, we shouldn't wait before receiving the payloads because the
proxy device forwards a header and its message body together. So we
check the protocol in needs_wait_for_payload().

BUG=b:237891754
TEST=Run vhost-user block on Linux
TEST=Run vhost-user block on Windows
TEST=Run VVU block on Linux

Change-Id: I35af3eb0e706cb005bf697397698e01e272b0704
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3863050
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-24 04:21:56 +00:00
recipe-roller
c5eff6497e 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/8796660249901124465

recipe_engine:
ff5ce51cea
  ff5ce51 (sshrimp@google.com)
      Revert "Check created_by to ensure cq tags were copied on retry...

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: I5fb062358357e9fd96892593ee106d8a833b1f5c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4054540
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-11-24 00:17:43 +00:00
Daniel Verkamp
d928670ce8 windows: remove set_bootstrap_arguments()
This function is not called anymore, so it can be removed.

https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3846055

BUG=b:238361778
TEST=tools/dev_container tools/run_tests --platform=mingw64

Change-Id: Ie7bb0b2eafb0643693376c560d08b486dd404907
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4049029
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
2022-11-23 19:10:38 +00:00
recipe-roller
61be9ecf94 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/8796733867438855377

recipe_engine:
189a0bb4a1
  189a0bb (akashmukherjee@google.com)
      [bcid] Uprev provenance broker tool.

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: Id8ba7421e1c41060ccba1224a5c1e5e36e4ac5a2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4050117
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-11-23 04:47:49 +00:00
recipe-roller
205aa45951 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/8796738271362991841

depot_tools:
60af816019
  60af816 (zhihuixie@google.com)
      depot_tools: Roll rdb and result sink

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: Icd691e699cabe75f6edc5e0af373a186179de6c8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4050114
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-11-23 03:37:25 +00:00
Alexandre Courbot
e8cbbb457c crosvm: rename executable_path positional argument to kernel
This is a shorter and more explicit name, and is also what qemu uses for
the same parameter.

Since this is a positional argument, it doesn't affect command-line
argument handling, only the (currently unused) configuration files.

BUG=b:255223604
TEST=None

Change-Id: Ice01335a690550e5afd05b93c6c968b0d0859f32
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4044726
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-11-23 01:58:23 +00:00
Alexandre Courbot
07fc7dbecd crosvm: use kebab-case for disk options
The rule for crosvm options is that they should be specified in
kebab-case. Switch the disk options to that format, while also keeping
camel_case aliases for compatibility.

BUG=b:255223604
TEST=--block option works with both block-size and block_size
parameters.
TEST=cargo test -p devices block::tests::params_from_key_values
TEST=cargo test -p e2e_tests boot_test_vm

Change-Id: Ie095565ca4b27d59ed86ddc0613419e45749b3fa
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4040818
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-11-23 01:57:04 +00:00
Elie Kheirallah
daa000e659 crosvm: cmdline: Add Snapshot command to crosvm
Bug=b:232437513, b:253937826
Test=cargo build

Change-Id: I3e90e5dc86e53a7b2fa0eae6be2f63fcb91a345e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3924744
Commit-Queue: Elie Kheirallah <khei@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Elie Kheirallah <khei@google.com>
2022-11-22 23:04:56 +00:00
recipe-roller
92811aa9de 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/8796757134052351249

recipe_engine:
6fefccf8bd
  6fefccf (bpastene@chromium.org)
      Allow chrome branch projects to call cq recipe_mod's owner_is_g...

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: I754eae9986c00da65e68533ddd17b56891ce87ca
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4049482
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-11-22 22:37:29 +00:00
Takaya Saeki
984a2f7c8b devices: virtio: improve the comment on a memory fence in Queue::peek
Improve the comment on why a fence is necessary in the middle of
`Queue::peek` so that it gets clearer.

BUG=b:258630435
TEST=`./tools/dev_container ./tools/presubmit` passed

Change-Id: I63f80975e6d04665948a6036998e7ed6e24be64c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4045661
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-22 11:22:22 +00:00
Alexandre Courbot
59530f1e1a crosvm: fix --net documentation
The documentation for the --net command-line option was not properly
formatting and had a few trailing words. Also add an OR keyword to
clarify that the keys are mutually exclusive.

BUG=b:255223604
TEST=crosvm run --help

Change-Id: Ib0980c3294828eeccf00e3609b21d829c5da9fb1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4040819
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-11-22 02:42:00 +00:00
recipe-roller
0181c12b23 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/8796834531760911953

depot_tools:
30e3ce8b1c
  30e3ce8 (ukai@google.com)
      Roll out goma client VERSION=255

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: I9370aa823339d9ed5b2b72fc3741927a7162af93
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4043495
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-11-22 02:11:28 +00:00