Commit graph

8986 commits

Author SHA1 Message Date
Alexandre Courbot
c8575d02bf devices/decoder/ffmpeg: fix error message
BUG=None
TEST=cargo build --features "video-decoder,vaapi,ffmpeg,libvda-stub"

Change-Id: I88c0e290e802b24f5b92fba76cc2bf501db610ad
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5606946
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-11 17:25:55 +00:00
Alexandre Courbot
c6f30e4d46 media/ffmpeg: more detailed error message
Knowing the dimensions is helpful here - add this information.

BUG=None
TEST=cargo build --features "video-decoder,vaapi,ffmpeg,libvda-stub"

Change-Id: I0c6f03d6fd05aee36233b2609a3e9da145decec8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5598601
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
2024-06-11 17:25:51 +00:00
Daniel Verkamp
ac6fe3e31c Avoid clippy::blocks_in_conditions warnings
Assign the result of function calls that take closures to an
intermediate variable rather than matching on it directly to simplify
the complexity from clippy's point of view.

BUG=b:344974550
TEST=tools/clippy

Change-Id: I0e4b4201b59d8bd972c1f18e65bfd501893d58e5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5617618
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
2024-06-11 00:18:47 +00:00
Daniel Verkamp
2dfbd8458c x86_64: tests: remove loop that never loops
The vcpu.run() is only ever executed once due to hitting either a break
or a panic; remove the loop {} to avoid a clippy::never_loop warning.

BUG=b:344974550
TEST=tools/clippy

Change-Id: I8a21ebcb2eb8aaba9d84b22c2368fb73cbf25742
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5617617
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 23:06:38 +00:00
Daniel Verkamp
69be993de4 devices: virtio-tpm: clean up error handling
Return a Result to simplify the error!() + return pattern used in the
virtio-tpm device's run() function.

Incidentally fixes a clippy::blocks_in_condition warning since the
.and_then() is no longer necessary.

BUG=b:344974550
TEST=tools/clippy

Change-Id: I3810759ab2e56facb248b6cf5def08ccd0870265
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5617616
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 23:00:05 +00:00
Daniel Verkamp
2f47ba1930 gpu_display: allow dead code in dwl bindings
BUG=b:344974550
TEST=tools/clippy

Change-Id: Ic20d3d01f7d8a60fefbc8abdcc8b9cb34fd7bb8b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5617615
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2024-06-10 23:00:00 +00:00
Daniel Verkamp
01c6ef9d3b Replace .get(0) with .first()
Fixes clippy warning in Rust 1.77

BUG=b:344974550
TEST=tools/clippy

Change-Id: I668cdbd6008524b2fbf1045afc3898bbffa188f3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609083
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2024-06-10 20:44:59 +00:00
Daniel Verkamp
6ea2abdd5c plugin: simplify I/O error handling
Fixes clippy warnings in Rust 1.77

BUG=b:344974550
TEST=tools/clippy

Change-Id: Ice53f116be7a8dc36a4675391ec5d635ab2d5bbf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609082
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 20:44:54 +00:00
Daniel Verkamp
2cb56cf311 Fix redundant references clippy warnings
BUG=b:344974550
TEST=tools/clippy

Change-Id: I335d5972c7604345f5d1f2e7ba37a1ffef162101
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609081
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 20:44:49 +00:00
Daniel Verkamp
7d2280f04e kernel_loader: simplify match of empty buf
Fixes a clippy warning in Rust 1.77.

BUG=b:344974550
TEST=tools/clippy

Change-Id: I05ce1a304943e56d03544169558e5012e6c04eb8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609080
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 20:44:44 +00:00
Daniel Verkamp
90a10c419e devices: virtio-console: pass slice rather than &Vec
The process_tx_ctrl_*() functions don't need the Vec, just the elements
it contains.

BUG=b:344974550
TEST=tools/clippy

Change-Id: I4d0c475dbe1aa8c0f990d301d77a5b163435eb2e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609079
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2024-06-10 20:44:37 +00:00
Daniel Verkamp
390e3ffc2c Replace .map(Arc::clone) with .cloned()
Fixes clippy warnings in Rust 1.77

BUG=b:344974550
TEST=tools/clippy

