Commit graph

6610 commits

Author SHA1 Message Date
Gurchetan Singh
f90779dae8 rutabaga_gfx: finish removing set_use_guest_angle
Missed a spot last time.

BUG=278138335
TEST=compile

Change-Id: I74edbdded7614250ef55a51370a5faa6a2ee0cbf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4505110
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2023-05-04 00:19:00 +00:00
Frederick Mayle
5441c064e5 hypervisor: kvm: check for KVM_SET_MSRS failures
The KVM docs say

  If setting an MSR fails, ..., it stops processing the MSR list and
  returns the number of MSRs that have been set successfully.

So, a return value of zero really means the operation completely failed.

Change-Id: Ic98cdb02513ff86e22fb6b048e7ceb2d6b7e554a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500732
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
2023-05-03 20:52:05 +00:00
recipe-roller
2fb38f73d5 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/8782094908571728337

depot_tools:
dbcecc9017
  dbcecc9 (linxinan@chromium.org)
      Allow 409 error from Gerrit when creating the branch

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: Ie96f469fe9b6f3ebfcb63c5acdd3ee61239b0fac
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500971
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-03 18:44:52 +00:00
recipe-roller
7ce31bf866 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/8782098682032076849

depot_tools:
9696c7f3ff~..68ec7822b820db3236cd71362a53eb8795e0005c
  9696c7f (lukasza@chromium.org)
      [rust] [depot_tools] Refer to a more specific rustfmt bug in a...
  68ec782 (vadimsh@chromium.org)
      [cipd] Update luci-auth.

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: I17cffc51d021865ab25ca7e099a35bc3f14956c9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500968
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-03 17:46:29 +00:00
Dylan Reid
965f99a72a tools: Add riscv platform
Allow running riscv unit tests only. This required filtering out some
workspace projects that can't yet build on riscv because the backing
packages aren't installed. Aside from that and passing the new
`--no-default-features` flag to `run_tests`, this is mostly copy/paste
of aarch64 support.

TEST=./tools/run_tests -p riscv64 --no-default-features
TEST=./tools/presubmit unit_tests

Change-Id: If0f74f1bb6eb42e1fe24ad31f4c1aa06f7822f8c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500729
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-05-03 16:50:25 +00:00
Dylan Reid
ec7e18e88f run_tests: add no-default-features option
Adds the ability to specify no-default-features to run_tests and have it
passed along to cargo. This will be useful when adding riscv as a new
architecture that doesn't yet support the default feature set.

Change-Id: I4692a02f4c47c3c66a03d7f44e3273360fad6be9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500728
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-05-03 16:50:25 +00:00
Dylan Reid
a6e211ab03 riscv-deps: add qemu dep for riscv
Add the qemu package needed for running riscv64 unit tests.

qemu-riscv64-static needs this ld-linux-riscv64-lp64d.so.1 in just the
right place and because of how riscv64 cross tools are installed it
doesn't land there automatically. Copy it over.

Similarly to find riscv libraries when running qemu-riscv64-static, the
risv libraries need to live at /usr/lib/'arch' so copy the 35MB of libs
over for riscv. This isn't pretty, but is temporary and my attempts to
set LD_PREFIX variables caused other problems such as breaking virtiofs'
passthrough tests.

TEST=run qemu-riscv64-static from the dev_container

Change-Id: I34ad32877f160f7fb7a3272344f6024ef1630841
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500727
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-05-03 16:50:25 +00:00
Dylan Reid
7f747e8069 cmdline: remove no-default-features warnings
Allows building with --no-default-features without warnings.

TEST=cargo build --no-default-features

Change-Id: I660c68f77d01e314751cc08938ffdac2d8492005
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4501093
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-05-03 16:50:25 +00:00
Dylan Reid
90ca416257 cmdline: limit merge_commands test based on config-file
The `merge_commands` test depends on the `config-file` features. Only
build it when `config-file` is enabled. Fixes a build failure when
running tests with `--no-default-features`

TEST=cd src; cargo nextest run --no-default-features

