This also upgrades the dev_container to package the new Rust version.
A few final clippy fixes are included as well.
BUG=b:344974550
TEST=tools/clippy
Change-Id: Iab4253e9cd88fdae989bb5b5170040b6af85baca
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609084
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This exercises more of the CacheMap API, and it also silences a clippy
warning about the value inside the test's NumCache structure being
unused.
BUG=b:344974550
TEST=cargo test -p disk --features=qcow
TEST=tools/clippy
Change-Id: I4cbee164fdd7c0bc662c804c50482d118ec05df3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5626478
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This previously held a raw descriptor (which is just an integer and does
not have an associated lifetime) and an Arc reference to its
corresponding HandleData in an attempt to ensure the HandleData did not
get destroyed while the RawDescriptor was alive. However, newer clippy
versions warn about the unused Arc<HandleDataField>, and this loose
association between the HandleData instance and the descriptor is prone
to being removed by accident since there is no actual lifetime.
To avoid this, keep only a MutexGuard<File> that refers to the file
inside the HandleData, and use a let binding to ensure that the Mutex
itself is alive for the remainder of the function (enforced with actual
Rust lifetimes rather than hopes and dreams).
BUG=b:344974550
TEST=tools/clippy
Change-Id: I4b1f66a2166422a87452fae597c3f08cbdc7dbe5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5623301
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
When the guest hits a vmexit, the hypervisor must preserve guest
register state, including MMX registers. This test verifies that the
hypervisor is correctly preserving one of the MMX registers. Since these
registers are generally preserved in a single block (e.g. with fxsave,
xsave, xsaves), testing a single register is sufficient.
BUG=b:333888472
TEST=presubmit
Change-Id: I728ddd2060ec298831c669442c540aa2d8fdd55b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5631973
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Idan Raiter <idanr@google.com>
Reviewed-by: Judson Powers <judsonp@google.com>
Reviewed-by: Oystein Eftevaag <oysteine@chromium.org>
Although ext2 crate works only on Linux, --pmem-ext2 was exposed on
Windows platform. So, we make this flag available only on
Linux family.
BUG=b:329359333
TEST=run crosvm with `--pmem-ext2 /path/to/crosvm/ext2/src/`
Change-Id: I25ee0c27727dce04efa803a69085f24020f17c68
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5633330
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
... to reflect changes from aosp/3127803 where an internal struct
is now used to allow for updates to the underlying ANativeWindow
when the viewer app is stopped/resumed.
Bug: b/334903567
Test: presubmit
Change-Id: I96e258e864e2265a66e253af400afba9e5c50073
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5637775
Reviewed-by: Jiyong Park <jiyong@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Jason Macnak <natsu@google.com>
Some control tubes were added to a `control_tubes` list but otherwise
not used. Remove the list and the related TaggedControlTube type to
silence new clippy warnings about unused enum fields.
BUG=b:344974550
TEST=tools/clippy
Change-Id: Iab579af685d41e55bf3b98cae45ec8034549b311
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5623440
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Symbolic links that are longer than or equal to 60 bytes require
a block allocated to store its destination because it won't fit
in Inode's i_block.
BUG=b:342937495
TEST=cargo test
Change-Id: Iadab10887c136019fe85e74fa981542384f48ad2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5569438
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
In ext2, if symlink name is shorter than 60 bytes, the data is
stored in the i_block member in inode.
BUG=b:342937495
TEST=cargo test
TEST=start VM with pmem-ext2
Change-Id: I1bac1405625af92cf521d8da502b19a1deacad20
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5569437
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
To allow files larger than (4*12)KiB, support indirect blocks and
double-indirect blocks so it now supports ~4GB files.
BUG=b:342937441
TEST=cargo test in /ext2
Change-Id: I0b8fd421e85d0a5e203876aa260077448f740737
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5569436
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
To distiguish disk blocks's IDs and other integers, intruduce a
new type `BlockId`.
BUG=b:329359333
TEST=cargo test
Change-Id: I292638977cc45219d914a4659161d0127725433f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5632089
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
dwl_context_new() did not check if the allocation failed before using
the returned pointer.
BUG=None
TEST=tools/dev_container tools/presubmit
Change-Id: Ibeb0fb0b0a6e434657f09f8c24a7bd6ff7f8c21a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5634619
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This error message is displayed on using the vhost-user block
implementation.
```
ERROR devices::virtio::vhost::user::device::handler] set_backend_req_connection is not implemented
```
fmayle@ and dverkamp@ pointed out in code review that this doesn't
signify an actual error, as crosvm also handles this message at a
different layer.
Bug: b:347308400
Test: Run with cuttlefish
Change-Id: I59f5fcefbc60aab4b2b1d7c188740eb6289bee41
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5634186
Commit-Queue: Cody Schuffelen <schuffelen@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Import balloon_control items directly from that crate rather than via
re-exports from vm_control.
This fixes the fuzzer build, which depended on an implicitly imported
type via one of the conditional wildcard imports.
BUG=chromium:69590
TEST=(cd fuzz; cargo build)
Change-Id: I97d5df66741cfb64f600bebd503b73d779888440
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5630345
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Previously, the GPU device's activate() function would panic if sending
the GpuActivationResources to the worker thread failed; this has been
observed in some crash reports, possibly due to activate() running
concurrently with a VM shutdown where the worker thread is already torn
down.
Instead of using expect() to panic if this send() fails, try to handle
the failure by putting the GpuActivationReosurces back into the device's
worker_snapshot field and bubbling up an Err result.
BUG=None
TEST=tools/dev_container tools/presubmit
Change-Id: Ie52e2ecee353e13ff1105c418722a1a8facf997b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5634184
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Avoids a clippy warning about the unused second field by renaming it to
have an underscore prefix.
It seems like the MinigbmDevice is only used to ensure that the
gbm_device is not freed while buffers that were allocated from it are
still live, so it is OK that it's unused.
BUG=b:344974550
TEST=tools/clippy
Change-Id: I53aee94d4b366cb25cbc3a360131345c05670aa8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5626405
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
With create_overlapped becoming a "must create" open call, the misuse of
it in a test where the file already existed became a hard failure. This
CL fixes that issue by moving to open_overlapped (as it should have been
before).
BUG=b:346381109
TEST=tested downstream
Change-Id: Id49739b8b32a23eabe78e8173d8c397a0b4607e2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5630351
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Noah Gold <nkgold@google.com>
Add an option to allow boosting vcpu threads with high uclamp so that
it'll move to bigger CPUs and higher frequencies.
BUG=b:342349882
TEST=tools/presubmit
Change-Id: Ib1cb15b0f862acf8ec95a00d12e7de23e0ddcb4f
Signed-off-by: David Dai <davidai@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5627833
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This adds support for interrupt injection when a guest vcpu is being
detected as stalled. A vCPU is stalled when it hasn't been
scheduled to run for a predefined interval chosen bt the VMM.
The interrupt property is appended to the device tree when using a Linux
configuration build under aarch64.
BUG=b:272284118
TEST=manual testing with CrosVM being built as part of the
Virtualization service apk. The Virtualization service is patched with
an updated prebuilt of the guest kernel with the patch that contains the
frontend kernel driver changes for the vcpu stall detector from here:
https://android-kvm.googlesource.com/linux/+/refs/heads/sebastianene/vcpu_stall_detector_ppi
Change-Id: Ia59910ea99c20cf37afc8c6ca9b3dfb001458a14
Signed-off-by: Sebastian Ene <sebastianene@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5053958
Reviewed-by: Pierre-Clément Tosi <ptosi@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
To support L1 HWDRM, Mali DDK now builds with protected memory feature
enabled on some platforms e.g. Geralt, but we are not ready to advertise
this feature to the guest side on those platforms.
Add an environment variable to disable the feature at runtime.
BUG=b:339766043
TEST=CtsDeqpTestCases dEQP-VK.protected_memory.* pass
Change-Id: I2903bf629ff81721cacb1fd5671062d0dfbaca53
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5619355
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Auto-Submit: Fei Shao <fshao@chromium.org>
Advertising 2 graphics queues from the same queue familiy is a hard
requirement for HWUI Vulkan backend on Android 14+.
BUG=b:323284290
TEST=adb shell cmd gpu vkjson show 2 queues
Change-Id: Ia4c080b4e3dc4958db2d6010bcf9d9fce591d04c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5623296
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Lepton Wu <lepton@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
The crosvm_control library's API and ABI should not depend on crosvm
configuration options. If functionality is not available in a particular
build, the library should just provide a stub version of the function
that returns an error, rather than changing the exported symbols or
function prototypes.
BUG=None
TEST=tools/dev_container tools/presubmit
TEST=cargo build --no-default-features -p crosvm_control
Change-Id: I4428d3efe8d52a16ec78998fd83cd7d16b6b7773
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5623295
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
This uprevs both testvm and devcontainer and uploads new builds.
This will update them to the latest debian images and packages.
Some minor tweaks were made to satisfy the newer versions of
mdformat and python.
BUG=None
TEST=presubmit all --no-delta
Change-Id: I73e30aa1d9cefb5cf4ac117f513c2a98bf3c9ac5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5416093
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
The vm_control client depends on crate imports that were implicitly
getting pulled in by a wildcard pub re-export. Remove the wildcard
import and import only the required types.
BUG=b:344974550
TEST=cargo build -p vm_control
TEST=cargo build -p vm_control --features=gpu
TEST=tools/clippy
Fixes: df8168ad25 ("Remove unused pub re-exports")
Change-Id: I83461203482d0174b8ca85c1cb1aadeb9afd2097
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5623434
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>