Change-Id: I0a39e3d17c7ffc0e0e6c87c4d25e5c9287e1cb78
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609078
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 20:44:32 +00:00
recipe-roller
8bdb41716a 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/8745490587706885393

recipe_engine:
76cc89d9b3
  76cc89d (mohrr@google.com)
      [config_types] Remove deprecated Path methods

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: Ia4ca88f5c31941c6415bf8784970f65d2f7cf061
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5617770
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>
2024-06-10 20:37:52 +00:00
Daniel Verkamp
b27e34916c Fix clippy::thread_local_initializer_can_be_made_const
BUG=b:344974550
TEST=tools/clippy

Change-Id: I9875f910fbe3ac249e8f855a7b806e77347fb6d6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609077
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 20:07:13 +00:00
Daniel Verkamp
97848ecceb vm_memory: remove unused .enumerate()
Fix clippy::unused_enumerate_index warning

BUG=b:344974550
TEST=tools/clippy

Change-Id: I19ef94ce3a4bca3deae7d9cdbe00d73ef6637257
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609076
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 20:03:35 +00:00
Daniel Verkamp
50dd3cae44 kvm/tests: fix clippy::never_loop
This loop always ran exactly once, so it doesn't need to be a loop.

BUG=b:344974550
TEST=tools/clippy

Change-Id: I6fe2620d4ba712b573515122720caeafc44081cf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609075
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 20:01:39 +00:00
Daniel Verkamp
cf5d251863 Fix clippy::unnecessary_get_then_check warnings
Avoid .get()ting something just to check if it's present; use
.contains_key() instead (or .entry() in the case where we want to insert
an item if the key is not present).

BUG=b:344974550
TEST=tools/clippy

Change-Id: I78ee9e5a7ad9ffd693d9a50a347663444e1516a2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609074
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 20:01:30 +00:00
Daniel Verkamp
858c496b09 metrics: fix dead_code warning in test
BUG=b:344974550
TEST=tools/clippy

Change-Id: I73016330a52cdee7d518892d33012c0eb99f4f79
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609073
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2024-06-10 20:01:23 +00:00
Daniel Verkamp
d1c8d49249 vmm_vhost: fix clippy::option_map_or_err_ok
.map_or(..., Ok) can be replaced with the simpler .ok_or(...)

BUG=b:344974550
TEST=tools/clippy

Change-Id: I6bd50845e06b228e3c16a29fa15af1b1f5ffb68a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609072
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 19:50:12 +00:00
Daniel Verkamp
df8168ad25 Remove unused pub re-exports
Fixes new clippy warnings about dead code.

BUG=b:344974550
TEST=tools/clippy

Change-Id: If5dc935542db3f39e918845b5864c46dad4a902c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5604661
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 19:39:54 +00:00
Daniel Verkamp
7cf3dcacbf Fix clippy::suspicious_open_options warnings
Use .create_new() rather than .create() for cases where we always want
to ensure that the file does not already exist, and add .truncate(false)
for a case where we do want to open an existing file and don't want to
overwrite it.

BUG=b:344974550
TEST=tools/clippy

Change-Id: Ie82a6db306532c600c140efab3d310b6c7cf25a7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5604660
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 19:39:47 +00:00
Daniel Verkamp
4c2fa9d76d Fix clippy::assigning_clones lints
Use the potentially more efficient clone_from() function when cloning
and assigning.

BUG=b:344974550
TEST=tools/clippy

Change-Id: I0601b59a80fdebbc09b212110c6e68e23a52bcfe
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5604659
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 19:33:36 +00:00
Daniel Verkamp
349eb22eb8 swap: replace let-else with question mark operator
Simplify the error handling with an equivalent `?`.

Fixes clippy::question_mark warning.

BUG=b:344974550
TEST=tools/clippy

Change-Id: I9300d132b4031ec3e2f69eb792729e2d710d0914
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5604658
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2024-06-10 19:30:30 +00:00
Kaiyi Li
2fa09ea4de hypervisor: change VcpuX86_64::interrupt to only accept u8 vector
Under the hood, both AMD [1] and Intel [2] only accept 8 bit vector for event injection, so it's highly likely that all hypervisor implementation to encounter an error when we pass in values greater than 0xff as the vector.

From the source we can tell that KVM rejects any value greater than 0xff, HAXM has some strange unwanted behaviors with invalid vector values. From testing, we can tell WHPX also rejects invalid vector values right away.