Change-Id: I00222c5aa25b7d030176222ea8dcd0ebca72eb2e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4501092
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-05-03 16:50:25 +00:00
Dylan Reid
1ae4e549e5 tests: Add riscv imports where needed
In working towards enabling unit tests, import the correct arch defines
for riscv64 where needed.

TEST=from dev container run:
```
cargo nextest run --workspace --no-default-features \
--exclude tpm2 \
--exclude tpm2-sys \
--exclude libvda \
--exclude libva \
--exclude ffmpeg \
--exclude vmm_vhost \
--exclude system_api \
--exclude gpu_display \
--color=always \
--no-run \
--target riscv64gc-unknown-linux-gnu
```

Change-Id: Ia7853de8ee0a11a5fdb716546a146f892229b0cb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4501091
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-05-03 16:50:25 +00:00
Dylan Reid
d246ec190c kvm: tests - limit irqfd tests to supported arch
Riscv doesn't implement `create_irq_chip` so match the guard here in the
test to the one in `Vm::create_irq_chip`. That includes aarch64 although
it doesn't appear to be used outside of tests except on x86_64.

Change-Id: I7a2705ec896f92861325a40cd02a51b5eac9b801
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4501090
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-05-03 16:50:25 +00:00
recipe-roller
659a3642cf 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/8782162226555508801

depot_tools:
f2da906faf
  f2da906 (dlf@google.com)
      Revert "resolve CIPD package names in 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: Idf99ce9109fdad891d8fabf69a65b6aee1476bc8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4501095
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-03 00:54:39 +00:00
recipe-roller
ed01e83819 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/8782167889190472033

depot_tools:
8faa5514ec
  8faa551 (dlf@google.com)
      resolve CIPD package names in 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: I0e3ffcce6685b9a25a36d9e12b11ff0bceeefe37
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4501200
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-02 23:26:40 +00:00
recipe-roller
9945d2c37b 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/8782169776205252657

recipe_engine:
fe30d36bce
  fe30d36 (bshai@google.com)
      time: fix bug in jitter

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: I5b8c3371db90218d117382cb69c32036ed9b2899
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500485
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-02 22:57:28 +00:00
recipe-roller
067a8f3a90 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/8782172292096575265

depot_tools:
1344a3c998
  1344a3c (linxinan@google.com)
      Add global 300s global timeout for Gerrit API calls

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: I213194d42ccf1479377e0527a6f0ddc07e5148ce
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500900
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-02 22:15:15 +00:00
recipe-roller
de55368cf8 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/8782176067286562625

depot_tools:
13878e1f72
  13878e1 (jeffyoon@google.com)
      [depot_tools] Roll dirmd

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: I04559b50547477c3d85586a33c30a5976f4ca863
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500599
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-02 21:16:15 +00:00
Dennis Kempin
fcce3f2c0c Move base::syslog::tests into an integration test
These tests require initialization of the syslogger via
`openlog_and_get_socket` which requires no other threads in the
process to prevent conflicting file descriptors.

BUG=b:280331266
TEST=run_tests --dut=host
TEST=cargo test -p base --test syslog
TEST=cargo test -p base --lib

Change-Id: I3d83ecb80770d94914fc23b2d5760c7a54f6380f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4499660
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-05-02 18:29:55 +00:00
recipe-roller
897e1b5f0b 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/8782189909328239905

recipe_engine:
52a5a62137
  52a5a62 (iannucci@chromium.org)
      Set py3_only for recipe-engine.

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: Ic3adaf7b2377e0a7b24ad0d66e1f3280177ce1a4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4496339
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-02 17:35:42 +00:00
recipe-roller
59d8bd34fd 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/8782191167096780433

depot_tools:
1398e4fc69~..37f499daecbc6f9ce8e403914d2c29e59387e5b4
  1398e4f (jojwang@google.com)
      Update stacked changes dogfood message.
  c333c34 (sokcevic@chromium.org)
      Drop pylint-1.5
  37f499d (gbeaty@chromium.org)
      Default to an empty footers dict instead of None.

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: I1d48ef6a3fceb790625600f819b3212a780be2b1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4499206
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-02 17:18:20 +00:00
Dennis Kempin
11a48d4cca tools: refactoring: Split common.py into multiple files
This is a refactoring with no functionality change. The common.py
file is split up so we will be able to use the parts that have no
third party dependencies separately.

