Commit graph

5204 commits

Author SHA1 Message Date
Vikram Auradkar
d8f3e272df tools: Call clippy for mingw64 from presubmit
BUG=b:257249038
TEST=CQ

Change-Id: I6331bf60666b8583aeb11eae3e245d4f0e0e528b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4000812
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-11-03 18:36:41 +00:00
Vikram Auradkar
afcaa35ab8 crosvm: Fix windows clippy warnings
BUG=b:257249038
TEST=CQ

Change-Id: Iffb53295fbe64b31b4f68e217f6b522e4231e61c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993933
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-11-03 18:36:29 +00:00
Vikram Auradkar
90a92c697d tools: Add --platform arg to tools/clippy
BUG=b:257249038
TEST=CQ

Change-Id: Ife9a917b82508a97beda6c50e8d3d71dccfa520d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4000811
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-11-03 18:36:29 +00:00
Abhishek Bhardwaj
4eae67aaec crosvm: Log invald args error to both syslog and stderr
Currently an error message while parsing arguments goes to only stderr.
It's useful to send it to both syslog and stderr via error! so that
it's evident via crosvm failed (if syslog is present).

BUG=b:251305451
TEST=Send rubbish arguments to crosvm and observe stdout.

Change-Id: Iccbd0a637391f72ddadae447019cf6957635a63b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4000482
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Abhishek Bhardwaj <abhishekbh@chromium.org>
Commit-Queue: Abhishek Bhardwaj <abhishekbh@chromium.org>
2022-11-03 01:23:23 +00:00
recipe-roller
d642fc8048 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/8798560270293415713

recipe_engine:
3b472dd35e
  3b472dd (iannucci@chromium.org)
      [doc] Update proto schema conversion to handle py3 bytes type.

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: I8a7e160889213fe45a00f0354d7bcc666b31a18d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4001082
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-03 00:56:01 +00:00
Richard Zhang
3e2d8fcffb win_audio: Change Activate audio interface completion event to be unnamed
Since we will be allowing for multiple audio streams soon (1 playback and 1 capture), we will need a unique completion event name for each stream. Otherwise, if multiple streams are created around the same time, they would be listening for the same event, which would result in bugs where some streams would be notified when they shouldn't have.
This also prepares us for having >1 playback and >1 capture streams as well, if we ever want to have that.

Bug: 253509368
Test: ran emulator and verified sound still works
Change-Id: Id53a4c233579c0ffba750b6663111e6c02f02dfd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3997600
Commit-Queue: Richard Zhang <rizhang@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
2022-11-03 00:14:20 +00:00
Richard Zhang
c253b82416 win_audio: Refactor out some methods in DeviceRenderer that can be shared
The future DeviceCapturer object will use a lot of the functionality for DeviceRenderer. This CL will refactor these methods so that they can be shareable.

TEST=In downstream branch, ran emulator, verified sound still works
BUG=b:253509368

Change-Id: I468eafeab0a9741332a360638b267366c06fe944
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3994883
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>
2022-11-02 23:46:47 +00:00
Dennis Kempin
86034fd5fb base: Move clone_equality test to integration test
In non-privileged containers, comparing a file descriptor may not
work. So the test will not work in every runtime environment.

BUG=b:244623061
TEST=dev_container --podman --unprivileged tools/run_tests base:base

Change-Id: Ifa67e11db9694c36b47cd5ae88de9247284e1cdf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3999711
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-11-02 22:29:12 +00:00
Daniel Verkamp
11322f007d tree-wide: use LFS variants of libc functions
Use the off64_t versions of libc file functions.

There is no Rust libc crate equivalent of the C _FILE_OFFSET_BITS and
related defines, so we have to use the Linux-specific *64 variants
explicitly.

This extends the size of file offsets to 64 bits instead of 32 on
platforms with 32-bit userspace.

(It also fixes the recently introduced check for non-LFS functions in
ChromeOS - see b/201531268 for details.)

BUG=b:201531268
TEST=emerge-kevin crosvm
TEST=start Crostini on kevin

Change-Id: Ife42917c8896d4fa1ccd78051c2a0b7dd565b2b3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3979975
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-02 22:20:18 +00:00
Richard Zhang
24ed80fd99 win_audio: Upstream Windows audio backend code
The most notable changes are:

* Playback Async support
* Audio Client flags to hide app from SndVol when audio session has
  expired
* Updates to audio_streams and cros_async crates for playback async
  support

BUG=b:256655413
TEST=Verified to work downstream

