Commit graph

6610 commits

Author SHA1 Message Date
Ryuichiro Chiba
4f0aed19ec devices: usb: Handle stall error
crosvm ignores STALL error returned from usbdevfs during transfer ring
operations.
xHC shall handle this error and manage the state of the endpoint which
the error occurs (see xHCI spec 4.8.3).
This CL handles the error and reports it to the guest driver.

BUG=b:283932324
TEST=`./tools/presubmit`
TEST=termina vm receives a STALL error when the error occurs

Change-Id: Ibeafb1a07ed8ebbca60438931877493c1cea7551
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4554561
Commit-Queue: Ryuichiro Chiba <chibar@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-05-29 03:27:13 +00:00
recipe-roller
3ccfd3c019 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/8779995449762401009

depot_tools:
04afb4b256
  04afb4b (sokcevic@chromium.org)
      Skip owners file format check on skip_owners

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: I81015c6bf18473e1cb1e1b07662f21c9ee1ad3c1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4571606
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>
2023-05-26 22:59:40 +00:00
recipe-roller
a335afe765 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/8780019357196224881

depot_tools:
4dfbc0a3a9
  4dfbc0a (jojwang@google.com)
      Add superproject got_revisions.

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: I732e462d5b3e99504358923ef19efc8399871186
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4571159
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>
2023-05-26 16:34:12 +00:00
recipe-roller
9dfd77b5fe 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/8780056476641694289

depot_tools:
b665de65cd
  b665de6 (tikuta@chromium.org)
      reclient_helper: fix path for unix domain socket

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: I9b79d5e1973a4a0bb338bad113f36467f6f3ed9c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4570443
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>
2023-05-26 06:50:42 +00:00
recipe-roller
0c14865130 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/8780069688952183809

depot_tools:
bf67b23193
  bf67b23 (tikuta@chromium.org)
      reclient: use fixed size path for unix domain socket

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: Ib6f7a52de5114105dfda43c362794d01db3ca9ab
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4568900
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>
2023-05-26 03:20:00 +00:00
Shintaro Kawamura
22f4ab43d8 swap: add tests for UffdList
userfaultfd is not available in unit test environment but only in
integration tests. Use FakeDeadUffdChecker for unit testing.

BUG=b:266898615
TEST=./tools/run_tests2

Change-Id: I146ee5b798304c5a7f898fa4c39a466055fe3ed8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4562369
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Ningyuan Wang <ningyuan@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-05-26 01:56:34 +00:00
Daniel Verkamp
95bc7819ec clippy fixes for Rust 1.69
BUG=None
TEST=tools/clippy # with rust-toolchain = 1.69.0

Change-Id: Ic14a74794e616d21867d0f1b5eab3a57121048e1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4508667
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-05-26 01:52:39 +00:00
Shintaro Kawamura
8470f446e4 swap: move UffdList into a single file
We will add unit tests for UffdList. Having a single file for UffdList
is easier to write unit tests.

This adds a minor refactoring to register the main uffd to WaitContext
within UffdList logic. Also removed the comment for the main uffd
registeration due to blocking on fork because it is obsolete since we
don't use the fork feature of userfaultfd(2).

BUG=b:266898615
TEST=./tools/run_tests2

Change-Id: I53f6d9944d282f7a7528dd6882cd7527031af1b8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4562368
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Ningyuan Wang <ningyuan@google.com>
Commit-Queue: Shin Kawamura <kawasin@google.com>
2023-05-26 01:39:56 +00:00
Shintaro Kawamura
1a00bde75f swap: add SwapDeviceHelper for forking grand-child processes
Hotplug devices are forked from JailWarden process due to minijail
workaround. It is possible to pass `&mut SwapController` to the
JailWarden process on forking, but the ownership of the reference is not
clear. The actual ownership of the object is cloned when forking at the
higher call stack, however it is not clear for readers.