For now, keep common.py and re-export everything, so we do not
introduce issues in other tools.

BUG=b:267499599
TEST=presubmit

Change-Id: Idf6d45bd90f5cf448fb9dd88df540af3da0f7f88
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4482141
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-05-02 17:04:27 +00:00
Daniel Verkamp
b018c19e23 base: unix: reimplement CMSG_* macros as const fns
These macros are no longer necessary, as we can replace them with const
fn implementations instead.

BUG=None
TEST=tools/dev_container tools/presubmit

Change-Id: If64cfa8fe08f113ead7236d11bb5a8b0fd51c290
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4484512
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-05-01 19:34:03 +00:00
recipe-roller
891cada5c5 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/8782275472412010081

recipe_engine:
1b4211f38c
  1b4211f (jwata@google.com)
      [url] Fix pycurl.py to strip prefix

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: Id720a8c43645e7fcff658e8161d67d5f0057d94e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4495722
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-01 18:56:14 +00:00
recipe-roller
7528237489 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/8782279246445902897

depot_tools:
f7b9e70a2e~..ce9bc414c07595cb36956a74ed290e73fee5c699
  f7b9e70 (yngve@vivaldi.com)
      Use relative path for cipd
  d3568a4 (gavinmak@google.com)
      Handle windows paths correctly in CheckInclusiveLanguage
  536c9b9 (vadimsh@chromium.org)
      [cipd] Update 2.6.11 => 2.6.12.
  b5eff1c (jrosenth@chromium.org)
      cros: Enforce minimum Python version of 3.8
  ddd8578 (jojwang@google.com)
      Enroll everyone in stacked changes dogfood.
  9acd55e (bryner@google.com)
      Have fake_cipd accept 'export' in addition to 'ensure'.
  0ddbf02 (sokcevic@chromium.org)
      [py3] Run gclient git test with py3
  afb5f0e (sokcevic@chromium.org)
      Drop explicit PRESUBMIT py2 test
  ce9bc41 (yiwzhang@google.com)
      roll lucicfg to v1.39.8

recipe_engine:
e78c443e90
  e78c443 (sshrimp@google.com)
      Add update_invocation to resultdb module

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: I68b95c3818cc6002ac4ae15c09213662dd617e5a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4496831
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-01 18:03:46 +00:00
Noah Gold
72d4c1db8a src: implement IRQ flushing on Windows.
Similar to prior work upstream, we've added the ability to flush IRQs to
the guest LAPICs. This helps us snapshot the guest because we are
guaranteed no events are pending inside CrosVM itself.

BUG=b:269653760
TEST=ran crosvm downstream & verified shutdown was clean.

Change-Id: I0fe42d8a963969edb390a8a432b7f39ae39af882
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4439031
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Richard Zhang <rizhang@google.com>
2023-04-28 22:58:22 +00:00
Dennis Kempin
89a7f22d20 Revert "dev_container: Simplify interactive/tty logic"
This reverts commit 25b8e44250.

Reason for revert: Breaks post-submit builders

Original change's description:
> dev_container: Simplify interactive/tty logic
>
> Always enable interactive mode when a tty is present. This allows
> commands to receive SIGINT.
> Otherwise, still allocate a pseudo tty to enable proper console
> output.
>
> BUG=b:275613273
> TEST=dev_container presubmit - then CTRL-C
>
> Change-Id: I7fb5c6897404f7d3e9f70755c237da0fd8b82c41
> Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4475490
> Reviewed-by: Zihan Chen <zihanchen@google.com>
> Commit-Queue: Dennis Kempin <denniskempin@google.com>

