Commit graph

4243 commits

Author SHA1 Message Date
recipe-roller
4b08a1d393 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/8807915042097938257

depot_tools:
8168f76753~..f05fcf7051e12e5b561b8811e299096f332157f7
  8168f76 (qyearsley@chromium.org)
      Update lucicfg from version 1.31.4 to 1.31.5
  ea11cc3 (gavinmak@google.com)
      Remove apply_patch_on_gclient property
  26460d8 (thestig@chromium.org)
      Fix typos in PDFium fetch config.
  f05fcf7 (qyearsley@chromium.org)
      Update lucicfg from version 1.31.5 to 1.31.6

recipe_engine:
428eeaebf2
  428eeae (iannucci@chromium.org)
      Update buildbucket protos.

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: I8d0cc71f9f87a9b3e1c5ce222e118e6f90a87f88
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3781672
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>
2022-07-22 18:48:03 +00:00
Dennis Kempin
cd867d0089 infra: Re-enable recipe roller
Permissions should be properly set up now.

BUG=b:239081770
TEST=None

Change-Id: I05906a289791e4296d76bc0f807faa80456bff24
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780869
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-07-22 18:27:14 +00:00
Dennis Kempin
2341f7715b infra: Enable post-submit email notifications
Notifies the current crosvm oncalls when post-submit is failing.

BUG=b:238234148
TEST=lucicfg validate

Change-Id: I747f70d3abfb5dd26dedfcb2ed230122e063967f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3783012
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-07-22 18:19:59 +00:00
Alexandre Courbot
6f8f396312 virtio: vhost-user: introduce VhostUserDevice trait
Most of our VhostUserBackends require an Executor to be constructed,
which interferes with our wish to jail them: we want to create the
VhostUserBackend before the child process gets forked, but the forking
process would render the Executor invalid in the child.

Work around this issue by introducing a VhostUserDevice trait which is
supposed to include all the device state without its runtime. Once the
child process is forked, the device can be converted into a
VhostUserBackend using its into_backend() method.

This new trait is illustrated using the Console device.

BUG=b:217480043
TEST=cargo build

Change-Id: Ifc7525aae39da8fdb19fcd237832213c9223a56d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3762973
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Morg <morg@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-22 04:57:58 +00:00
Alexandre Courbot
eb9e563e4d virtio: vhost: user: allow listener to yield resources for parent process
A listener is responsible for managing and cleaning up its own
resources, but this can cause problems when jailing device processes.

Typically, the listener is created in the parent thread and then passed
to the device thread so the device thread does not require the
capabilities to allocate the listener's resources. However, when cleanup
time comes, the listener in the child is still responsible for
destroying the resources created by the parent, which may require extra
capabilities. For instance, for a vhost-user socket the listener is
expected to remove the socket file, but we don't necessarily want the
child to be able to remove files from the filesystem...

Fix this by adding a new method, take_parent_process_resources(), that
can be called prior to creating the child process by the parent in order
to obtain the resources that the parent needs to cleanup when the child
process exits. The resources are presented in the form of an opaque box
and must be kept by the parent until the child process exits. After
that, dropping the box will free the resources that we don't want the
child to clean up.

If we are not creating a child process, then the method is simply not
called and the listener will cleanup the resources itself.

BUG=b:218223240
TEST=vhost-user console device gets properly cleaned up.

Change-Id: I7b8c4b700a868f4fd100c45f0e577fddfe8bb216
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3762972
Reviewed-by: Morg <morg@chromium.org>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-22 04:57:58 +00:00
Noah Gold
5cbe496fde gpu_display: fix overflow in EventDevice
send_report used to panic if we tried to send more events than would fit
in the buffer. Now overflow is handled gracefully. We've also increased the
buffer size, which was previously quite tiny, so that we're less likely to drop
events if there is a flood of them.

BUG=b:239699447
TEST=builds. tested downstream.