Change-Id: Ifbe9a15791feaa41d6e1d5eaf2c5824b2c7c25b8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3994882
Commit-Queue: Richard Zhang <rizhang@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
2022-11-02 21:07:37 +00:00
Daniel Verkamp
8d69b30c14 docs: update book for embedded seccomp
The seccomp policy files are no longer needed at runtime since they are
embedded in the crosvm binary.

BUG=b:235858187
TEST=mdbook build docs/book

Change-Id: Ib8220bce01a21bd3b4a1ef749468e12b18377a62
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3999176
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-02 20:32:24 +00:00
Daniel Verkamp
3121cbace9 config: remove seccomp policy path fallback
Now that seccomp policies are always embedded in the crosvm binary, the
default /usr/share/policy/crosvm path that was used when embedded
policies were not present can be removed.

BUG=b:235858187
TEST=tools/presubmit --all
TEST=emerge-kevin crosvm

Change-Id: I10f3380297e2629f404db8a264c82e2c6c844316
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3999175
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-11-02 20:31:35 +00:00
Dennis Kempin
a7b5a94480 tools/cl upload: Add a few convenience flags
--try: set CQ+1
--autosubmit: Set Auto-Submit and CQ+1
--submit: set CQ+2
--reviewer: Set a username as reviewer

BUG=None
TEST=This CL was uploaded with:
tools/cl upload --autosubmit -r dverkamp

Change-Id: I1ec9834d2f5d365eaa500e8e5915c77a4f066c6b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3997873
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-02 20:20:47 +00:00
Daniel Verkamp
be900c3aae build.rs: find compile_seccomp_policy via which
If a copy of the compile_seccomp_policy program that is used to generate
BPF versions of the seccomp policies is available in the $PATH, use it
in preference to the one in the submodule.

This makes the ChromeOS ebuild able to embed seccomp policies, since it
has compile_secomp_policy installed as part of the cros_sdk, so the
special case for CROSVM_BUILD_VARIANT is removed.

BUG=b:235858187
TEST=emerge-kevin crosvm # with submodules deinitialized

Change-Id: I30f23a507ee444bc3fe5d78af394fbe651191be0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998113
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-02 20:18:42 +00:00
Elie Kheirallah
47a7306703 devices: add empty Suspendable impl for virtio devices
Add supertrait Suspendable to VirtioDevice

Bug=b:232437513
Test=cargo build

Change-Id: I4e69b08a29a98efb3e4eedc3e9ed402ccb0f8eb8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3983119
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Elie Kheirallah <khei@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Elie Kheirallah <khei@google.com>
2022-11-02 19:54:50 +00:00
recipe-roller
54d73fa51b 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/8798580410139071009

depot_tools:
7fb87695ee
  7fb8769 (chanli@chromium.org)
      [depot_tools] move lucicfg pin

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: Iad03ba8db45c03f81427f86318ee6795abbcadd2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3999707
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-02 19:34:56 +00:00
recipe-roller
23b24c4e49 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/8798582921769249889

depot_tools:
7326ca218b
  7326ca2 (bsheedy@chromium.org)
      Add post upload Python 3 option

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: Icb9773cf79f6b40aa8c52b7604bbe1febacb4de3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3999705
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-02 18:56:36 +00:00
Daniel Verkamp
e8fe4b2400 aarch64: provide initial vcpu regs via vcpu_init
The code from configure_vcpu_early() is split into two parts:
1. vcpu_features() returns the `VcpuFeature`s required for vcpu.init()
2. vcpu_init() returns the general register state

This makes use of the new generic vcpu_init code path and moves the
general purpose register initialization into configure_vcpu() rather
than the ARM-specific confgiure_vcpu_early() to be consistent with other
architectures. Only the vcpu.init() call needs to happen before irqchip
is finalized on ARM, not other register setup.

BUG=b:237095693
TEST=tools/presubmit --all
TEST=Boot Crostini on trogdor

Change-Id: Ib3eab946ba9f1e407f339c2119d36d280655066f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3786979
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-02 18:08:46 +00:00
Dennis Kempin
5097b46a62 Fix p9/fuzz build
A search/replace broke the toml file. Fuzz builds are currently
not included in upstream builds.

BUG=None
TEST= USE=fuzzer emerge-amd64-generic dev-rust/p9

Change-Id: I9a42d8a18bc60d137f50fb44581e2e47db259f87
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3999265
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-02 17:24:51 +00:00
Dennis Kempin
389a02462d dev_container: Install tmux and mold
tmux can be used to run presubmit checks in parallel:

  $ tools/presubmit --tmux

And mold is a faster linker that will be used for experiments.

BUG=None
TEST=None