Introduce swap::SwapDeviceHelper to make the ownership clear. The
JailWarden process will hold the ownership of swap::SwapDeviceHelper.

BUG=b:266898615
TEST=./tools/run_tests2

Change-Id: I64edf9e41a70edfd156bcca060656b5641d785fb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4560804
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Ningyuan Wang <ningyuan@google.com>
2023-05-26 01:39:53 +00:00
Shintaro Kawamura
4a70373f29 swap: garbage collect uffds for detached hot plug devices
When a hot plug device is detached, its uffd becomes dead. This commit
adds a garbage collector to remove dead uffds and prevent the uffd list
and obsolete opened file descriptors from growing indefinitely.

BUG=b:267124393
BUG=b:281791015
BUG=b:266898615
TEST=https://crrev.com/c/4562369

Change-Id: I11d3298b8e4838bbb843e4dc10f29f32a02b0646
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4525480
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
2023-05-26 01:39:50 +00:00
Frederick Mayle
8c5fe4198b devices: irqchip: fix compiler error on riscv64
Change-Id: Ifb67cf5320b965d58eac96c7eee17f38b0863dd7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4567113
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Auto-Submit: Frederick Mayle <fmayle@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-05-26 01:07:33 +00:00
Daniel Verkamp
d3c28cc3c1 data_model: windows: panic if IoBuf len is too large
The Windows version of IoBuf uses the WSABUF structure, which represents
len as a 32-bit value. Previously, larger len values would be silently
truncated; this change makes those conversions using try_into() instead.
We have no easy way to report failure of this usize -> u32 conversion,
so for now, just unwrap() to cause a panic if the length ever overflows
so it will at least produce a crash report and be noticed.

A possible future enhancement could be to make all relevant IoBuf and
IoBufMut functions return Result<...> so the error could be propagated
back to the caller.

BUG=None
TEST=tools/dev_container tools/presubmit

Change-Id: I79270a7e8af01827ef0d1bafaa98c5d7f4b53b73
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4567110
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-05-25 23:26:57 +00:00
recipe-roller
1f0b11db2c 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/8780084787458575921

depot_tools:
0e3589eaf8
  0e3589e (aravindvasudev@google.com)
      Fix skip-ensure-authenticated config

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: I2ef7e61e29f9ef1a71fc0bc661634e4d13d6411d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4569483
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>
2023-05-25 23:18:22 +00:00
Noah Gold
21875abcf9 src: fix bad generic IME param.
This parameter needs to be mutable.

BUG=none
TEST=presubmit

Change-Id: I568437746a5d0bfcd124bbd898d7c572dd21bbfa
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4558085
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2023-05-25 22:51:58 +00:00
recipe-roller
cb9a9035f5 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/8780090450185133777

depot_tools:
b52b190cb8
  b52b190 (jojwang@google.com)
      Add explicit path for infra in infra_superproject gclient config.

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: Ib8c916f32d30f7205a1539f213d27c5123a6168d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4568148
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>
2023-05-25 21:44:24 +00:00
Daniel Verkamp
dbf07144e2 data_model: deduplicate IoBufMut sys code
Most of the IoBufMut code is generic and doesn't need to be implemented
for each platform. Factor out the sys-specific parts into a new trait,
PlatformIoBuf, that contains the minimal accessor functions for getting
and setting address and length.

BUG=None
TEST=tools/dev_container tools/presubmit

Change-Id: If647dd268f8ccdb8ecba2dcf5b12711363a32c69
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4559526
Reviewed-by: Zihan Chen <zihanchen@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-05-25 21:09:58 +00:00
recipe-roller
44d9341061 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/8780098629700446385

recipe_engine:
b60bb0d221
  b60bb0d (nmulcahey@google.com)
      Revert "[recipes.py] Unset PYTHONPATH in case users have confli...

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: I6d61129c3d7f62cc6fe403739a9cea2b4f48e64d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4568147
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>
2023-05-25 19:35:36 +00:00
Keiichi Watanabe
4caa4427f6 jail: Compile seccomp policies in parallel
Allow running `compile_seccomp_policy` script in parallel in build.rs so
the build time would change from 19 sec to 1.6 sec on my Linux
workstation.