Change-Id: Ie4b9d927bb75c6a3126de17e781d4a3e18551f7c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780879
Commit-Queue: Noah Gold <nkgold@google.com>
Tested-by: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
2022-07-22 04:48:28 +00:00
David Stevens
a22f74428b vhost_user: add support for shared memory regions
BUG=b:201745804
TEST=compiles

Change-Id: I389e14f457942398323b01a5ffccf5d9d153dfb2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765013
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
2022-07-22 02:30:59 +00:00
David Stevens
e9673a428a wl: allocate dma-bufs in process
Directly allocate dma-bufs within the virtio-wl process and remove the
VmMemoryRequest::AllocateAndRegisterGpuMemory type. This is preparation
for migrating to the SharedMemoryMapper interface.

BUG=b:201745804
TEST=Launch arcvm, launch gedit w/crostini, launch gedit w/vhost-user-wl

Change-Id: I232f1fd3dfdb8d7ed068c6b3c2ea23f35d0ddabc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765012
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
2022-07-22 02:28:09 +00:00
Junichi Uekawa
6e7a617abb crosvm: Make commands work.
Previewing docs, from CONTRIBUTING.md or from the dev_container, it's
`cd docs/book`.

BUG=None
TEST=copy-paste

Change-Id: If56a9f83c6722764b0979b6738f96a0800031da6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3779081
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-22 02:05:48 +00:00
Dennis Kempin
89f754b0be docs: Fix link to building_crosvm.md
BUG=None
TEST=mdbook build docs/book

Change-Id: I5331cb9fed056c8b57171ba3db4d5b2521e6995c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3782185
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-22 01:52:58 +00:00
David Stevens
6d7143990a balloon: Improve optional queue handling
Make status queue properly optional. As part of this, refactor how the
optional event queue is handled, to prevent exponential growth in the
number of select statements needed to handle optional queues.

BUG=None
TEST=ARCVM boots and balloon works

Change-Id: I55d59875b7e0223a57f1c8c5d0e0d8a4a6b9a26c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3779083
Tested-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
2022-07-22 01:27:23 +00:00
Richard
a5df8a52c0 devices: Upstream virtio vsock
Currently this only builds and runs for Windows

BUG=b:213149155
TEST=built and presubmits

Change-Id: Icc874da61c987fc36c4c9ccea56bd136d660f453
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764469
Tested-by: Richard Zhang <rizhang@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-07-22 00:29:48 +00:00
Mike Gerow
0c49f872a1 devices: add pflash to provide NVRAM for OVMF
This change adds a pflash implementation similar to the the one QEMU
has[1] for the purpose of giving OVMF a place to store BIOS settings and
UEFI variables. Unlike the QEMU version, though, this one only
implements the parts that OVMF relies on[2], and is therefore much simpler.

[1]: https://github.com/qemu/qemu/blob/HEAD/hw/block/pflash_cfi01.c
[2]: https://github.com/tianocore/edk2/tree/master/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c

TEST=tools/presubmit --all; boot VM under OVMF and confirmed UEFI
variables can be set and are persistent
BUG=b:238344840

Change-Id: I83bebb57006f39c6f0eb7ee4986c6af0e64de0bc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764374
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Mike Gerow <gerow@google.com>
Commit-Queue: Mike Gerow <gerow@google.com>
2022-07-21 23:17:32 +00:00
Vikram Auradkar
2314c4701b crosvm: Fix drift
BUG=b:213146388
TEST=presubmit

Change-Id: I59e6b7ad7aff8d4659c62e310a7955146a10d743
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3777405
Tested-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-07-21 23:13:18 +00:00
Daniel Verkamp
5a4ed32368 tools/cl: add prompt to set upstream branch if missing
When running tools/cl on a branch without an upstream set, ask if the
user would like the script to fix it automatically.

BUG=None
TEST=tools/cl upload # on a new branch with no upstream

