* cli to disable interrupt
* use out to cause a VMEXIT and request an interrupt window
* sti to reenable the interrupt
* test whether we receive a VMEXIT for interrupt window
TEST=./tools/dev_container cargo nextest run --workspace --profile=default -E 'package(hypervisor) & binary(hypervisor_virtualization)' --retries 0
BUG=b:334055761
Change-Id: Idf04a7e3d85dff32b5a5f8d590cbb852bbe58ec9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5599545
Reviewed-by: Judson Powers <judsonp@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Kaiyi Li <kaiyili@google.com>
It is necessary to test set_interrupt_window_requested on HAXM, which
doesn't distinguish between VcpuExit::Intr and VcpuExit::IrqWindowOpen.
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: I1969d0bb25c7580a14de749a99805cdf9d96e48d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5599544
Reviewed-by: Judson Powers <judsonp@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Kaiyi Li <kaiyili@google.com>
From local testing, there are less browser janks when ARCVM has a guest
swap pmem device with no timer, compared to a pmem device with 1 second
swap interval. Adding some pmem code to handle not create a timer when
the interval is 0 to allow experiment with this option.
BUG=b:329310285
TEST=./tools/dev_container ./tools/presubmit
TEST=crosvm run with 0 swap interval, verify no swap activities
Change-Id: I163ff8c20b9ceb041914ae9531449349f58ca2c5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5601346
Commit-Queue: Hung Nguyen <hungmn@google.com>
Reviewed-by: Brian Geffon <bgeffon@chromium.org>
Reviewed-by: Alexandre Marciano Gimenez <raging@google.com>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
FusedFuture implies Future, which triggers a new Rust 1.74+ warning,
clippy::implied_bounds_in_impls. Remove the redundant Future to fix it.
BUG=b:344974550
TEST=tools/clippy
Change-Id: Ib22e3c7d3eb1c3dbe8a7c8bd2ddc421288a7e3db
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5599143
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Fixes a clippy warning inside the uuid!() macro:
error: index is out of bounds
--> src/crosvm/config.rs:2073:18
|
2073 | Some(uuid!("12e474af-2cc1-49d1-b0e5-d03a3e03ca03"))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
BUG=b:344974550
TEST=tools/clippy
Change-Id: Ib043053144201787c65c5ed53334ab94aec88582
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5601345
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Fixes
warning: unused return value of `Box::<T>::from_raw` that must be used
--> src/lib.rs:285:18
|
285 | unsafe { Box::from_raw(*ptr) };
BUG=344998548
TEST=compilet
Change-Id: Ibb75410519f447c9ef19e1eff3ec79d01ab03c34
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5599140
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
This is somewhat more modern than the Makefile. Both just invoke
cargo under the hood. The proper solution may come when Meson
starts supporting external crates:
https://github.com/mesonbuild/meson/issues/2173
Right now, this is a just a minimal version for developers. A known
issue is modifying dependent crates (rutabaga_gfx) doesn't cause
a rebuild. A solution is just `touch src/lib.rs` in ffi.
Also, `ninja -C build/ clean` isn't recommended. Just do cargo
clean.
BUG=344998548
TEST=meson setup build
ninja -C build/ install
Change-Id: Id5a142cc5cb5a8001198afc4d1cdbe800ec2ec23
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5599139
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
This is more concise and accomplishes the same thing. It also
incidentally avoids a clippy warning about using .get(0) instead of
.first().
BUG=b:344974550
TEST=tools/clippy
Change-Id: Ie8575f63ca7aacd91123c81a6f533b4a2d1408d2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5598299
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
These don't need to be try_from(), since the destination type can
represent all possible values of the source type.
Fixes upcoming clippy infallible conversion warnings.
BUG=b:344974550
TEST=tools/clippy
Change-Id: I6fab70ef0888a66c0d5464a64f9daf28d4e3741e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5597966
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
This change introduces feature audio_aaudio on top of the support of
virtio-snd-multiple-backend. The android_audio uses the Android
AAudio NDK library to play audio. A libaaudio_stub is provided for
building and testing on non-android environment.
Bug=b:325930215
Test=Play Youtube video on panther
Test=./tools/dev_container
Test=cargo build
Test=cargo build -F audio_aaudio,libaaudio_stub
Test=./tools/run_tests
Test=./tools/presubmit
Change-Id: I7c275433bf94d4a347720ce0ffa9127ffcb66a1e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5556704
Reviewed-by: Jiyong Park <jiyong@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Auto-Submit: Mu-Le Lee <mulelee@google.com>
Commit-Queue: Mu-Le Lee <mulelee@google.com>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
After [crrev/c/5579863](http://crrev/c/5579863), a slot would reject any
hotplug requests until it is ready. To accomodate this, The manager adds
EmptyNotReady and OccupiedNotReady states to a slot, and waits for port
ready notification to send requests. Unit tests added. e2e tests are not
feasible since the current test VM does not accept commands until the
guest is ready.
TEST=presubmit tests
TEST=manual test: Add device before PCI enumeration, then remove and add
BUG=b:331529292
Change-Id: I7769667a9838fe8869b8855bc6b080d6e451fad2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5578630
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Ningyuan Wang <ningyuan@google.com>
This CL adds a notification event when a PCI slot is enabled by the
guest, and is ready for accepting hot plug events.
TEST=presubmit tests
BUG=b:331529292
Change-Id: I69cda392eb7bdfec5a4b731990c0c3816e8359ad
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5578629
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Ningyuan Wang <ningyuan@google.com>
When a PCIe slot is initiated, the power indicator defaults to OFF.
However, as a device behind the bridge can be added and initiated by
flipping PCIE_SLTSTA_PDS, then discovered by PCI enumeration, the power
indicator does not match the status of the card. Such an inconsistency
is problematic for subsequent hot plug requests. As a result, no hot
plug events shall be made until the port is enabled by the guest.
TEST=presubmit tests
BUG=b:331529292
Change-Id: Id1cee16ed97a2f13fca842d8b3437023968257c1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5579863
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Ningyuan Wang <ningyuan@google.com>
idanr@ has been writing and reviewing CLs in CrosVM & a downstream
product for over a year. In addition to his primary work, Idan has
completed a key refactoring project in upstream CrosVM where he
unified the GPU device stack (vhost-user/plain virtio), and has
upstreamed significant GPU code. Over the past month, he has been
consistently reviewing CLs in upstream CrosVM as is expected for
OWNERS. Idan regularly demonstrates good technical judgment for
changes in CrosVM, and has a holistic view of the codebase.
I believe the requirements for global CrosVM OWNERS have been
satisfied, and as such nominate idanr@ for the role.
BUG=none
TEST=idanr@ has been writing & reviewing code in CrosVM for some time
with good results.
Change-Id: I66b50034d6f481ba94d38fba07c03b6723bc31e4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5582033
Reviewed-by: Idan Raiter <idanr@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
error[E0599]: no method named `uses_vulkano` found for struct `RutabagaGrallocBackendFlags` in the current scope
--> external/crosvm/rutabaga_gfx/src/rutabaga_gralloc/gralloc.rs:280:18
|
29 | pub struct RutabagaGrallocBackendFlags(pub u32);
| -------------------------------------- method `uses_vulkano` not found for this struct
...
280 | if flags.uses_vulkano() {
| ^^^^^^^^^^^^ help: there is a method with a similar name: `uses_vulkan`
BUG=336291294
TEST=cuttlefish_fastboot_flashing_test
Change-Id: Ie57505e576f948d7fe30a56733da3bbddbb8e2ac
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5581104
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Transmuting from [u8; 16] to [u32; 4] was undefined behavior, since the
alignment of u32 is larger than that of u8.
Replace this conversion, as well as the corresponding conversion back to
an array, as `from_ne_bytes()` and `to_ne_bytes()` functions as wrappers
around the standard `u128` functions by the same names, and implement
`u128` <-> `WHV_UINT128` conversions in a safe, straightforward way
with casts of the union fields to the appropriate native types and
shifting.
BUG=None
TEST=tools/presubmit_clippy_mingw64 # with whpx feature
Change-Id: I4e3fa84ade61c7da6e66f3dbf6a110e81bf8b1fa
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5577447
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Remove some members that are no longer working on
crosvm, add others to fill the void.
Change-Id: Ieb5f769be5678dde199f2f5f183c0dc4ec09332d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5577440
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
RutabagaGralloc is used for two things:
1) Allocating swapchain buffers
2) Using Vulkan to map buffers via hypervisor-specific syscalls
(2) is done in the main crosvm process, and could be sensitive
to performance considerations. The "cuttlefish_fastboot_flashing_test"
seems to fail when Vulkano is initialized. Maybe initializing Vulkan
takes too long, who knows.
Only Windows uses (2), and Linux doesn't really need it right now.
All Linux platforms could benefit from (1), so modify
RutabagaGralloc initialization so Vulkan is available for (1) but
not (2) on Linux.
BUG=336291294
TEST=cuttlefish_fastboot_flashing_test
Change-Id: Ic753298230f05e4c314f65b3efbb362c76e21cd9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5577398
Reviewed-by: Frederick Mayle <fmayle@google.com>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>