With combinining with crrev.com/c/4546480, time of clean build of crosvm
changed from 73.5 sec to 67.8 sec.

BUG=b:283197076
TEST=cargo build

Change-Id: I60197e29d623ccc3638fc464373fdf1d71b00ae1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4546818
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2023-05-25 19:13:12 +00:00
Keiichi Watanabe
cb869c4933 jail: build: Move policy compilation logic into a separate function
This is just a clean up CL to introduce parallelism in the next CL.

BUG=b:283197076
TEST=cargo build

Change-Id: I5118f08a9671b32bbebf850764d627fb32db7383
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4567763
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2023-05-25 19:13:01 +00:00
Ryan Neph
42ee99f25e gpu: allow unsandboxed implicit render server spawn
Allow virglrenderer to implicitly spawn a render_server process when a
render_server_socket is not provided and sandboxing is disabled.

BUG=None
TEST=cargo build --features=gpu,x,wl-dmabuf,virgl_renderer,virgl_renderer_next

Change-Id: Icb682ffbf5812675d3c0c8e5a3d11006ecd53e8d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4563457
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
2023-05-25 19:10:51 +00:00
Ryan Neph
6a96c5b7ad gpu: refactor gpu device creation
Reduce the number of parameters passed down multiple levels of the call
stack.

BUG=None
Test=cargo build --features=gpu,x,wl-dmabuf,virgl_renderer,virgl_renderer_next,gfxstream

Change-Id: Iac4436e391b2d246b5ab7aecf04fd48d523fac78
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4563456
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Ryan Neph <ryanneph@google.com>
2023-05-25 18:56:52 +00:00
Ryan Neph
3d1bf4aa67 gpu: remove redundant feature predicates
The gpu module is already conditionally imported.

BUG=None
TEST=cargo clean && cargo build
TEST=cargo clean && cargo build --features=gpu

Change-Id: If797ef49b3b0208649409c4f46933a9b687d2f8a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4563455
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Ryan Neph <ryanneph@google.com>
2023-05-25 18:56:52 +00:00
recipe-roller
fb68eb8961 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/8780101146004002017

depot_tools:
c83abb3247
  c83abb3 (yueshe@google.com)
      Roll mac_toolchain version for builders using osx_sdk

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: I1c376eb4b38ba1ffe95d46dd5f3706fc5a9e7c00
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4568146
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>
2023-05-25 18:56:37 +00:00
Yi-De Wu
cc44fd982e geniezone: Pass dtb config to hypervisor
Feature:
- Add new uapi to pass dtb config to geniezone hypervisor

Bug: 278959491
Test: tools/presubmit --all

Signed-off-by: Jerry Wang <ze-yu.wang@mediatek.com>
Signed-off-by: Yi-De Wu <yi-de.wu@mediatek.com>
Change-Id: I37eff2fb1de581493fbe584621fad63995b6c2ff
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4413734
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
2023-05-25 18:42:14 +00:00
Yi-De Wu
75931cd608 geniezone: Require static swiotlb allocation
Bug: 278959491
Test: tools/presubmit --all

Signed-off-by: Jerry Wang <ze-yu.wang@mediatek.com>
Signed-off-by: Yi-De Wu <yi-de.wu@mediatek.com>
Change-Id: Ic8f19783dca1da8771c0500a56de3eaae73fb710
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4413736
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
2023-05-25 18:42:14 +00:00
Yi-De Wu
27dff281ae geniezone: Pass memory region purpose to hypervisor
Feature:
- Modify set_user_memory_region function
- Encode memory region purpose to flags

Bug: 278959491
Test: tools/presubmit --all