Change-Id: Id5f4ee30058a209ac352013159d09278cd92a23b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780873
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-21 21:51:48 +00:00
Daniel Verkamp
32ba2688bb tools/cl: add prune to usage text
BUG=None
TEST=tools/cl --help

Change-Id: If4e632b00b04c9ab4644c37c039372969abf8c3a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780872
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-07-21 21:44:18 +00:00
Junichi Uekawa
15c09e6d7f crosvm: Spell fix.
BUG=None
TEST=None

Change-Id: I88830bdf8023f8e812e33bf6326f0dd39e970c61
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3779078
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
Tested-by: Junichi Uekawa <uekawa@chromium.org>
2022-07-21 21:34:18 +00:00
Dennis Kempin
290622c389 tools/cl: Always run prerequisites
It was missing in some commands. Also runs them when no command
is specified. This will ensure the git hook is installed and
print documentation when calling: "./tools/cl"

BUG=b:239823229
TEST=./tools/cl

Change-Id: Id2248310011f4692cf477ac51d52b578d2f00a8d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780868
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-07-21 18:50:48 +00:00
Dennis Kempin
12d4f71cb2 Update CONTRIBUTING.md
The doc was long outdated.

BUG=b:239823229
TEST=None

Change-Id: If324c7b3fe22f03df4307a5eed1002465b5cce4d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780867
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-07-21 18:35:51 +00:00
Dennis Kempin
163494513c infra: Add cros_workon flow to chromeos builder
We want to ensure that ChromeOS workflows to not break over time.
This is the primary supported workflow for building and testing
crosvm.

BUG=b:239255196
TEST=led get-builder luci.crosvm.ci:chromeos_amd64-generic | led
edit-recipe-bundle | led launch
https://ci.chromium.org/swarming/task/5c3a9bd9490cad10

Change-Id: I3afed9ebeff3ac2829fc7990ff520c24017ac812
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780866
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-07-21 18:35:51 +00:00
Dennis Kempin
b97b89fc0f Update ChromeOS Docs
Reflecting the new repository, supported workflows
and code submission process.

BUG=b:239255196
TEST=None

Change-Id: I52d7130ec3d72ea5ef8748875cae029f0b1f701b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780864
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-21 18:35:51 +00:00
Dennis Kempin
353efef6d9 infra: Add project-crosvm-committers group
The group will allow us to give service accounts CQ access.
Notably it'll allow us to add the recipe autoroller.

BUG=None
TEST=lucicfg validate

Change-Id: I3127dc2127a93ea8b76bfd31941095eb243556c2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764437
Tested-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-21 18:34:41 +00:00
Keiichi Watanabe
c6245341ec devices: vmwdt: Fix rustdoc::bare_urls warnings
BUG=none
TEST=tools/cargo-doc

Change-Id: Ibec2c3f289f57cbabc1533a97fbfb20dbe3385ed
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780082
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-21 17:22:00 +00:00
Daniel Verkamp
967e30e0fc windows: adjust import paths and Cargo.toml deps
Fill in some of the missing imports and adjust the ones with paths that
differ in upstream crosvm.

This change was tested by removing crosvm from WIN64_DISABLED_CRATES in
tools/impl/test_config.py. Some dependencies are still missing, so the
crosvm bin crate does not fully compile yet.

BUG=b:213146388
TEST=run_tests --build-target=mingw64

Change-Id: I112e1db8bf34eed9fba7e539ce8ec84318acd291
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3777070
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
2022-07-21 17:19:50 +00:00
Daniel Verkamp
000cee6a9e metrics: add is_initialized() stub
This is used in src/sys/windows/main.rs.

BUG=b:213152497
TEST=Attempt to build crosvm bin crate for Windows

