The `error!` macro is still used when the audio_cras feature is enabled.
Add its import back.
BUG=None
TEST=emerge-trogdor crosvm
Change-Id: I06430fece32fc203bf0e9005f29e346dad88eea4
Fixes: 28c318fa20 ("Fix ChromeOS build")
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3798972
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
- Remove trailing ::{self} on all use statements
- Remove any resulting single-level use statements (e.g. use libc;)
- Reformat with `tools/fmt --nightly`
BUG=b:239937122
TEST=tools/dev_container tools/presubmit --all
Change-Id: I8afd1b0458ca6d08d9b41a24583f7d4148597ccb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3798973
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
This mirrors the functionality of the `crosvm run --syslog-tag` option
that we already have; the long-term goal is to remove the run-specific
option and use the top-level argument instead, but we will keep both for
compatibility until downstream projects have migrated.
Moving the option to the top level arguments will let us initialize
logging earlier once the run option is dropped.
BUG=b:240578830
TEST=crosvm --syslog-tag TEST run bzImage # observe TEST in syslog
Change-Id: Ie7ff8dc8e43a13b11641fcefd12b40ecf339970b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792427
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Extend the preferred_address() support to PCIe devices, specifically the
various PCIe root ports.
BUG=b:237415650
TEST=tools/presubmit --all
TEST=Boot x86_64 bzImage
Change-Id: I56109530ccb43a17bdf9b74eec612a527028cc7c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3786974
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Rather than deferring the choice of PCI address to runtime during the
allocate_address() function, move it to the constructor so an error
message can be returned earlier. This lets us report the preferred
address in the PciDevice impl so that the PCI address allocation code in
arch can reserve the preferred address before allocating addresses for
other devices.
BUG=b:237415650
TEST=tools/presubmit --all
Change-Id: I8a00f5f4251450f475bc83c346b3288dbf901f1d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3786973
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Prior to this CL, the StreamChannel in base/src/sys/unix had no tests
for FramingMode::Message. This CL adds a test for that framing mode.
Bug: b:231641496
Change-Id: I75e13709d558258eca838c3190aaf0237e39513b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3793688
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Clarissa Garvey <clarissagarvey@chromium.org>
Tested-by: Clarissa Garvey <clarissagarvey@chromium.org>
Add a new PciDevice::preferred_address() function, which allows devices
to report a PCI address where they would prefer to be allocated.
This lets the arch layer pick out the devices that need to have their
addresses reserved before allocating the remaining addresses to device
that don't care about their assigned PCI address.
For now, the returned preferred_address value is not actually used aside
from checking is_some(), but it will be used in upcoming cleanups.
BUG=b:237415650
TEST=Run x86-64 bzImage
Change-Id: Ia323274dcf801a8fe1959287bcc791ca32ce4e18
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3781441
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
If the VirtioDevice provided a preferred PCI address, we previously used
it but did not reserve the address in the resource allocator. This could
have resulted in address reuse. Add a case to reserve the preferred PCI
address if it was specified.
BUG=b:237415650
TEST=tools/presubmit --all
Change-Id: Id84a9cee99e8955dae174be4f5a6a6c60fb17bd9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3781440
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
By default, KSM is disabled by the kernel. This is harmless if KSM
is disabled, and only causes merging if the user manually enabled
the feature on their kernel. If enabled, significant memory saving
can occur, at the cost of CPU cycles and a reduction in privacy.
Bug: 1346340
Change-Id: I838cdda97ea8d335b1953dd6775311958069898c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780870
Reviewed-by: David Manouchehri <david@davidmanouchehri.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Currently, --unprotected-vm-with-firmware does not load the provided
firmware and therefore doesn't execute it either. Instead, it jumps
directly to the provided payload. Fix the config assignment causing this
behavior.
BUG=b:240704906
Change-Id: Iaedaa372d668b2fab70a80252e30f608b48c2099
Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3794252
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Andrew Walbran <qwandor@google.com>
Re-enable the shared memory feature for virtwl now that the driver has
been fixed by crrev.com/c/3787666.
This reverts commit bdba48b64b.
BUG=b:213532601
TEST=crostini.CopyPaste.wayland_to_x11_buster_stable
Change-Id: I987060756b9eb683f1375fc1f0ce32d6c3077ead
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3789168
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Add a wrapper for libavcodec's AVBufferRef and allow AvPacket to be
built from one ; this makes the AvPacket the owner of the data and means
it doesn't need to internally copy it.
The input data will be dropped once avcodec signals that it doesn't need
it anymore.
BUG=b:169295147
TEST=v4l2r's simple_decoder can decode a H.264 stream.
Change-Id: I9fa54124daed031fd1f397eaa8d57dc73f83c9b8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782037
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The original contributing.html link was broken since we shuffled some of
the directories around.
BUG=None
TEST=follow the link
Change-Id: I0c2c9ce0fa79e786d87e679b8391f884b0b8cc4a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3795006
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This will generate the search index and in-browser search for the book.
BUG=None
TEST=mdbook build docs/book
Change-Id: Ibaf67002c5b5d5cf1aafd19ab66a05b9116b14a0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792098
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
This does not include ac97_bus_master being upstreamed, which will be
done in a followup CL
BUG=b:237681055
TEST=built for both platforms and ran Windows tests locally
Change-Id: I3220caf7e87c5c236a975304ac9af10dcf6829f0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764045
Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Richard Zhang <rizhang@google.com>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Closing one of the deltas in base crate.
BUG=b:213146388
TEST=presubmit
Change-Id: Ibac36d1ad9b1b6387ec74e8b59ccb38319903655
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3793691
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Ran clippy with features that are enabled downstream. Those features
will be enabled upstream in later cls when crosvm starts building.
BUG=b:213146388
TEST=presubmit
Change-Id: I67cb74127a349b572e573c350d69d1611533d961
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3793690
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Tested-by: Vikram Auradkar <auradkar@google.com>
Make the InputBuffer type able to send the event signaling its
availability to be reused itself, when it is dropped. This does not
bring any immediate benefit, but is going to be a required design for
the next CL, where we transfer its ownership to libavcodec in order to
avoid copying its content.
BUG=b:169295147
TEST=v4l2r's simple_decoder can decode a H.264 stream.
Change-Id: I822bac85d9cd5f87e450e4c7ec009bb75655e91f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782036
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
So far we were using EventQueue in a very simple and controlled manner ;
but efficient decoding patterns are more complex than that and we are
soon going to need to keep references to the queue from remote corners
of the code and post events from there, which requires mutable access.
To help with this, add a SyncEventQueue type that is essentially an
EventQueue wrapped into a Mutex, which allows us to make its methods
non-mut.
BUG=b:169295147
TEST=v4l2r's simple_decoder can decode a H.264 stream.
Change-Id: Ife94629ab2382eb0aac5786ba24373c66b80efc7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782035
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Enable vhost-user sound frontend even without audio cfg. It makes vhost
user sound frontend available in crosvm-direct. It is okay because
vhost-user frontend doesn't do any device emulation. crosvm-direct is a
lightweight crosvm binary to run ChromeOS VM and other guest VMs on
ManaTEE.
BUG=b:240363846
TEST=run crosvm with audio cfg as backend
TEST=run crosvm without audio cfg as frontend then call aplay
Change-Id: I9e6c3f22ca725e1689930cbb0503ad8bfab9264d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3784682
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Commit-Queue: Norman Bintang <normanbt@chromium.org>
Tested-by: Norman Bintang <normanbt@chromium.org>
See go/crosvm/infra for instructions on how to get access to uploading
them.
Added a helper script to install dependencies needed to build the
guest_under_test.
BUG=b:235269312
TEST=Kokoro
Change-Id: I78387a33ddbf3ab199b36e76ba617acb1250c7e5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3783011
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Do not delete files in GCS, it contains an index.html we
want to preserve. Ideally we will generate it automatically
in the bot.
BUG=b:239255064
TEST=./infra/recipes.py test run
Change-Id: I5df428ce4198d04374e51ac2372e5daceb6e2651
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792629
Tested-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This allows you to use the nightly version of rustfmt
to reformat imports as well.
BUG=None
TEST=./tools/fmt --nightly
Change-Id: I07c2fd1ad59ddfed3d97b636f991ae50076fd5d3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792430
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
"display_params" better reflects the actual type. They are eventually
passed to struct Gpu and VirtioGpu and they are also called
"display_params" there, so this feel more consistent.
BUG=b:233676779
TEST=presubmit
Change-Id: I315b7be92ae60a0996290ea5ee180e2b0efde279
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3792773
Tested-by: Pujun Lun <lunpujun@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Pujun Lun <lunpujun@google.com>
Export only the few items that are actually needed. This also cleans up
an unused import warning when compiling with --no-default-features.
BUG=None
TEST=cargo build
TEST=cargo build --no-default-features
TEST=cargo build --no-default-features --features=gpu
TEST=cargo build --no-default-features --features=plugin
TEST=cargo build --no-default-features --features=gpu,plugin
Change-Id: I0293cbe702059b785a51363e5376c27378931fb8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3786978
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Without this change, the plugin code won't build when the gpu feature is
disabled because it tries to use the undefined GpuRenderServerParameters
type.
BUG=None
TEST=cargo build --no-default-features --features=plugin
Change-Id: Id412eb17d5e845daca6c11e2cfe304f3dbe718a3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3786977
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
CRC32 of checkout's path is now part of dev-container's instance
name.
TEST=`docker ps` shows crc of script's absolute path in checkout
FIXED=b:237592974
Change-Id: I7179c40e5c8436a5866d5d75b01696dc788725c9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3790038
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Zihan Chen <zihanchen@google.com>
Auto-Submit: Zihan Chen <zihanchen@google.com>
The ChromeOS toolchain is updated to this point, so bring our crosvm
testing in line.
BUG=b:239075544
TEST=tools/presubmit --all
Change-Id: I6bfa7bfd802f1cd75204ba59b560de176a56326f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764424
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The calling code in vm_concierge has been updated to specify values for
these options, so we can remove the fallback code now.
For any downstream project that may be using these flags, the defaults
correspond to:
--battery => --battery type=goldfish
--video-decoder => --video-decoder libvda
--video-encoder => --video-encoder libvda
--gpu => --gpu backend=virglrenderer
--gpu-display => --gpu-display width=X,height=Y
BUG=b:235882579
TEST=Start Crostini and ARCVM on hatch
Change-Id: I1fa5667a275fc72d03c2b71aea399afd3552a24c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3786917
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Support using a vhost-user-gpu feature without needing to set the gpu
feature flag.
BUG=b:201745804
TEST=launch crostini on ManaTEE, run glxgears
Change-Id: Ifd8668a2419043ef5f1782655fcb394d069f274f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765080
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Switch gpu from command tube to SharedMemoryMapper. This requires
replacing VmMemorySource::Vulkan with support in the gralloc frontend
trait.
This cleanup also allows the gpu device backend to control the shared
memory region size, rather than having it set by the vhost-user-gpu
device.
BUG=b:201745804
TEST=launch ARCVM and crostini on volteer
Change-Id: I0e66ac7d70b32e4a944a68acbbe064396727b329
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765019
Commit-Queue: David Stevens <stevensd@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
Only signal the txq_notifier when a message is actually written.
BUG=None
TEST=launch ManaTEE sibling
Change-Id: I631720b270a75a010bac5efc94158ab1875dd99e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3787935
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Add support for SHMEM_MAP and SHMEM_UNMAP. This requires mapping the
buffer in the device backend via VFIO and reconstituting it as a udmabuf
in the proxy device. It's also necessary to handle unmap operations in
the device backend, to unmap the buffer.
BUG=b:201745804
TEST=launch sibling VM on manatee
Change-Id: I505960cd5047ded172c25748c8aff32ac2d93cd7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3779086
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Support backend request channels (i.e. slave_req_fd) with vvu. The
backend channel is proxied with the same virtqueue as the frontend
channel, so this requires muxing and demuxing the messages in the proxy
and device handler respectively. Supporting this in the device handler
requires making the backend channel a vmm_vhost Endpoint rather than a
plain File, to allow the platform-specific Connection to construct the
proper Endpoint.
BUG=b:201745804
TEST=launch sibling VM on manatee
Change-Id: Ibada1764fc74ed759f59fc5f483bb17e1b269abd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765017
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Indicate when a vfd has no associated pfn when using a shared memory
region by sending the pfn offset corresponding to the size of the shared
memory region.
BUG=b:213532601
TEST=crostini.CopyPaste.wayland_to_x11_buster_stable
Change-Id: Ia2cee6a58c91b474e90837c389dd12dea55e54e5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3789167
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
Fixes a clippy warning with Rust 1.60 - the variables can be initialized
right away rather than having a separate `let` without an assignment.
BUG=b:239075544
TEST=tools/clippy
Change-Id: Ifd1db84ba5b4bf45c5e5efebcddf2e35a760a071
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3790037
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>