Signed-off-by: Jerry Wang <ze-yu.wang@mediatek.com>
Signed-off-by: Yi-De Wu <yi-de.wu@mediatek.com>
Change-Id: I8b46219ba73c24eae9ca7ca80174cdec3a6f822d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4413735
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-05-25 18:42:14 +00:00
Dennis Kempin
8656c2f8c3 Upgrade to 1.68.2: Set default version and rebuild container
The new toolchain is now used in CI and as default for developer builds.

The mingw ldd hack is no longer needed as debian has released a fixed
package.

BUG=None
TEST=CQ

Change-Id: I713d2901165ec33efe301e79819ef31ab86fee48
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4568145
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-05-25 18:30:55 +00:00
Dennis Kempin
4cd4043fd1 Upgrade to 1.68.2: Fix clippy nits
The new rust toolchain comes with improved clippy warnings that
catch more unnecessary casts than before.
Some cases have to be whitelisted since libc types have varying size
based on the architecture we are compiling for.

BUG=None
TEST=presubmit

Change-Id: Ia473b0bfe6e74bdb7b0d4ca15d2c9fb410fc353e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4568144
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-05-25 18:28:14 +00:00
Ryan Neph
dde9aa0e6d rutabaga_gfx: Override to use pkg_config-provided virglrenderer
BUG=b:220199446
TEST=CROSVM_USE_SYSTEM_VIRGLRENDERER=1 cargo build

Change-Id: If1a0a9f0158b116812b1f2364519504363fa03b4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4563454
Commit-Queue: Ryan Neph <ryanneph@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-05-25 17:16:09 +00:00
Noah Gold
6c84a3d1fe devices: irqchip: fix WHPX IRQ route save/restore.
It looks like WHPX isn't building fully upstream since there were a few
type errors that came up when I was testing. This CL fixes them.

BUG=none
TEST=builds

Change-Id: I406c4103cfa9e23dc27cb01b56fd91150c0f28de
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4556837
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2023-05-25 16:49:57 +00:00
recipe-roller
2a0857c472 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/8780111212690749457

depot_tools:
43ceaf0353
  43ceaf0 (sokcevic@chromium.org)
      Update message when external changes are detected

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: I45fef76c524881b1c10cf2725b8c450f036db763
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4568143
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>
2023-05-25 16:17:11 +00:00
Elie Kheirallah
601f7b6d9d vm_control: move snapshot logic to do_snapshot function
Move the snapshot logic to a function similar to do_restore.

BUG=N/A
Test=presubmit

Change-Id: I73787a89e8ec6051fd10c6e5a3ea64eabc461017
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4550001
Commit-Queue: Elie Kheirallah <khei@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-05-25 00:46:57 +00:00
recipe-roller
fe17f31ba3 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/8780172868959244913

depot_tools:
456d085e75
  456d085 (dlf@google.com)
      Adding batch CIPD version resolution to gclient.

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: Ib25983551ad1326c995255a988e05225ca463046
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4562960
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>
2023-05-25 00:01:01 +00:00
recipe-roller
058853a71d 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/8780185451022819457

depot_tools:
1affd9c35d
  1affd9c (jojwang@google.com)
      Add arg in bot_update recipes api to override deps revisions.

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: I39e7fd709b981bebec5ef17bb0f0a0435bc52d8d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4562899
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>
2023-05-24 20:41:13 +00:00
recipe-roller
4b7277206a 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/8780190483953277825

depot_tools:
05ebc9e3e0
  05ebc9e (brucedawson@chromium.org)
      Allow calling tag functions from PostUploadHook

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: I732d84b830c28847843f8bb2e6b426608507ab1c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4562897
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>
2023-05-24 19:17:27 +00:00
recipe-roller
765cce4ee8 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/8780235783205161953