Bug: b:275613273
Change-Id: I80b0ee41029ac05e23b057d6ab0613856f980de0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4492224
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
2023-04-28 19:48:22 +00:00
Daniel Verkamp
a360baa819 Cargo.toml: upgrade protobuf 2.x -> 3.x
system_api bindings have been regenerated with protobuf 3.2; this should
be okay to land before the full ChromeOS system_api migration, since
crosvm always uses its own copy of the bindings rather than the ones
provided by the dev-rust/system_api package.

The protoc-rust crate is replaced with protobuf_codegen in 3.x.

BUG=b:277243607
BUG=b:279834784
TEST=tools/dev_container tools/presubmit

Change-Id: I6aad45ded2639d7506a7238800584bebab196455
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4405309
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
2023-04-28 19:32:01 +00:00
Jesus Sanchez-Palencia
aebac6eff3 devices: pci: Add serialization/deserialization to StubPciDevice
Add simple serialization/deserialization to StubPciDevice through the
traits provided by serde by adding the snapshot() and restore()
implementations to this struct's Suspendable implementation. The
requested_address and assigned_address fields were left out of the
snapshot since they are only configurable during VM creation.

Also add a test case for validation.

BUG=b:266622321
TEST=cargo build && ./tools/run_tests

Change-Id: I8d640452ee7db7263f1ecb185041dabb50ac46fc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4451466
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Elie Kheirallah <khei@google.com>
Commit-Queue: Jesus Sanchez-Palencia <jesussanp@google.com>
2023-04-28 17:59:03 +00:00
Daniel Verkamp
db627e80e9 crosvm: make userspace_msr handling x86 only
MSRs are specific to x86/x86-64; add the appropriate cfg checks and
remove the MsrHandlers stubs from aarch64 and riscv64.

Change-Id: I94f0b5b4b9f75fecdc8e03c569f89a70b7f9f647
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4482135
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-28 17:58:30 +00:00
Daniel Verkamp
6eec4b7768 Fix cargo doc warnings from Rust 1.68
Some type parameters in <> were being mis-parsed as HTML tags.

BUG=b:276487055
TEST=tools/cargo-doc # with rust 1.68.2

Change-Id: Iaa9ec6cf94a6084cfdf323bb04c643396a320889
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4485758
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2023-04-28 17:22:01 +00:00
Dennis Kempin
25b8e44250 dev_container: Simplify interactive/tty logic
Always enable interactive mode when a tty is present. This allows
commands to receive SIGINT.
Otherwise, still allocate a pseudo tty to enable proper console
output.

BUG=b:275613273
TEST=dev_container presubmit - then CTRL-C

Change-Id: I7fb5c6897404f7d3e9f70755c237da0fd8b82c41
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4475490
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-04-28 16:38:42 +00:00
Juston Li
e804cf38d5 seccomp: x86_64: gpu_common: add fallocate
mesa shader cache now uses fallocate

See https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22097

BUG=b:279974067
TEST=vmc launch borealis, shader cache inits

Change-Id: Ic4751399074eba4f72892129290d5243cec6baba
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4485420
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Juston Li <justonli@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
2023-04-28 16:08:56 +00:00
Daniel Verkamp
0ef56f41fb windows: fix missing CpuConfigX86_64 in whpx build
The import of hypervisor::CpuConfigX86_64 was removed, but the
non-default whpx feature still needs it.

BUG=b:277957421
TEST=cargo build --target=x86_64-pc-windows-gnu --features=whpx

Fixes: 1aff211998 ("arch: use cfg_if to clean up hypervisor *Arch types")
Change-Id: I300b6c8c6dee36f75109a6adca9840a9f4da3ab2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4481153
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2023-04-28 03:06:47 +00:00
Elie Kheirallah
8afa6096aa base: add casts for support on Android
Add cast to support Android. Libc Android has different types for some
variables than Libc Linux. This leads to casts required. Added skips on
clippy for these casts as they would be redundant on a platform while
required on another.

The same change is also applied to fuse:.

BUG=N/A
Test=presubmit