[1]: Figure 15-5. EVENTINJ Field in the VMCB of AMD64 Architecture Programmer’s Manual, Volumes 2.
[2]: Table 25-17. Format of the VM-Entry Interruption-Information Field of Intel 64 and IA-32 Architectures Software Developer's Manual Volume 3.

TEST=./tools/dev_container cargo nextest run --workspace --profile=default -E 'package(hypervisor) & binary(hypervisor_virtualization)' --retries 0 --no-capture
BUG=b:334055761

Change-Id: Ied118f0df10e4a1c973b5b26327c24f45064d56c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5602270
Commit-Queue: Kaiyi Li <kaiyili@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Judson Powers <judsonp@google.com>
2024-06-10 18:43:56 +00:00
Oystein Eftevaag
8dc7504ffb Long mode test ASM version
Bug: 342012892
Test: It is
Change-Id: Ic506053ee759ddf8c768c0326148f59d545848c6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5597970
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Oystein Eftevaag <oysteine@chromium.org>
Reviewed-by: Judson Powers <judsonp@google.com>
2024-06-10 18:38:12 +00:00
Judson Powers
ffb0afcb3b hypervisor: Add a test for VMM segment register access.
Test=ran new test locally
Bug=b:334069801

Change-Id: I2d519f351cf6e5e3559d25f96b3589661300871a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5597299
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Judson Powers <judsonp@google.com>
Reviewed-by: Idan Raiter <idanr@google.com>
Reviewed-by: Oystein Eftevaag <oysteine@chromium.org>
2024-06-10 18:32:17 +00:00
Judson Powers
28635061ae hypervisor: Split flags register into its own test.
Test=ran both tests locally
Bug=b:339224921

Change-Id: Ia1c85fd8c534ec7e8fbfb44f4a1e6e04bd239319
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5597298
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Judson Powers <judsonp@google.com>
Reviewed-by: Idan Raiter <idanr@google.com>
2024-06-10 18:26:41 +00:00
Kaiyi Li
4fb26a3b7d hypervisor: test ready_for_interrupt for intercepted instructions
For emulated instructions, the hypervisor normally needs to intercept
the instruction, emulate it and advance the rIP afterwards. This test
makes sure that the interruptibility is correctly handled in this case.

Particularly, if an instruction is emulated after an sti when FLAGS.IF
is cleared or a mov ss, after the emulation. The interruptibility should
be restored.

Change-Id: Ib1e897b5d4dd97b2877814a6e7bff56e222d13d2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5610292
Reviewed-by: Judson Powers <judsonp@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Kaiyi Li <kaiyili@google.com>
2024-06-10 18:01:53 +00:00
Daniel Verkamp
31ff290605 aarch64, riscv64: fix max kernel command line length
The maximum command line length accepted by the guest kernel is a fixed
per-architecture constant; it is unrelated to the (host) page size,
which was used as the limit on aarch64 and riscv64 before this change.

Making crosvm limit the command line to the correct maximum length
allows for a more useful error message to be printed if the user tries
to use an overly-long command line; without this change, it would not be
apparent that the guest kernel was truncating the command line, leading
to unexpected behavior at runtime.

BUG=b:345478075
TEST=Boot Crostini and ARCVM on arm64

Change-Id: I207bda318b60d207ccb1ef5df1e59f30be238126
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5606562
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-10 17:43:02 +00:00
recipe-roller
8f1ae0318c 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/8745501913057135057

recipe_engine:
ea27cb4d3b
  ea27cb4 (olivernewman@google.com)
      [test] Surface summary_markdown in case of status mismatch

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: Ia3b34f92d11f9792f882976df97519fbac6a51df
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5615933
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>
2024-06-10 16:37:39 +00:00
Keiichi Watanabe
14907b14a6 ext2: Set up root dir and lost+found
Now, it can create a valid ext2 disk.

BUG=b:329359333
TEST=cargo test

Change-Id: I7ccf32810ec06291aea971e22ad839f9c9011036
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5400931
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2024-06-10 02:26:46 +00:00
Richard Zhang
499ffe5fc0 Fixed log to print "Card" instead of "Device"
BUG=b:342187194
TEST=builds and tests