Change-Id: Ie332d7285aa94d9072e201a3cac825337ae825cb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3997872
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-02 01:56:48 +00:00
Alexandre Courbot
0bea1ffe17 Cargo.toml: strip symbols with the "chromeos" profile
ChromeOS binaries are stripped, so let's reflect this on the equivalent
profile.

BUG=None
TEST=`cargo build --profile chromeos` yields a stripped binary.

Change-Id: I0491e422f1ea6121aaeb6d08edaf9a9e42a9ee14
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3995886
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-11-02 00:17:59 +00:00
Dennis Kempin
a0dcf8ab13 Generate constants.json offline
The constants.json file is generated for compiling seccomp polices,
but is only ever added to in newer versions of linux.
Generating them in build.rs will cause the seccomp compiler to only
understand constants and syscalls available on the build machine
and fail if policy files try to allow syscalls not available.

Putting the constants in version control will allow us to compile
the policies regardless of how old the kernel headers on the build
machine are.

BUG=b:235858187
TEST=presubmit

Change-Id: I1cfbb38f4687eb68b141f62c1c5fe6104b3f6456
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3988899
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
2022-11-02 00:13:08 +00:00
recipe-roller
c8f09559fc 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/8798654634146853025

recipe_engine:
6e2d907e1c
  6e2d907 (randymaldonado@google.com)
      [recipes-py] adding step tags example

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: I8532fc966c5c94b0dbf89ed3e991fcf44d50232d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3997877
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-01 23:55:49 +00:00
recipe-roller
3b9827d93c 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/8798657164928281505

recipe_engine:
3044387bce
  3044387 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 68db771de8f9 to 765f51c332c3

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: I460e1281bb7941e94a8d68d82044463c234239e2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3997874
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-01 23:16:14 +00:00
Dennis Kempin
6289de1d36 gpu_display: Add build targets for example binaries
This will allow them to be build via

cargo build --bin simple
cargo build --bin simple_open

It will also include them in CI builds to ensure the
code will not rot.

BUG=None
TEST=CQ

Change-Id: Id6e73f3d5535141f5b1df0edc07c0f84cd03305b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3997601
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
2022-11-01 21:51:07 +00:00
Daniel Verkamp
3002df7872 base: windows: make Event wait() actually infinite
Refactor the Windows PlatformEvent wait and wait_timeout functions to
use an internal wrapper function that correctly handles waiting forever
by passing the INFINITE value to WaitForSingleObject.

Previously, the wait function used a Duration value of i64::MAX seconds,
which becomes 0xfffffc18 when converted to milliseconds and truncated to
a DWORD. This does not correspond to the INFINITE value (-1, 0xffffffff)
that the Win32 Wait* functions expect, so theoretically a wait() call
could have returned without the event being signaled.

BUG=b:231344063
TEST=tools/presubmit --all

Change-Id: If68c4b2518926c12e8caf6746ef4b0bb152be00d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3966485
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
2022-11-01 21:03:05 +00:00
Daniel Verkamp
33078aac98 base: replace internal PlatformEvent uses with Event
We should use the public Event API wherever possible, even within the
base crate.

BUG=b:231344063
TEST=tools/presubmit --all

Change-Id: Ie4c8b2b82cf16299666998acb7b9b174c2bedc3b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3966484
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-11-01 20:59:29 +00:00
Daniel Verkamp
4cf9029b23 base: unix: use AsRawDescriptor in FileFlags and PlatformEvent
Use the cross-platform AsRawDescriptor rather than the unix-specific
AsRawFd. FileFlags and PlatformEvent are migrated simultaneously since
the FileFlags unit tests use PlatformEvent.

BUG=b:231344063
TEST=tools/presubmit --all
TEST=cargo test -p base -- --test-threads=1

Change-Id: I3653f7d50524bf459c6fb944b00dce90e9d4e659
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3966483
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-11-01 20:51:32 +00:00
Alexandre Courbot
523580d2f4 crosvm: allow -b as a shortcut for --block
Adding a block device is a very common operation, and some of the
deprecated disk options already had shortcuts, so assign one to it.

BUG=None
TEST=Substitute `--block` with `-b` on a command-line invocation, block
device is visible in the guest.

Change-Id: I87303957fbf359e6d2e760bccdee68f2ddccc586
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3996047
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-11-01 20:41:07 +00:00
Vikram Auradkar
2c6e960de3 win_audio: build and test win_audio
BUG=b:253494168
TEST=presubmit

Change-Id: Icb729671a0dcfbc4b6251c69732784de32f6318d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3988069
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-11-01 20:40:09 +00:00
recipe-roller
f535849481 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/8798671007232762785