Change-Id: I994af922cf3ccc56438f2642fef9af91f6af5118
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4485518
Commit-Queue: Elie Kheirallah <khei@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-04-28 00:59:45 +00:00
Grzegorz Jaszczyk
7d4b9a5250 x86: acpi: add unit test for ACPI FACP creation
To prevent accidentally ACPI FACP overwriting similar to one described
in the b:279563028 add unit test which will catch such bugs in the
future.

BUG=b:279563028
TEST=tools/run_tests

Change-Id: Ie1dac4460b1ce7c9186835dbbbaa3f6001fabaa1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4482091
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
2023-04-27 21:48:36 +00:00
Grzegorz Jaszczyk
3511b71db3 devices: cmos: fix register index sizes to prevent overwriting ACPI FADT regs
According to ACPI specification the RTC's DAY_ALRM, MON_ALRM and CENTURY
are all 8-bits values. Fix the related register sizes in order to
prevent other ACPI FADT fields overwriting happen e.g. in
x86_64/src/acpi.rs:
  facp.write(FADT_FIELD_RTC_CENTURY, devices::cmos::RTC_REG_CENTURY);

While introducing this change, convert other RTC_REG* consts to u8.

This commit fixes CL:4364558 which accidentally causes some other ACPI FADT
overwriting e.g. FADT FLAGS which introduced regression in borealis project.

BUG=b:279563028
TEST=Run borealis VM and make sure that rendering issues after
suspend/resume cycle are gone.

Change-Id: I159ba16616f0eb08b5fc562e88d2887836815c44
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4477066
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-04-27 21:48:05 +00:00
Daniel Verkamp
49ba9f2df6 tools: port cargo-doc to python
This lets us use the common arg parsing infrastructure, and it should
work on Windows (as opposed to the previous bash script).

BUG=b:267672683
TEST=tools/cargo-doc
TEST=tools/cargo-doc --target-dir=/tmp/crosvm-doc

Change-Id: Ib56f4d28965d32ea01a9aa55d7840edfb71f3d59
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4483471
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-27 20:51:42 +00:00
Idan Raiter
8831cf5560 audio: Windows: Fix realtime priority not being set
Both single and multi process did not have realtime priority, due to us
dropping the multimedia trick handle in set_audio_thread_priority where
we should be holding it until the thread is finished.

BUG=b:276698085
TEST=Process explorer -> properties -> threads -> base priority
increases from 8 to 24

Change-Id: Ia9199f4816e087046b8718e85c60abc9479ec0f3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4416757
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Idan Raiter <idanr@google.com>
2023-04-27 18:52:14 +00:00
Andrew Walbran
1661dfca89 Update bitflags dependency to 2.2.1.
This is a new major version, and requires some code changes.

Change-Id: I294ce3604aad6e6dc5f50e33246b690e883c1e36
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4481294
Auto-Submit: Andrew Walbran <qwandor@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-04-27 17:22:36 +00:00
Frederick Mayle
547f9a222d cros_async: test blocking pool handle drop behavior
This was implicitly tested before, but seems worth an explicit test.

Change-Id: I0d31051a8422d61f91938fc5975f230346bbce65
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4478450
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-04-27 05:16:37 +00:00
Daniel Verkamp
a0d49e7a0b tools: chmod +x install-riscv-deps
Change-Id: I6e31e1b060862b9ac09aeed4947725ed1d7ac426
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4482132
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-04-26 23:51:10 +00:00
Daniel Verkamp
1aff211998 arch: use cfg_if to clean up hypervisor *Arch types
Also use the arch definitions in the main crosvm crate to avoid
duplicating the cfg checks.

BUG=None
TEST=tools/dev_container tools/presubmit

Change-Id: Ia92b2840b0f6c8f0daa25f4b2b185ef7ef372860
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4477764
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-26 22:26:56 +00:00
Daniel Verkamp
63f50362ec devices: virtio: overhaul DescriptorChain API
Summary: DescriptorChain now reads the full chain when it is created.

Previously, DescriptorChain worked more like an iterator, returning one
descriptor at a time. This meant that DescriptorChain::checked_new()
returning Ok(...) did not guarantee the whole chain was valid, so
callers - in particular, Reader::new() and Writer::new() - had to be
fallible so they could report errors.