recipe_engine:
7f9b133838
  7f9b133 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from edf7c1502de4 to 406fda74bafb

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: Ie045ccf0f811b1bc18a238e8bf55814e89a28f58
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4559378
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>
2023-05-24 07:16:31 +00:00
Federico 'Morg' Pareschi
362f5103fa cros_tracing: Fix missing fully qualified names
We need to use fully qualified crate names for things like Ordering when
we use them inside macros.

BUG=None
TEST=built crosvm with tracing and checked macros work without imports

Change-Id: I7cae94822ca5c3ef188e8e46e79edfb6bd0fca5b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4560807
Auto-Submit: Morg <morg@chromium.org>
Commit-Queue: Takaya Saeki <takayas@chromium.org>
Commit-Queue: Morg <morg@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
2023-05-24 04:49:56 +00:00
recipe-roller
f312972f7d 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/8780248365330761185

depot_tools:
2568d4c1eb
  2568d4c (sokcevic@chromium.org)
      Add additional check for PS parents

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: I60a46eb5a873dca12205e571913255a6663e9ade
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4559372
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>
2023-05-24 03:59:53 +00:00
Noah Gold
d89938d37f vm_control: add Windows vm_control client support.
With the server support in place, we can connect to the control socket
just like unix does (albeit a named pipe instead of a UDS).

BUG=b:276361599
TEST=tested snapshot commands on Windows.

Change-Id: I874463026e3b4504009c6a19d7ba9ffb8fa169fa
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4558308
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Richard Zhang <rizhang@google.com>
2023-05-24 00:01:51 +00:00
Noah Gold
ae33f0fc5a src: run the control server on Windows.
If --socket is specified on a non-prod build, we will run a named pipe
server on that socket which will soon service requests like pressing the
power button, etc.

BUG=b:276361599
TEST=builds + later CLs in the chain.

Change-Id: I0be227f5e915feb29ab2883ab3bceb85a50cfc92
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4558307
Reviewed-by: Richard Zhang <rizhang@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2023-05-24 00:01:51 +00:00
Noah Gold
883e44a700 src: implement control socket adapter for Windows.
Implements a control socket adapter for named pipes that will allow
run_control to listen for control socket connections on Windows just
like it does on unix.

BUG=b:276361599
TEST=unit test

Change-Id: I3b2453e3b066a565cab64fc69ba19e960c3a806a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4558304
Reviewed-by: Richard Zhang <rizhang@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2023-05-23 22:53:30 +00:00
Noah Gold
2516507e92 base: make Tubes return a Disconnect error.
Detecting if a Tube is disconnected used to be a little painful since
we'd have to extract the underlying io::Error and check for BrokenPipe.
On unix it wasn't ever this hard since Error::Disconnected exists for
the Tube Error type. On Windows it looks like we just forgot to
implement this.

This CL makes all broken pipes on Tube read/write return Disconnected
instead of a generic IO error.

BUG=b:276361599
TEST=manual run of VM.

Change-Id: I422951b770fd966d6d5e9618c3b756bb2ab5ef7d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4558305
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Richard Zhang <rizhang@google.com>
2023-05-23 22:53:30 +00:00
Noah Gold
3a46037613 base: fix StreamChannel broken pipe bug.
StreamChannel notifications were not properly handling broken pipes
when fetching the number of bytes available during the notification
sync. This is because the PeekNamedPipe call comes after the final read
call that drains the named pipe, and at this point the pipe is broken.
This CL fixes the problem by treating the byte count as zero if the
pipe is broken, which is technically true (it has no data).

BUG=b:279840868
TEST=manual

Change-Id: Ib563c7e5e426524f666ff191ec3774a4b40f59a0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4556842
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Richard Zhang <rizhang@google.com>
2023-05-23 22:04:40 +00:00
Noah Gold
70e9e588d1 base: relax thread::spawn_with_timeout trait reqs.
base:🧵:spawn_with_timeout was stricter than
std:🧵:spawn, which wasn't really helpful.
(In prod code we use std:🧵:spawn, so being
stricter than that isn't useful or safer in a meaningful
way.)