Change-Id: Ia49b9925a85ed738bcc6a229efd79840e9fd6c72
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3777069
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-21 17:11:00 +00:00
Keiichi Watanabe
3c82cee8c0 tools: cargo-doc: Exclude crash-report feature
Exclude crash-report feature when generating cargo-doc because the
feature only works on Windows. This should fix GitHub action's failure
started by crrev.com/c/3765346 [1].

[1] https://github.com/google/crosvm/runs/7417889096?check_suite_focus=true

BUG=none
TEST=run ./tools/cargo-doc locally

Change-Id: I1481bf8221fc7a583b9147992d116278b4df9e05
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780081
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Tested-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-21 16:57:14 +00:00
Doug Horn
8d79dbb21c Fix build with no crash-report.
Bug: NONE
Test: Compile

Change-Id: Idb905038e1982babcd2ff936674986d9ff24ac8c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3777068
Tested-by: Doug Horn <doughorn@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Doug Horn <doughorn@google.com>
2022-07-21 15:43:10 +00:00
Vikram Auradkar
33974789a7 devices: add bus statistics
Collect stats for read and write functions.

BUG=b:213149155
TEST=presubmit

Change-Id: Ia9d6a5fe006d2377dadde7215a9bf6ecd7966b13
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3773173
Tested-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-07-21 15:14:50 +00:00
Sebastian Ene
acb1f6683c vmwdt: Add memory mapped watchdog backend driver
This adds a new dt node identified by "qemu,vm-watchdog". The watchdog
is instantiated per-cpu and each instance has the following layout
described in this document:
https://docs.google.com/document/d/1DYmk2roxlwHZsOfcJi8xDMdWOHAmomvs2SDh7KPud3Y/edit?resourcekey=0-oSNabc-t040a1q0K4cyI8Q#heading=h.4hbqud2zl941

The watchdog uses an internal clock which is driven by the
timerfd at regular intervals. When the internal clock expires, a counter
value is decremented. When the counter register reaches value "0",
the watchdog expires. To prevent 'watchdog expiration', regular pet
events should be sent from the guest kernel driver.

BUG=b:213422094
Signed-off-by: Sebastian Ene <sebastianene@google.com>
Change-Id: Ic8c0488ffdfed1a43b6deb34b72d37f46e5e18a2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3768290
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-21 14:07:11 +00:00
Gurchetan Singh
51c07a15b3 crosvm: nuke gfxstream syncfd
Nobody ever toggles this flag, implying this flag can be removed.

By default, the gfxstream assumes ANDROID_EMU_virtio_gpu_native_sync
is present, which is the desired behavior.

BUG=b:239639751
TEST=compile gfxstream

Change-Id: I64d19c5fc2c0ac59a87ee25fbd1e7b6ed9522410
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3778078
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
2022-07-21 00:16:41 +00:00
Gurchetan Singh
0ae68e5076 rutabaga_gfx: gfxstream: stream_renderer_context_create
Newer version with context init variable.

BUG=b:235485545
TEST=compile

Change-Id: Ia9ce7a17c59db9839bdb0caf42a97708a3fdb46f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3778077
Reviewed-by: Kaiyi Li <kaiyili@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
2022-07-20 23:51:30 +00:00
Daniel Verkamp
e6eeb715f3 main: clarify config parsing control flow
It was a bit difficult to see that the config parsing errors would be
printed out before init_log(); split it into a separate block to make it
more understandable.

BUG=b:239622092
TEST=tools/presubmit --all

Change-Id: Id7fb76c706c2e9f5e0161dac28099bff95fd5f78
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3774317
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-07-20 21:19:00 +00:00
Daniel Verkamp
f0d2ddddf5 main: print config errors with eprintln
If run_vm fails to convert the RunCommand into a Config (e.g. due to
failures in validate_config), no error message would get printed, since
the error!() logging macro was used before logging was initialized.

Instead of error!(), use eprintln!() to print the error to stderr so we
actually get useful output for configuration validation errors.

BUG=b:239622092
TEST=crosvm run --kvm-device /does/not/exist vm_kernel