Change-Id: Id504ffcf1c444ce047f27c9cd50c83d08a5b1a0f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5594205
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
2024-06-08 17:16:33 +00:00
recipe-roller
68e494c0cb 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/8745744133045892369

depot_tools:
954a8d7713
  954a8d7 (yiwzhang@google.com)
      error if roll-dep command is called in Cog environment

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: I851db1221ca88a73eba6d02a6f483cc37d324ab3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5610472
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>
2024-06-08 00:31:58 +00:00
recipe-roller
2cc11e2eab 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/8745753571075988785

depot_tools:
4a8524d1e9
  4a8524d (yiwzhang@google.com)
      error if repo command is called in Cog environment

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: Ia983d8f9d68b381804fd7d8c36d37f3c46480292
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609086
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>
2024-06-07 21:57:21 +00:00
Kaiyi Li
9c0de00fb2 hypervisor: add tests for interrupt injection when not ready
This test ensures that we don't deliver an interrupt if the guest is not
interruptible even when we call vcpu.interrupt() with
vcpu.ready_for_interrupt() returning false.

Below is the actual behaviors of different hypervisors, but our test
doesn't test against specific behaviors:

* For KVM, the interrupt injection succeeds, but the following VCPU run
  fails
* For WHPX, the interrupt injection fails as if we never try to inject
  the interrupt.
* For HAXM, the interrupt will be pending and will be delivered once the
  interrupt is reenabled.

TEST=./tools/dev_container cargo nextest run --workspace --profile=default -E 'package(hypervisor) & binary(hypervisor_virtualization) & test(test_interrupt_injection_when_not_ready)' --retries 0 --no-capture
BUG=b:334055761

Change-Id: I06d6f662457860a6fc1b2c7a657dfb42bb3c9b07
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5584661
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Judson Powers <judsonp@google.com>
Commit-Queue: Kaiyi Li <kaiyili@google.com>
2024-06-07 21:21:35 +00:00
Daniel Verkamp
e8ecf45228 Cargo.lock: update downcast-rs v1.2.0 -> v1.2.1
Updated via:

  cargo update -p downcast-rs

Resolves clippy::multiple_bound_locations in Rust 1.77.

BUG=b:344974550
TEST=tools/clippy

Change-Id: I8ea12931233e4dc2346c32732956a74d34017a7d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5606099
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-07 21:08:26 +00:00
recipe-roller
42c983118d 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/8745765523319982257

depot_tools:
dd8b5ea401~..705b8d2d8508cb7914a872cfb99a1bfeb2519798
  dd8b5ea (yiwzhang@google.com)
      fail gracefully if gclient-new-workdir.py is called in non-git env
  705b8d2 (jojwang@google.com)
      Fix google-java-format/cipd exists check.

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: I3e51cf7ed1483fe3c3ff218ae51975fb841a3334
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5604657
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>
2024-06-07 18:45:46 +00:00
recipe-roller
f24f1b6624 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/8745766781700915153

depot_tools:
aa89e07e15
  aa89e07 (yiwzhang@google.com)
      fail if fetch command is called in Cog

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: Idd750446cd83af671da48eb8aefa0e199d2241ea
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5604656
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>
2024-06-07 18:29:49 +00:00
A. Cody Schuffelen
8b1303447a Add snapshot/restore to pflash
Bug: b/345503926
Change-Id: I316cf490420bd5d0d740823d2b715541c1b4fa11
Test: Run with snapshot
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5604649
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Cody Schuffelen <schuffelen@google.com>
2024-06-07 18:16:39 +00:00
recipe-roller
23233b61c9 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/8745769928941428657

depot_tools:
b7b7718b47
  b7b7718 (jojwang@google.com)
      Support new third_party/google-java-format/cipd/ path.

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: Ie850416b0df568678af93d84356dc6eebce5e1e6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5604654
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>
2024-06-07 17:42:28 +00:00
recipe-roller
5472b937c5 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/8745779365866412641

recipe_engine:
f698b0fe97
  f698b0f (mohrr@google.com)
      [properties] Remove deprecated legacy() method

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: I1c26206d3176fb05640c5ae773ee7d3d6b4b3330
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5606093
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>
2024-06-07 15:08:53 +00:00
Judson Powers
5ab198b5ef hypervisor: Add a test for the fsbase and gsbase instructions.
Test=ran new test locally
Bug=b:334069801