BUG=b:276361599
TEST=builds

Change-Id: I4197d3ac082af4077f82d7d70a11869b0a886238
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4556841
Reviewed-by: Richard Zhang <rizhang@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2023-05-23 21:41:06 +00:00
Noah Gold
738220a623 base: new Tube APIs (split, PipeTube, FlushOnDrop).
* Sometimes we want to split a Tube end into a reader & writer so
those responsibilities can be handled separately. This is what
`split_to_send_recv` does.
* On Windows, making a Tube directly attached to a named pipe will be
  needed for the control client. This is what `PipeTube` implements.
  Just like a raw named pipe, it has no notification support, and so it
  hides those elements of the Tube API.
* On Windows, we need a way to ensure a Tube is flushed before it is
  dropped so that a disconnecting client can ensure the server has read
  its messages before the pipe is dropped / EPIPE happens.
  Paradoxically, the "flush" can only be implemented on the server end
  of a pipe, so in CrosVM, our "clients" are actually the server end of
  pipes.

BUG=b:276361599
TEST=tested in future CL in the chain.

Change-Id: I70a7badc92461d49b9f08a5f997157b0698cff24
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4556840
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Richard Zhang <rizhang@google.com>
2023-05-23 21:36:56 +00:00
Noah Gold
a6169ea5b1 base: fix ERROR_MORE_DATA being a read failure.
In our overlapped read helper API, ERROR_MORE_DATA was considered to be
a fatal error (if returned from the initial call to ReadFile). It looks
like this might only happen for message mode pipes, which probably
weren't used with this function until an upcoming CL. This error would
cause us to return early and leave the OverlappedWrapper in use. Leaving
the wrapper in use is still possible, so that's a bug (b/279459822).

BUG=b:276361599
TEST=future CLs in the chain.

Change-Id: Icc8dff9b83542365336664ee1219654cb3ec1eef
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4556839
Reviewed-by: Richard Zhang <rizhang@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2023-05-23 21:31:49 +00:00
Noah Gold
448e796868 base: add interruptable ConnectNamedPipe for pipes.
Similar to our other overlapped utility functions for read, this CL adds
one for the named pipe equivalent of accept (ConnectNamedPipe).

BUG=b:276361599
TEST=unit tests

Change-Id: I30780fbfea6ff57aaf4bb3176f400f5b5e5fb9de
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4556838
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Richard Zhang <rizhang@google.com>
2023-05-23 21:31:49 +00:00
recipe-roller
f913a0e9eb 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/8780274790092786257

depot_tools:
02838e6f4e
  02838e6 (tusharvickey1999@gmail.com)
      Import Get-FileHash from PowerShell's version specific path

recipe_engine:
a5c25e8f06
  a5c25e8 (iannucci@chromium.org)
      [recipes.py] Unset PYTHONPATH in case users have conflicting va...

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: I0edc7774d0b64501a2133b7a602003ddeaaca4d7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4558944
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>
2023-05-23 20:53:57 +00:00
Noah Gold
c350eee33b hypervisor: implement blanket MSR fetch for WHPX.
For snapshotting, we want to save/restore *all* MSRs rather
than a one or two specific MSRs. To accomplish this, we're
implementing get_all_msrs for WHPX.

BUG=b:269705560
TEST=unit tests

Change-Id: I706c3bd1d9d11ca58c709e1a19e0184dc560f193
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4546271
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Richard Zhang <rizhang@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
2023-05-23 20:00:32 +00:00
Noah Gold
458bc9e033 hypervisor: add test for interrupt state snapshot.
After running into issues with MSRs, it seemed advisable to have a smoke
test for these functions too.

BUG=b:269705560
TEST=unit test

Change-Id: I2017dc95c19a7097a4be17099cd33ae75bf7c6f6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4546270
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Steven Moreland <smoreland@google.com>
2023-05-23 20:00:32 +00:00