Change-Id: Ia63f5b10f6ac7087aca10aa71df7d45a6fd5b70e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3774316
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-07-20 21:19:00 +00:00
Dennis Kempin
f4e4f35d4a infra: Fix git repack cwd
BUG=None
TEST=./infra/recipes.py test run
led get-builder luci.crosvm.ci:health_check | led edit-recipe-bundle | led launch

Change-Id: Idd6b0b70271bbc0b489bd4a25470ca53e1e2a4ac
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3777063
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-07-20 20:43:15 +00:00
Dennis Kempin
7be83ca79a infra: Repair submodules if sync fails
The submodules on our builders were getting into a bad state.
This change should be able to repair those cases.

BUG=None
TEST=./infra/recipes.py test run

Change-Id: I87198c30478f25d505f9a9ad5211af6fe7bbd547
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3777061
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-07-20 20:05:50 +00:00
Daniel Verkamp
8b62989327 crosvm: plumb --hypervisor option to cmdline
This allows the selection of the hypervisor kind from the command line;
it was previously added to Config, but there was no way to set it from
the CLI.

Linux builds only have one hypervisor available (kvm), but the config
support is stubbed out to match the Windows platform code so it can
potentially be hoisted into a common implementation later.

BUG=None
TEST=tools/presubmit --all
TEST=crosvm run --hypervisor kvm ...

Change-Id: I6eedb6f8179233bfd51f56efd6713cfe9453dc25
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3774503
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-20 20:03:29 +00:00
Daniel Verkamp
52675ca555 crosvm: clean up kvm device creation checks
Remove the redundant file existence checks and replace them with a
better error message from the call where we open /dev/kvm or the path
specified by the user with --kvm-device.

Example error message:

  crosvm has exited with error: failed to open kvm device
  /does/not/exist: No such file or directory (os error 2)

BUG=None
TEST=crosvm run --kvm-device /does/not/exist vm_kernel

Change-Id: I8ba7ce5d77441f193174ec891709a47165787a9f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3774502
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-20 05:15:40 +00:00
Dmitry Torokhov
e3554d516d devices: vvu: remove knowledge of PCI from open_vfio_device
Now that we no longer switch drivers for VVU PCI devices when accessing
them via VFIO, open_vfio_device() need not be aware that it is dealing
with a PCI device and can instead handle any device given its sysfs
path.

BUG=b:196186396
TEST=Boot redrix-manatee, start crostini.

Change-Id: Ieda8f2b846a96b9c054dfdd0602101a4b3c11424
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3766820
Auto-Submit: Dmitry Torokhov <dtor@chromium.org>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
Tested-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-20 00:49:09 +00:00
Vikram Auradkar
7110ddc62b x86_64: build and test on windows
BUG=b:213149155
TEST=presubmit

Change-Id: I15d217ffd355563b839bf4d7b0d0a19e01666060
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3774497
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Tested-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-07-19 23:55:49 +00:00
Vikram Auradkar
1a29d849a4 devices: refactor acpi
Enable acpi on windows.

BUG=b:213149155
TEST=presubmit

Change-Id: I697f118ca59b73679debeed7a4b7c168b8c61b1b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3774496
Tested-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-07-19 23:55:29 +00:00
Vikram Auradkar
ce5172c899 crosvm: upstream windows src
- Upstreams all windows specific files in src/
- Adds windows specific args to Config/Command parsing.
- Adds noop anti tamper crate.

There are still some deltas between upstream and downstream src because
of moving HEAD in upstream and some code refactors downstream. But this
is most of the code.

BUG=b:213146388
TEST=built on windows downstream. upstream crosvm does not build on
     windows yet because of to-be-upstreamed dependency crates.
     presubmit.

Change-Id: I3445975749f8108ae51d5fb6e1c2f1447439e1fb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765346
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Tested-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-19 20:58:59 +00:00
Noah Gold
46b9f75a36 arch: split platform serial code into sys mod.
As part of the split, we're re-enabling the Windows code (it was
commented out as part of earlier refactoring).