With the new API, DescriptorChain::new() reads the whole chain of
descriptors before returning, validating the required properties that
were previously deferred to Reader/Writer creation errors. This means
that Reader::new() and Writer::new() can now be infallible, which
eliminates error cases all over virtio device code.

Since the Reader::new() and Writer::new() function signatures are
changing anyway, take the opportunity to remove the redundant
GuestMemory parameter to those functions; DescriptorChain already holds
a reference to the GuestMemory.

The internal structure of DescriptorChain has been modified in
preparation for supporting packed virtqueues (in addition to the current
split virtqueues). The queue-type-specific code has been factored into a
separate trait implementation (DescriptorChainIter) so it is separate
from the high-level descriptor chain validation logic and IOMMU
translation.

BUG=None
TEST=tools/dev_container tools/presubmit

Change-Id: I48fd44b7f3e8b509dcb3683864a3f9621c744c4c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4391797
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Maciek Swiech <drmasquatch@google.com>
2023-04-26 20:27:16 +00:00
Daniel Verkamp
74d423fb04 virtio: iommu: fix inside-out Option references
Change-Id: I4a8ee44f07491825ea346168fa888ba69774b559
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4391796
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-26 20:11:21 +00:00
Dennis Kempin
0db4f0e964 presubmit: Run tests/builds with verbose output
The presbumit tool takes care of truncating results in a readable
way. And we can see full output when things fail, and in CI logs.

BUG=b:279641456
TEST=presubmit --no-delta

Change-Id: I347dc938fd07f265d4adb641e2f2818cd37e7db2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4481511
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-04-26 19:14:32 +00:00
Dennis Kempin
831b5a6735 infra: Fix git unshallow in chromeos_hatch builder
The dev container used to wrap commands in bash, now we need to
explicitly call bash to run the script.

BUG=None
TEST=https://ci.chromium.org/swarming/task/61d79d241817fc10

Change-Id: Idaeb53bf848ffcd49911dad4e195f49dc3df69b2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4481513
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-04-26 19:11:48 +00:00
Daniel Verkamp
3acd42c084 win_util: remove build.rs script
This seems to only generate bindings for ImmDisableIME(), which is
unused in upstream crosvm and also seems to be available without running
a build step now.

BUG=b:277957421
TEST=tools/dev_container tools/presubmit

Change-Id: Ic5a996eb9d8c7d7c65e2138fe92e8ea335cac76f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4477411
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
2023-04-26 18:25:31 +00:00
Dylan Reid
36af53e278 dev_container: Add riscv64 support
Because bullseye's cross packages for riscv64 are broken, libcap needs to
be manually built and installed, and pkg-config needs a hacky define to
allow minijail to find it. Other than that, it's very similar to the
other architectures.

Change-Id: I903f7ccd2ccbd94168ba09b425fd649458fdee70
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460942
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-26 17:36:40 +00:00
Dylan Reid
38d1242859 Add riscv target to main crosvm build
Allows running crosvm on riscv64 devices.

Tested on a qemu host with `-machine virt,aia=aplic-imsic,aia-guests=4`

Change-Id: I9b369718bcb438f043e3342f1866c56fc4983304
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460941
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-26 17:29:25 +00:00
Dylan Reid
b7193b9b6b riscv: limit dependencies to riscv builds
Instead of unconditionally depending on these dependencies only include
them for riscv64 builds. This will fix a build breakage on the windows
builders.

Thanks to denniskempin and dverkamp for suggesting this fix.

Change-Id: I035dc23cd0b58f63a3bcb3b8f883aba97d56492d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4477776
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-26 17:29:09 +00:00
Junichi Uekawa
810d131d67 crosvm: Uprev cbindgen dependency
Match version available in Debian.

BUG=b:265082456
TEST=build

Change-Id: I8fc3b65fb8bb6cc3f7e512921d96c8cbbc4291b5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4364561
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2023-04-26 00:26:32 +00:00