recipe_engine:
8ae554d9e8
  8ae554d (iannucci@chromium.org)
      [step] Add better examples to stdio test.

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: I99eb6815567ab75f2e52aacbe69211fd440aedad
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3997595
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-01 19:37:15 +00:00
Dennis Kempin
b28d5a963d Fix winetricks install and build new container
Uprevs the container version to include the newly added
winetricks.

Fixes /dev/kvm permissions.

BUG=None
TEST=CQ

Change-Id: I019178f103068d3ae0dc048180a14c8786e738e0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3994884
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-11-01 19:04:35 +00:00
Daniel Verkamp
4eed9244b5 cros-codecs: minor cargo doc cleanups
Use backticks around comments that use array syntax with [] to avoid
interpreting those as Markdown links.

Additionally, convert a few file headers to //! so they show up in the
generated docs.

BUG=None
TEST=tools/cargo-doc

Change-Id: I34799ff8e0e48b799f31255ae1ed84a0c18e8601
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993931
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-11-01 07:52:53 +00:00
Alexandre Courbot
66c175eb29 media: libva: improve the documentation a bit
Fix, extend, and reformat the documentation of libva to be closer to the
style of the standard library.

BUG=b:214478588
TEST=`cargo doc --document-private-items` in `media/libva` does not
     generate any error.

Change-Id: Iee18f3471ddf8f2e65b5111f40fad3a020eafe41
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3932442
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-11-01 05:43:21 +00:00
Alexandre Courbot
ddf9b82855 integration_tests: use --block for disk options
As disk, rwdisk, root and rwroot are deprecated, switch to the unified
block command-line option.

BUG=None
TEST=cargo test -p integration_tests

Change-Id: I95109853f4b66bdd611c13c8eea92644f1892079
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3990101
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-11-01 05:06:16 +00:00
Daniel Verkamp
86148a9ceb cros_async: use tempfile instead of fixed path in tests
Previously, several tests used the same hard-coded filename for test
files ("/tmp/write_from_vec"), which could cause flaky tests when
running in parallel. Replace these with a tempfile invocation so the
tests can run simultaneously.

BUG=None
TEST=cargo test -p cros_async

Change-Id: I2b32d998583f9a44359345628d803b2397af33b1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993927
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-10-31 21:57:39 +00:00
Dennis Kempin
10a9c3304b Simplify cargo-doc
We no longer need to selectively disable features or set the
CARGO_DOC env var to successfully build crosvm.

BUG=None
TEST=None

Change-Id: Ib997533c79340e3330a80633c4e8a81cbfb22ab6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3988653
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-10-31 21:33:33 +00:00
Dennis Kempin
45b5c13047 Make common crates part of the crosvm workspace
This greatly simplifies and speeds up compilation
and clippy times.

This ChromeOS-side building these crates has been
updated to copy the source out of the source tree
so that they will compile as a separate workspace.

BUG=b:256020427
TEST=presubmit

Change-Id: I2e0f1f6724924d6bdd70ea28d7777df7966cf724
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3988324
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-10-31 21:33:33 +00:00
Dennis Kempin
7990b9da3c Replace common/assertions with static_assertions
The crates do the same thing, but static_assertions is
proven and stable, with no added dependencies.

Note: While this won't require changes to chromeos ebuild files
it will require the removal of dev-rust/assertions when crosvm-base
is upreved.

BUG=b:255989923
TEST=presbumit

Change-Id: I1420447ebdaa1a3649b30e6a6ec57f8dee858b98
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3988328
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-10-31 21:33:33 +00:00
Dennis Kempin
f8eb24052e Reformat all files with nightly
Run tools/fmt --nightly

BUG=None
TEST=None

Change-Id: Iaccfc5fe141c512f4b508c699f89686a4552bf96
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3988327
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-10-31 21:33:33 +00:00
Dennis Kempin
278e5ffeba test_runner: Add separate cargo target dir for each platform
Using the same CARGO_TARGET_DIR for all builds prevents us from
building for platforms in parallel, since cargo will lock the
directory to only run one build at a time.

Use the same directory for clippy as well, and ensure that
clippy won't invalidate caches created by run_tests.

This reduces the build time for tools/presubmit by about 50%.

Another advantage is that rust_analyzer and run_tests will no longer
block each other or invalidate the cache when run with different
feature flags.