Change-Id: Idf69d2bf2f49460f769501d8a2631ee417e1202c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5597300
Reviewed-by: Oystein Eftevaag <oysteine@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Judson Powers <judsonp@google.com>
2024-06-07 13:47:19 +00:00
recipe-roller
71015ca8c8 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/8745829063914543729

depot_tools:
951578030e~..e6d8f67fae6c1ec119dcdb7c1af84909a096144f
  9515780 (ukai@google.com)
      siso: set PYTHONDONTWRITEBYTECODE=1 if not set
  e6d8f67 (ukai@google.com)
      autoninja: set PYTHONDONTWRITEBYTECODE=1 if not set

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: I8e6b2d5de506e9699bac2a59b48a667f24fd2e8b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5604652
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>
2024-06-07 01:57:53 +00:00
Daniel Verkamp
809b1a718c devices: vfio: make global container state explicit
The vfio code previously managed singleton instances of VfioContainer
using thread-local variables hidden inside the implementation of
vfio_get_container().

Make the caller hold onto a VfioContainerManager rather than implicitly
mutating global state inside a library function in the vfio crate. This
also removes the possibility of accidentally creating new VfioContainer
instances by calling from a different thread, since the containers were
previously thread-local rather than truly global for some reason.

This requires threading the vfio_container_manager variable through a
few function calls, but this also helps clarify ownership and lifetime
of the objects involved.

BUG=None
TEST=tools/dev_container tools/presubmit

Change-Id: I2ba1be561c48143ff14e391c23bad1c6783b73ec
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5601348
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Pierre-Clément Tosi <ptosi@google.com>
2024-06-06 23:31:16 +00:00
Frederick Mayle
66e37a886d base_tokio: tube: require &mut self for send/recv
`base::Tube` probably ought to require `&mut self` (or be `!Sync`) since
it isn't safe to concurrently send or recv. Let's try to be stricter in
the new API, esp. since it requires non-trivial effort to port code to
this library, needing to manage tubes slightly differently shouldn't be
a big deal.

BUG=b:338274203

Change-Id: I7caf743744393aedf0a346ca23e970d15020704c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5604651
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2024-06-06 23:30:53 +00:00
Frederick Mayle
7ec3293ab4 base_tokio: tokio compatible Event and Tube types
BUG=b:338274203

Change-Id: I6fbce1386c2c086d7a53a706018d959f4fadfada
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5507771
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Frederick Mayle <fmayle@google.com>
2024-06-06 23:30:20 +00:00
recipe-roller
01f9a34a0b 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/8745850459652443569

depot_tools:
25b23eb1fd
  25b23eb (sokcevic@chromium.org)
      Remove profile.xml.

recipe_engine:
de58e85243
  de58e85 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 56b720dea312 to 6fb4d5d26773

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: I32cf844c510e3e1c50f14d616ade7136c03d69a5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5606083
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>
2024-06-06 20:14:35 +00:00
Daniel Verkamp
d776b48767 devices: virtio-fs: simplify ExpiringMap with entry()
BTreeMap implements an Entry API to allow efficiently checking whether
a key exists and retrieving it or inserting it if not:

<https://doc.rust-lang.org/std/collections/struct.BTreeMap.html#method.entry>

Using this API avoids the expect() calls since there is no need to
insert and then re-get the same entry.

This also fixes new clippy warnings from Rust 1.77.

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

Change-Id: I97c556376bdb27180232f6234820659360b72380
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5545765
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2024-06-06 19:50:01 +00:00
recipe-roller
b4210d0f0b 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/8745859264210479841

depot_tools:
a4f8f3559a
  a4f8f35 (yiwzhang@google.com)
      stop vending crosjobs from depot_tools

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: I7f39be90f3f46e50a5dab8c8d9acff60a0a77002
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5604646
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>
2024-06-06 17:58:30 +00:00
Daniel Verkamp
75a3c8ab2e base: fix clippy::multiple_bound_locations lint
Merge the `where` clause bounds into the ones in the generic type
definitions. This is also more consistent with the other functions in
this file.

BUG=b:344974550
TEST=tools/clippy

Change-Id: Ie4d33ae0c204dab6279607aa0b181768b42c75eb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5599145
Reviewed-by: Elie Kheirallah <khei@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-06 17:38:46 +00:00