Several crates still declared a dependency on data_model despite not
using any imports from it.
BUG=b:312312646
TEST=tools/dev_container tools/presubmit
Change-Id: I63a67696c205f684b1e4ac8bdad4de5f294b63dc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5370964
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Use zerocopy functions directly instead. This is a step toward replacing
our data_model crate with standard crates.io functionality where
possible.
BUG=b:312312646
TEST=tools/dev_container tools/presubmit
Change-Id: I9717edce6fe2b4ca53ad9043db61de2e9bc55b78
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5046345
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Spawn a stub_worker thread as a part of the device initialization to
avoid blocking PvClockCommand request when the device is not activated
yet. After this change, the requester of PvClockCommand can expect the
response from the device even if the device is not active. This can
happen when the guest kernel does not support the PvClock device and
because of that the device is not activated (from the virtio device
perspective).
BUG=b:295256641
TEST=cargo test -p devices -- pvclock
TEST=cargo test -p e2e_tests -- suspend
Change-Id: I0efc10bbf0e1125bf2df9208e1d6bcc341867a7e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5312037
Auto-Submit: Hikaru Nishida <hikalium@chromium.org>
Commit-Queue: Hikaru Nishida <hikalium@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
It is a subset of test_sleep_snapshot_wake.
Change-Id: I2d81791169c8eb72ece82f674f18cbd496d4ff40
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5366977
Reviewed-by: Elie Kheirallah <khei@google.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Create and use PvClockState struct. Before this CL, PvClockSnapshot
had been created by hand because of Arc is used for total_suspend_ns.
However, it can be serialized when rc feature is enabled for serde crate
so enable it and share the common struct to make the code clean.
c.f. https://docs.rs/serde/latest/serde/trait.Serialize.html#impl-Serialize-for-Arc%3CT%3E
BUG=None
TEST=cargo build -F pvclock
TEST=cargo test -p devices -F pvclock -- pvclock
TEST=cargo test -p e2e_tests -- pvclock
Change-Id: I28ef9a3a4b2bf757397ce0be5a0c36bc72bc1489
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5312036
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Hikaru Nishida <hikalium@chromium.org>
Proton dx12 feature level 12_0 needs sparse binding support. It's
supported with RADV but disabled in Venus due to sparse-only queue
family is exposed by RADV. This change works around this by enabling the
radv_legacy_sparse_binding dri option for venus render server.
BUG=b:328827736
BUG=b:284361281
TEST=sparse binding reenabled on skyrim with latest radv
Change-Id: If9932adb9be5ecd374996f4d2765d918b674dedd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5357555
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olv@google.com>
RAM snapshot size and overall snapshot time for a basic ubuntu VM right
after login:
* no compression: 619M 0.8s
* lz4 compression: 175M 1.2s
BUG=b:320753724
TEST=crosvm snapshot take --compress-memory /tmp/crosvm-snapshot /tmp/crosvm-control
Change-Id: I5dff9fe8744847fea872ad78347ac5f7d8b957e3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5190788
Reviewed-by: Elie Kheirallah <khei@google.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Constructing a SafeDescriptor from file descriptor -1 will panic at
runtime when it becomes an OwnedFd wrapper. Rework the test code to
generate an Event with an invalid, but not that invalid, file
descriptor.
BUG=b:242953353
TEST=tools/dev_container tools/presubmit
Change-Id: I0c4865fc90f1c83ec9fb1a1dc1fa0600ce14f479
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5354689
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
"stdfd" replaces the dbus::arg::OwnedFd type with the OwnedFd from the
standard library (std::os::fd::OwnedFd), which allows safe conversion.
Also use SafeDescriptor::try_from() to clone the descriptor rather than
base::clone_descriptor(), which returns an unmanaged RawDescriptor.
BUG=b:327639547
Change-Id: Ifa1e6b783217e946c027e4db9a6202b39c92936e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5354030
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Make our custom SafeDescriptor type interoperable with the new standard
library OwnedFd type.
BUG=b:242953353
TEST=tools/dev_container tools/presubmit
Change-Id: Ibfa716fa81d4e5a4885e65ece29524831ea60ecc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5354029
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Add a new vulkan interface to GpuDisplay and GpuDisplaySurface, and
implement the new interface for GpuDisplayWin using VulkanDisplay.
Test: ran emulatorNexusHwcTest
Change-Id: I241af4edaae7c5d5d99f6b27fb2a7448b9a1b321
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5214575
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Colin Downs-Razouk <colindr@google.com>
It looks like r13 of the prebuilt uploaded does not include the change
made in https://crrev.com/c/5190792 . This CL updates the prebuilt
with the CL as well as the updates made so far.
BUG=b:295256641
TEST=tools/dev_container tools/presubmit all
Change-Id: I795762089ae8aaa42ab34ad9e9cf393429c237cc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5351685
Commit-Queue: Hikaru Nishida <hikalium@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The hypervisor::haxm module is only available for cfg(windows), so make
the cfg wrapping the tests use the same condition as the haxm module.
In theory, HAXM is available on Linux, but we don't support that; this
change makes the cfg checks consistent so that building and testing with
--features=haxm on Linux can succeed (without actually enabling HAXM).
TEST=cargo nextest run --workspace --features=haxm # on Linux
Change-Id: I6642acbe145ab8a44600e151443e05d349e05681
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5354026
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The event device type was missing, which makes it a hassle to determine
the type (it can be done from the index). Our path for reading events
also threw away the underlying error, which makes debugging pretty
tricky. This CL fixes both issues.
BUG=b:324486429
TEST=builds
Change-Id: Ie42c065fc6b35c9195db136b94e8831d82c8a23e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5351358
Reviewed-by: Pujun Lun <lunpujun@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Fixed blob mapping can still be enabled at runtime with
`crosvm run ... --gpu=fixed-blob-mapping=true`, if desired.
BUG=b:246334944
TEST=tools/dev_container tools/presubmit
Change-Id: Id3e668a98b4944a556adaefc6843c56732e3f90b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5354345
Commit-Queue: Ryan Neph <ryanneph@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
The mingw64 install script does not install winetricks, so it does not
need these variables. They are probably left over from a previous
refactoring. tools/setup-wine64 has the same variables, but they are
actually used in that case.
TEST=make -C tools/impl/dev_container crosvm_dev
Change-Id: I3993f4e53677752c973fc683d13f9dda68f6aae0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5353268
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This is to reduce the rounding error in converting period to msec.
With period_bytes = 1056, frame_rate = 48000, channels = 2,
bytes_per_sample = 2, period should be 5.5 msec, but instead it's
trunked to 5 msec. 0.5 msec of rounding error amounts to ~10% of period.
BUG=b:327766529
TEST=./tools/dev_container ./tools/presubmit
Change-Id: I19004952789c14926db95d18cbd020bf09bc9303
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5348306
Reviewed-by: Andrew Walbran <qwandor@google.com>
Reviewed-by: Jorge Moreira <jemoreira@google.com>
Commit-Queue: Kyujung Youn <kjyoun@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Make it easy to tell which prebuilt revision is used for the run.
BUG=b:295256641
TEST=CQ
Change-Id: Ib62d0539a248abe83291c4cec8085f929f159b2b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5343248
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Hikaru Nishida <hikalium@chromium.org>
Auto-Submit: Hikaru Nishida <hikalium@chromium.org>
The generic portion contains only interfaces, but no actual encryption
code. It will be used by an upcoming snapshot encryption option.
BUG=b:286345300
TEST=n/a (intended to always panic)
Change-Id: I54e8d4753a5584ffe7e9f0df5c31636ad34a905d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5350786
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
The sync::Mutex::new() function is const now, so it can be constructed
statically rather than requiring lazy initialization.
HashSet::new() is not const, so it cannot be used in a static init;
replace it with the equivalent BTreeSet, which has a const new()
function.
Change-Id: I339903c73f9ab3f41fbb517a30f2987d6d05cb3d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5342657
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
If a PCI device is hot plugged into a PCIe slot with pending hot unplug
events unhandled by the guest OS, the new device may not be discovered
by the guest. Therefore, crosvm shall not reuse the PCIe slots until
guest indicates the previous events are handled. This is achieved by
Prioritize vacant ports if available.
If all ports are busy, wait for command completion asynchornously
before sending hotplug signal.
An e2etest for the edge case is added.
BUG=b:325997618
TEST=./tools/dev_container ./tools/presubmit
TEST=tast run ${DUT} network.ARCIPv6Connectivity (downstream chromeOS on
a DUT with 2 ethernet adapters, ref: b:324979531)
Change-Id: I66d4ee9c88dd6c703491c1af440bc7160e8ff91b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5316598
Commit-Queue: Ningyuan Wang <ningyuan@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
When a PCI hot plug or hot unplug event is completed by the guest, the
hardware is notified by PCI_EXP_SLTCTL_CCIE. In this CL, we add a
notifier when hotplug is complete for PcieRootPort. This is infeasible
for other variants of HotPlugBus.
BUG=b:325997618
TEST=manual feature tests
TEST=./tools/dev_container ./tools/presubmit
Change-Id: I6ed138a3a6006b6d02fe660c293e298b1cc04701
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5326701
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Ningyuan Wang <ningyuan@google.com>