BUG=b:237597358
TEST=builds

Change-Id: I04554b109033b4616c0a6521757c4aeb70d2ea5d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3767462
Tested-by: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2022-07-19 18:20:59 +00:00
Zihan Chen
e2f7c0c24b crosvm: Fix cross-compile in dev container
- Fix devcontainer.json to be used by vscode correctly
- Fix wayland-protocols path finding
- Add missing SYSROOT env for pkg_config
- Add missing linker settings

TEST=native/armv7/aarch64 targets compile in dev container

Change-Id: Id6fc43b2fd63d09bc46169d996387d5417ada93e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3766822
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-07-19 17:07:49 +00:00
Daniel Verkamp
6385eee278 devices: remove ioevents() overrides that can use the defaults
A few PciDevice implementations were providing an ioevents function that
did the same thing as the default trait implementation. Remove them to
clarify which devices actually need ioevent support.

BUG=None
TEST=cargo build

Change-Id: I40a6ca14028ea1d739f169c81079ffac648e7035
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3770820
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-19 16:41:59 +00:00
Norman Bintang
022fb73b67 audio: Reconfigure usage of audio_cras cfg
Reconfigure usage of audio_cras cfg to allow virtio-snd device
to be compiled with null audio device. audio cfg is still needed
to compile audio device. Also fix clippy errors in virtio-snd.

BUG=b:233542268
TEST=emerge and aplay with enabled and disabled audio_cras cfg

Change-Id: I2e0a4114314891794dbf3c060f47247f876db80a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765005
Commit-Queue: Norman Bintang <normanbt@chromium.org>
Tested-by: Norman Bintang <normanbt@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
2022-07-19 06:31:39 +00:00
Dennis Kempin
a919bcb7a5 tools/dev_container: Support cros checkouts
Mount the cros root instead so the git worktree or symlink can be
resolved.

BUG=b:234322274
TEST=./tools/dev_container

Change-Id: I52d0cbe5e9a38cb6febcf1f328970e13209bcf9f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3768048
Tested-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
2022-07-18 23:32:48 +00:00
Daniel Verkamp
4ca8a5fe3a config: parse VvuOption with serde_keyvalue
This removes a bunch of boilerplate parsing code.

BUG=None
TEST=cargo test

Change-Id: I8c557feb9f483552f3ba7f905eb49b53f48d8177
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3767095
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-18 20:07:18 +00:00
Daniel Verkamp
67eb9cfb33 devices: pci: serialize PciAddress as a string
Implement custom serde Serialize/Deserialize versions that just format
the PciAddress as a plain string rather than a struct so it can be used
for parsing command-line options.

BUG=None
TEST=cargo test -p devices

Change-Id: Ia6e5891c614be1fc7e1d136e40835e1622f5a2c0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3767094
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-18 20:02:28 +00:00
Vikram Auradkar
f1d8ff7d19 devices: refactor bat.rs
Windows does not use monitor. Move unix specific monitor feature
under sys/unix.

Enable bat module for windows.

BUG=b:213149155
TEST=presubmit

Change-Id: Ic48562f4d7e78a332e5387e5274131d35a59a7b5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764428
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Tested-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-07-18 16:34:39 +00:00
Daniel Verkamp
db94670f7f main: restore --syslog-tag functionality
The crosvm run --syslog-tag argument was accepted, but it did not do
anything after the argh refactor. Tweak the LogConfig setup so the
default tag is "crosvm" and can be overriden by the --syslog-tag option.

BUG=None
TEST=crosvm run --syslog-tag="TESTVM" ... # observe tag in syslog

Change-Id: I7cd83b0623ac725c59a1dc1fcc4f8952e749e00a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764041
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
2022-07-16 03:17:26 +00:00