Note: This introduces two subtle changes to the build that required nit
fixes:
- build.rs files are now run through clippy as well
- common/* crates are now also built for the target architecture instead
  the host.

BUG=None
TEST=tools/presubmit

Change-Id: I8da9ef53418c0b15827d512a04e77828621aef88
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3984416
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-10-31 21:33:33 +00:00
Daniel Verkamp
67cdc6aedc crosvm: fix build without --features=gpu
Add cfg checks to types that are only available when the gpu feature is
enabled. This fixes the `tools/presubmit --all` build.

BUG=None
TEST=cargo build --no-default-features
TEST=cargo build --no-default-features --features=gpu

Change-Id: Ibb6adb73f196dc798ba114cbae5e06e989a6e96d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993687
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Idan Raiter <idanr@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-10-31 20:23:43 +00:00
Daniel Verkamp
74db80eb13 gpu_display: fix allow(unsed) typo
BUG=None
TEST=tools/run_tests --platform=mingw64 --verbose

Change-Id: I33096ea9ab48c06a02207ab04d87257970265d20
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993686
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Pujun Lun <lunpujun@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
2022-10-31 19:59:34 +00:00
Idan Raiter
3c21f8e313 device: vhost-user: Cross-platform GPU base
Makes the async vhost-user backend cross-platform. The next change will
add the plumbing to turn it on. The plan is to create GpuBackendConfig
and GpuVmmConfig in the broker and pass to the relevant processes.
This way, we can also pass GpuBackendConfig to the main process if we
want to use the original non-vhost-user worker. The config changes will
be included with the plumbing CL that follows.

- Split into a sys module.

- Introduce 'platform_workers' that tracks platform-dependent futures.
  Reasoning: Windows will need to be able to launch more futures at
  runtime due to our input handling, it's useful to have a vector of
  workers to append to. This way the specific worker function doesn't
  need to leak into the shared file. We can also put the resource
  bridge workers here following the same logic.

- Introduce backend and VMM config structures to pass around.

BUG=b:243061269
TEST=downstream / presubmit

Change-Id: I53458c4dd2cf74b9e6bf5d10819533206e47a683
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3963645
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Kaiyi Li <kaiyili@google.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Commit-Queue: Idan Raiter <idanr@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-10-31 18:26:02 +00:00
Vaibhav Nagarnaik
479832daef irqchip/whpx: Factor out tests
https://crrev.com/c/3977111 factored out the integration tests for all
irqchip implementations, except for whpx.

Factor out the tests. Add `#[allow(unused)]` attribute for certain
helper functions that are not used in whpx. Make `interrupt_requested`
and `get_external_interrupt` public methods for tests to call into.

Test: Verified tests on windows. Using following command:
Test: `cargo test --tests -p devices --features="whpx,slirp" whpx -- --nocapture --test-threads 1`
Change-Id: I1863d509357193fdbc309e90cd0631fe5849a3bc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993814
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-10-31 18:04:52 +00:00
recipe-roller
f74d2c0a54 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/8798781735952211265

depot_tools:
9f38b63b4e
  9f38b63 (estaab@google.com)
      Add snippets to presubmit failures in resultdb

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: I8f647771cc80dbbff63b6503db393a335e9a8c65
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993806
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-10-31 14:20:51 +00:00
Alexandre Courbot
5f01cee736 media: libva: create Rc'd displays and contexts
libva Displays and Contexts are only useful if they are
reference-counted, and all callers of `create_context` immediately wraps
the result into a Rc. Make `create_context` return a `Rc` directly to
make sure we cannot end up with stray objects.

BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=cargo test --features "video-decoder,vaapi" -p devices

Change-Id: I04c90059df71ea8a09a1fa937d731e1f4a5c27fc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3932441
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-10-31 10:35:23 +00:00
Alexandre Courbot
0ae64281f3 media: libva: remove redundant Option for create_config
The attributes array can be passed as empty to indicate we don't have
any preference for the configuration (which is what passing None
results into anyway), so remove the Option in order to simplify the
arguments.

BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=cargo test --features "video-decoder,vaapi" -p devices

Change-Id: I677b61f595f82cfbb519da3d78f433478eede8b9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3932439
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-10-31 10:35:23 +00:00
Alexandre Courbot
10c819fb36 crosvm: rename all "net" parameters to use kebab-case
This option has just been introduced and has no user, so we can slip
this one under the rug.

BUG=b:255223604
TEST=cargo test -p devices net::tests
TEST=`cargo run -- .. --net tap-name=crosvm_tap` properly creates a TAP
network device.

Change-Id: I228e5f2539c49314399cf254ddaf795bd0265a2f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3990100
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
2022-10-31 10:30:46 +00:00
recipe-roller
dc5a6fe9bd 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/8798806901768458833

depot_tools:
7bd4611895
  7bd4611 (jwata@google.com)
      Release new Goma version

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: I03eb8465fa1edc128b30d0d3ce92e4cc701502c2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3992777
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-10-31 07:37:24 +00:00