Commit graph

6375 commits

Author SHA1 Message Date
Daniel Verkamp
49ba9f2df6 tools: port cargo-doc to python
This lets us use the common arg parsing infrastructure, and it should
work on Windows (as opposed to the previous bash script).

BUG=b:267672683
TEST=tools/cargo-doc
TEST=tools/cargo-doc --target-dir=/tmp/crosvm-doc

Change-Id: Ib56f4d28965d32ea01a9aa55d7840edfb71f3d59
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4483471
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-27 20:51:42 +00:00
Idan Raiter
8831cf5560 audio: Windows: Fix realtime priority not being set
Both single and multi process did not have realtime priority, due to us
dropping the multimedia trick handle in set_audio_thread_priority where
we should be holding it until the thread is finished.

BUG=b:276698085
TEST=Process explorer -> properties -> threads -> base priority
increases from 8 to 24

Change-Id: Ia9199f4816e087046b8718e85c60abc9479ec0f3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4416757
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Idan Raiter <idanr@google.com>
2023-04-27 18:52:14 +00:00
Andrew Walbran
1661dfca89 Update bitflags dependency to 2.2.1.
This is a new major version, and requires some code changes.

Change-Id: I294ce3604aad6e6dc5f50e33246b690e883c1e36
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4481294
Auto-Submit: Andrew Walbran <qwandor@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-04-27 17:22:36 +00:00
Frederick Mayle
547f9a222d cros_async: test blocking pool handle drop behavior
This was implicitly tested before, but seems worth an explicit test.

Change-Id: I0d31051a8422d61f91938fc5975f230346bbce65
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4478450
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-04-27 05:16:37 +00:00
Daniel Verkamp
a0d49e7a0b tools: chmod +x install-riscv-deps
Change-Id: I6e31e1b060862b9ac09aeed4947725ed1d7ac426
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4482132
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-04-26 23:51:10 +00:00
Daniel Verkamp
1aff211998 arch: use cfg_if to clean up hypervisor *Arch types
Also use the arch definitions in the main crosvm crate to avoid
duplicating the cfg checks.

BUG=None
TEST=tools/dev_container tools/presubmit

Change-Id: Ia92b2840b0f6c8f0daa25f4b2b185ef7ef372860
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4477764
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-26 22:26:56 +00:00
Daniel Verkamp
63f50362ec devices: virtio: overhaul DescriptorChain API
Summary: DescriptorChain now reads the full chain when it is created.

Previously, DescriptorChain worked more like an iterator, returning one
descriptor at a time. This meant that DescriptorChain::checked_new()
returning Ok(...) did not guarantee the whole chain was valid, so
callers - in particular, Reader::new() and Writer::new() - had to be
fallible so they could report errors.

With the new API, DescriptorChain::new() reads the whole chain of
descriptors before returning, validating the required properties that
were previously deferred to Reader/Writer creation errors. This means
that Reader::new() and Writer::new() can now be infallible, which
eliminates error cases all over virtio device code.

Since the Reader::new() and Writer::new() function signatures are
changing anyway, take the opportunity to remove the redundant
GuestMemory parameter to those functions; DescriptorChain already holds
a reference to the GuestMemory.

The internal structure of DescriptorChain has been modified in
preparation for supporting packed virtqueues (in addition to the current
split virtqueues). The queue-type-specific code has been factored into a
separate trait implementation (DescriptorChainIter) so it is separate
from the high-level descriptor chain validation logic and IOMMU
translation.

BUG=None
TEST=tools/dev_container tools/presubmit

Change-Id: I48fd44b7f3e8b509dcb3683864a3f9621c744c4c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4391797
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Maciek Swiech <drmasquatch@google.com>
2023-04-26 20:27:16 +00:00
Daniel Verkamp
74d423fb04 virtio: iommu: fix inside-out Option references
Change-Id: I4a8ee44f07491825ea346168fa888ba69774b559
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4391796
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-26 20:11:21 +00:00
Dennis Kempin
0db4f0e964 presubmit: Run tests/builds with verbose output
The presbumit tool takes care of truncating results in a readable
way. And we can see full output when things fail, and in CI logs.

BUG=b:279641456
TEST=presubmit --no-delta

Change-Id: I347dc938fd07f265d4adb641e2f2818cd37e7db2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4481511
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-04-26 19:14:32 +00:00
Dennis Kempin
831b5a6735 infra: Fix git unshallow in chromeos_hatch builder
The dev container used to wrap commands in bash, now we need to
explicitly call bash to run the script.

BUG=None
TEST=https://ci.chromium.org/swarming/task/61d79d241817fc10

Change-Id: Idaeb53bf848ffcd49911dad4e195f49dc3df69b2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4481513
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-04-26 19:11:48 +00:00
Daniel Verkamp
3acd42c084 win_util: remove build.rs script
This seems to only generate bindings for ImmDisableIME(), which is
unused in upstream crosvm and also seems to be available without running
a build step now.

BUG=b:277957421
TEST=tools/dev_container tools/presubmit

Change-Id: Ic5a996eb9d8c7d7c65e2138fe92e8ea335cac76f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4477411
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
2023-04-26 18:25:31 +00:00
Dylan Reid
36af53e278 dev_container: Add riscv64 support
Because bullseye's cross packages for riscv64 are broken, libcap needs to
be manually built and installed, and pkg-config needs a hacky define to
allow minijail to find it. Other than that, it's very similar to the
other architectures.

Change-Id: I903f7ccd2ccbd94168ba09b425fd649458fdee70
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460942
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-26 17:36:40 +00:00
Dylan Reid
38d1242859 Add riscv target to main crosvm build
Allows running crosvm on riscv64 devices.

Tested on a qemu host with `-machine virt,aia=aplic-imsic,aia-guests=4`

Change-Id: I9b369718bcb438f043e3342f1866c56fc4983304
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460941
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-26 17:29:25 +00:00
Dylan Reid
b7193b9b6b riscv: limit dependencies to riscv builds
Instead of unconditionally depending on these dependencies only include
them for riscv64 builds. This will fix a build breakage on the windows
builders.

Thanks to denniskempin and dverkamp for suggesting this fix.

Change-Id: I035dc23cd0b58f63a3bcb3b8f883aba97d56492d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4477776
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-26 17:29:09 +00:00
Junichi Uekawa
810d131d67 crosvm: Uprev cbindgen dependency
Match version available in Debian.

BUG=b:265082456
TEST=build

Change-Id: I8fc3b65fb8bb6cc3f7e512921d96c8cbbc4291b5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4364561
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2023-04-26 00:26:32 +00:00
Dennis Kempin
2fc3ca56fa presubmit: Check lockfiles first
Any cargo invocation will update the lockefile. This ensures that we
can catch if the lockfile needs updating.

BUG=b:275372360
TEST=Tested by https://crrev.com/c/4475489

Change-Id: Ib43a30ef006604c0177e1bc4d1e91e669a4775af
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4476887
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-04-26 00:09:36 +00:00
Dennis Kempin
a17fe54cb4 presubmit: Remove crosvm direct build
This is no longer needed as crosvm direct support is turned down.

BUG=b:279218487
TEST=presubmit

Change-Id: I07fd936ab65d043313f901130f9cf4ff43876fab
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4476884
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-04-26 00:09:36 +00:00
Dennis Kempin
bbb6a24d51 tools/presubmit: Add doctests
Adds an invocation to run doctests to the health_checks builder.

To make this not run by default on every `tools/presubmit`
invocation, this CL splits default_health_checks out of the
health_checks group.

BUG=b:242635135
TEST=tools/presubmit health_checks

Change-Id: Ic850c461eb79e81c4b8118fc3182614fac907569
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4476090
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-04-26 00:09:33 +00:00
Dylan Reid
0594d03dbf seccomp: Add riscv64 policies
Add a basic starting point for riscv64.

constants generated with a slightly modified gerneate_constants script
to run on a riscv64 native system as there isn't a chroot for that:)

TEST: with the rest of the series applied, boot an ubuntu riscv64 VM
using crosvm from a riscv64 host with sandboxeing emabled.

Change-Id: I1ae7db4204df2ffdf1666ebc3e955a97d812f92a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460940
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-04-25 22:18:57 +00:00
Dylan Reid
3e431eb5dd devices: Add riscv irqchip support
This only supports systems with AIA virtualization support. Note that
AIA support is new, but has been frozen by riscv and the interfaces are
stable and landing upstream.

Change-Id: Ibdf58d4cd8710c11e1a2a158c2e9d8a53a97603a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460939
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-25 22:13:04 +00:00
Dylan Reid
5c0f979761 hypervisor: add riscv64 kvm support
Add basic support for linux kvm running on a riscv64 cpu. Mostly mirrors
the arm support as the interfaces are luckily similar.

Change-Id: I77c091d9b30758788b7c97bc0b3804879e27055d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460938
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-25 22:10:18 +00:00
Dylan Reid
8712539449 arch: Import riscv types when building that arch
This imports the basics that are needed and closely mirrors x86 and arm.

Change-Id: Ia7894166092bccf1ff13dd2e1c8fb17e0d2acca3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460937
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-25 22:05:38 +00:00
Dylan Reid
f30889ca70 Add riscv arch crate
Basic support for riscv. This, combined with follow on commits adds
basic support for booting a linux kernel on a riscv machine. This has
been tested with a qemu host as the riscv hypervisor extension is not
yet widely available in hardware.

Change-Id: I44f83f1acf1be2297b62d1f10311e3e47319e5f8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460936
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-04-25 22:05:38 +00:00
Lepton Wu
495f4913f7 devices: gpu: Add some log when gpu boots.
This add around 60 lines of log for each boot. It only log in boot
stage. This will be reverted after we collected some samples from
production.

BUG=b:183540186
TEST=emerge-$BOARD crosvm

Change-Id: I599d49db7fe82e3a6857572298ab462e03f45cf6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4472969
Auto-Submit: Lepton Wu <lepton@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-04-25 21:54:57 +00:00
Dennis Kempin
e577c91efc dev_container: Always run as root inside container
Since we default to podman, we can get rid of the _user container and
run as root inside the container, which greatly simplifies the tooling.

This also allows us to provide a single, default devcontainer.json
for local development as well as codespaces.

podman can be used with this devcontainer.json as well, e.g. in
VSCode by setting:

"dev.containers.dockerPath": "podman"

The with_kvm/devcontainer.json can be used to add access to kvm, which
may not be available on all machines. So it's an optional config.

BUG=b:273529620
TEST=Open with devcontainer in VSCode with both docker and podman,
run `presubmit --no-delta`
TEST=tools/dev_container tools/presubmit --no-delta

Change-Id: I10e04898a0e1adb6e4939f6f2e0259dc9b9aa62d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4419666
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-04-25 21:33:42 +00:00
Lepton Wu
b53382b3d6 Revert "devices: Add some log for debugging purpose."
This reverts commit 1262d0a735.

Reason for revert: Reduce log spam. Change to better version.

Original change's description:
> devices: Add some log for debugging purpose.
>
> This will be reverted after we collected some samples from production.
>
> BUG=b:183540186
> TEST=emerge-$BOARD crosvm
>
> Change-Id: Iae849cb63624babe53872e949f2cfad31a3a1d50
> Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4368978
> Commit-Queue: Lepton Wu <lepton@chromium.org>
> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>

BUG=b:183540186
TEST=emerge-$BOARD crosvm

Change-Id: Ia8140b3fff8c66f904902a3501c13129e6f0f81c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4476584
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Lepton Wu <lepton@chromium.org>
Auto-Submit: Lepton Wu <lepton@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-25 19:33:50 +00:00
Gurchetan Singh
d18ff41fad rutabaga_gfx: nuke unnecessary gfxstream flags
gfxstream has transitioned to simpler ways to configure the renderer,
use them.

BUG=278138335
TEST=launch_cvd

Change-Id: If0918495c2683cd2d99ed5c49c6bf01dd2edfe5f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4470287
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2023-04-25 17:32:51 +00:00
Alexandre Courbot
70715a0828 crosvm: cmdline: allow cfg to be used in configuration files
Allow the `cfg` field of RunCommand to be used in configuration files,
providing a mechanism for configuration inclusion.

Configurations are merged in the following order: first the included
files by order of specification (recursively), then the parent file,
then finally the other command-line arguments.

BUG=b:218223240
TEST=booted a VM with a configuration file that included another one and
confirmed both settings were applied.

Change-Id: I0c1e1b12b7c329510d450069e2e9de5b52af7734
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4414504
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2023-04-25 06:30:48 +00:00
Dylan Reid
b5ddb52d8a kvm: Add some riscv cfg guards
Some features present on aarch64 and x86 aren't yet on riscv, add
conditional compile checks.

Change-Id: Ie29e0b7b78af1cb43c04fa1e22c48645c2de8386
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460934
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-25 00:13:57 +00:00
Dylan Reid
94f82931a4 kvm_sys: initial riscv64 bindings
Add initial KVM bindings generated from a 6.2 tree with the AIA patches
applied.
See the riscv_kvm_aia_v1 branch here: https://github.com/avpatel/linux
The AIA changes should land soon upstream, but pulling them in early
won't hurt other arches and will allow riscv to get started.

Change-Id: I9e20c968e6c044100bc6ec1b2fb5f441f0276f77
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460933
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-25 00:13:57 +00:00
Dylan Reid
095e8ef207 rutabaga_gfx: Re-add supported arch checks
Later commits add basic support for riscv64 builds. This commit re-adds
the checks for compilation of debug output that were present before
aarch64 was ready. This allows unsupported architectures to build, even
if they don't have graphics support yet.

Change-Id: I42f2aadfed709378173ff6a6414c2896cc685baf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460932
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-24 23:57:40 +00:00
Dylan Reid
79b959f6cf kvm_sys: Remove KVM_SET_MEMORY_REGION
This ioctl has been long deprecated and is removed from 6.2+ kernels.
It's not used by crosvm so this change should have no affect.

Change-Id: Ieb1b7c1772643d221356ca1ecb8f6a32095febba
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4460931
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-24 23:20:41 +00:00
recipe-roller
eec6fffdb9 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/8782895181033062113

depot_tools:
183769121f~..7a0fe8bf3cf3f51531827e5c02f7b7aff27e3937
  1837691 (iannucci@chromium.org)
      [lucicfg] Roll out lucicfg 1.39.5
  407e5e7 (brucedawson@chromium.org)
      Show error on Fixes: and suggest Fixed:
  34f62b4 (sokcevic@chromium.org)
      Run post submit hooks on vpython3 if vpython is unavailable
  48fcabe (jwata@google.com)
      [autosiso] suggest using siso command direclty for non build co...
  dec6fdd (yoshiki@chromium.org)
      Revert "[lucicfg] Roll out lucicfg 1.39.5"
  b5cec8c (machenbach@chromium.org)
      Fix Python2 fallback in git-cl post-upload hooks
  7a0fe8b (bentekkie@google.com)
      Move reclient cache dir to gclient root to avoid wipeout on gn...

recipe_engine:
8389d65c78
  8389d65 (flowerhack@google.com)
      [docs] Update incorrect docstring.

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: I9bc9497c68e8b7eef731ab8f79440906c427d373
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4470850
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-04-24 22:44:23 +00:00
Daniel Verkamp
e7c26c37ed p9: account for header in maximum message size
The previous maximum size was 64K minus 1 byte; this also did not leave
room for the request/response header, so the actual maximum transfer
size in a single request was slightly smaller.

Use 64K + 24 bytes, since this matches the P9_IOHDRSZ subtraction used
by the Linux 9p client to calculate the maximum I/O size.

BUG=b:265610073
TEST=strace 9s on host and verify larger read()/write() syscalls

Change-Id: Ia606222d3c52a7a6e3f6cfca1a9fcbd78e223855
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4455812
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-24 19:25:36 +00:00
Daniel Verkamp
de92350a06 p9: report iounit as 0 in create/open
The iounit value is meant to be an upper limit on the size of each I/O
sent by the client: <https://9p.io/magic/man2html/2/iounit>

Previously, we used the stat() st_blksize value for iounit; this caused
the Linux 9p client to split up every read/write request into 4096-byte
chunks in the usual case of an ext4 host filesystem, which causes very
low performance.

Report iounit=0 instead, which will allow the client to send Tread and
Twrite requests up to the negotiated msize (maximum message size).

BUG=b:265610073
TEST=strace 9s on host and verify larger read()/write() syscalls

Change-Id: I86341998f440ac1c567da7d8fc6e740189ccb44a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4455811
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2023-04-24 19:22:05 +00:00
recipe-roller
6ec92bb2f5 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/8782910281399949041

depot_tools:
59ebbc12eb~..2d1c655c2cefe38bfbdeb26b8937600ed1eb30d9
  59ebbc1 (chanli@chromium.org)
      [depot_tools] Roll led
  9e36ef6 (bentekkie@google.com)
      Add convenience wrapper for reclientreport for autoninja users
  54762c2 (sokcevic@chromium.org)
      Handle 401 from gsutil
  e4ff80f (lokeric@google.com)
      Update version of reclient
  fd9cea7 (jojwang@google.com)
      Use --upstream when calling bot_update (passed to gclient sync).
  af20d7c (chanli@chromium.org)
      [depot_tools] roll bb
  607284d (jwata@google.com)
      [siso] add autosiso wrappers
  6b62f42 (bentekkie@google.com)
      Fix reclientreport after functions moved to reclient_helper
  2d1c655 (arielzhang@google.com)
      Add CL description getter

recipe_engine:
618bc26448~..5a794c03981b2750ddc6a76c80e303832eae0a93
  618bc26 (yiwzhang@google.com)
      change the package and version for legacy copyright tricium fun...
  f12826f (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 8221a7a30ba2 to 265d6513a697
  1548506 (ddoman@chromium.org)
      [recipes-py] remove api.resultdb.get_test_result_history()
  d3d4e72 (ddoman@chromium.org)
      [recipes-py] roll recipe_proto
  2239570 (iannucci@chromium.org)
      Adjust racy test in run_test.py
  162ea7d (yiwzhang@google.com)
      use simple tricium functions built by builder
  114bdbd (yiwzhang@google.com)
      use the version defined in tricium analyzer instead of live
  6ab407d (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 2293629b4919 to 56489f37e8ef
  5a794c0 (yiwzhang@google.com)
      use tricium spellchecker generated by the builder

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: I8b9626045dc3ba40457106aca84bf34130683dc6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4469107
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2023-04-24 18:49:06 +00:00
recipe-roller
5749ce1dd2 Roll recipe dependencies (nontrivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8783803038271843633

Please review the expectation changes, and LGTM+CQ.

depot_tools:
e718a91487~..97dadd025f541f67af48417cc12ebdc00c1ad29c
  e718a91 (meiring@google.com)
      [ResultDB] Roll RDB CLI.
  3ca8d0d (ukai@google.com)
      add siso wrapper
  0418255 (bpastene@chromium.org)
      Don't put a timeout on 'CreateChange' gerrit rest calls
  4a22431 (jojwang@google.com)
      Use shutil.copytree instead for migration script instead.
  9a285c2 (sokcevic@chromium.org)
      Fix infra_to_superproject for Linux
  97dadd0 (bpastene@chromium.org)
      Apply the gerrit REST timeout to only 'GetChanges' calls

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: I8409f8a06fffb8fc01665069eb86741246ec7d52
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4428224
Auto-Submit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-04-24 18:18:44 +00:00
Keiichi Watanabe
4665feed50 OWNERS: Add takayas@ to OWNERS
BUG=none
TEST=CQ

Change-Id: I3a943a3e1c5f7dddb76a10ce49b83faebacdf566
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4457834
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2023-04-24 11:15:25 +00:00
Gurchetan Singh
3f22365fec rutabaga_gfx: consistent stream_renderer_* API
gfxstream has transitioned to consistent APIs and a simpler
fence API.  Use it.

BUG=b:278138335
TEST=launch_cvd

Change-Id: I91a55021b79c65e057fca5891e64c023ba5cab0b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4428537
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-04-21 22:28:22 +00:00
Noah Gold
31ee64ebee vm_control: refresh Irqchip Event tokens on restore.
When we restore a snapshot, we need to refresh the set of Events that
the IRQ handler thread is listening on, otherwise it won't forward IRQs
from the restored/re-created events.

BUG=b:277651574
TEST=tools/dev-container e2e_tests/run

Change-Id: Icd61112c23f063af0f6f217efe2b3359f884e351
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4416558
Reviewed-by: Steven Moreland <smoreland@google.com>
Reviewed-by: Elie Kheirallah <khei@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Richard Zhang <rizhang@google.com>
2023-04-21 18:18:12 +00:00
Alexandre Courbot
23272fca8e crosvm: cmdline: allow to use the --cfg argument several times
Now that RunCommands can be merged several times without ambiguity,
allow the `--cfg` argument to be used several times, allowing to augment
a base configuration with others. Configurations are merged in their
order or specification, with the other command-line arguments being
merged last.

BUG=b:218223240
TEST=added test passes, booted a VM while specifying `--cfg` several
times.

Change-Id: I94d4f02e403db0203a2757e78a5932805c6d8387
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4414503
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2023-04-21 05:30:22 +00:00
Alexandre Courbot
b5fee4bf60 crosvm: cmdline: convert bools to Option<bool> in RunCommand
We recently enabled configuration files with the limitation that only
one file could be specified, and configuration files cannot include
further files. This limitation was due to the fact that the argh crate
could not handle Option<bool> as switches, which forced us to use bool,
which cannot be merged unambiguously more than once.

argh 0.1.10 now allows to use Option<bool> for switches, which will
allow us to lift these limitations. Start by converting all bools in
RunCommand into Option<bool>, and mandating that all members of
RunCommand are either Option or Vec. Following CLs will implement the
features that doing so enables.

BUG=b:218223240
TEST=presubmit

Change-Id: Ica19c94b9509aec7145a6af954d3ebe04a73bc3d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4414502
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-04-21 05:21:29 +00:00
Alexandre Courbot
17d3a8d0cf Update argh to 0.1.10
We want support for #[switch] on Option<bool> in order to support
specifying several configuration files. This feature has been merged in
0.1.10.

BUG=b:218223240
TEST=cargo build

Change-Id: I4f1a2474f797907fbd180b0ebe67d87ea7920b46
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4414501
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-04-21 05:21:02 +00:00
Elie Kheirallah
ea6eb3adf4 docs: book: docs update and improvement
Add Podman as an option in building crosvm.
Have `Example Usage` point to `Custom Kernel/Rootfs` for preparing a
custom kernel/rootfs, instead of building crosvm.

BUG=N/A
TEST=mdbook build && check the html page

Change-Id: I920526c01140439c416e929d4711ae996bb0831e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4455448
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Elie Kheirallah <khei@google.com>
Commit-Queue: Elie Kheirallah <khei@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-04-20 22:04:37 +00:00
Daniel Verkamp
ab668edb0d devices: virtio-pci: defer ioevent registration until activate
The virtio-pci device uses ioevents to monitor the notification region
of its BAR for guest-initiated kicks. This is not necessary until the
queues are actually started, so we can remove the ioevents() function
and instead use the existing VmMemory requests to add and remove the
ioevents when the device is activated or stopped/reset.

This avoids the need to remove and re-add the ioevents for the queues
during PCI device initialiation, where the guest may repeatedly disable
and re-enable memory decode.

BUG=b:278130202
TEST=Boot Crostini and ARCVM on x86_64 and aarch64
TEST=tools/dev_container tools/presubmit

Change-Id: I22e0b5a84c8cc9c4f60807624610dbbcabf982cc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4425869
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Ningyuan Wang <ningyuan@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-20 20:23:32 +00:00
Pierre Labatut
67b36de49a Also build rutabaga as a ststic library.
This is useful to create monolithic portable binaries.

Change-Id: I7de6b20fbc5ab85f588cd2711d7e99d0183d9f15
Bug: b/276425028
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4450988
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2023-04-20 17:22:38 +00:00
Andrew Walbran
fc8bb6efbf aarch64: Merge adjacent regions in FDT memory node.
BUG=b:244553205
TEST=Patched into AOSP and ran some VMs.

Change-Id: I95710fdb264a3bd1e8e69ed6dfad77bbc05b3043
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4440589
Reviewed-by: Jiyong Park <jiyong@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Pierre-Clément Tosi <ptosi@google.com>
Commit-Queue: Andrew Walbran <qwandor@google.com>
2023-04-20 10:23:20 +00:00
Daniel Verkamp
03c4671233 infra/recipes: clean up leftover crosvm_direct support
Deprecate the crosvm_direct field in build_linux.proto and remove the
code that used it in build_linux.py.

BUG=b:276993009

Change-Id: I1c48064391f3201ad6e27bf9dbfe33e705477672
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4437033
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
2023-04-19 22:57:31 +00:00
Daniel Verkamp
2ed4a856c7 rutabaga_gfx: remove unnecessary casts
Fixes clippy warnings in Rust 1.68.

BUG=b:276487055
TEST=tools/clippy # with rust 1.68

Change-Id: I6f6d0e85bcf6489ca321d0ca47c431ed33aadab5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4391109
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-04-19 20:35:49 +00:00
Frederick Mayle
91d4d643ed cros_async: rename TimerAsync::next_val to TimerAsync::wait
Change-Id: Ibc3c4ee9584062ed77d60c947751d3a83c2fc6ee
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4409941
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Frederick Mayle <fmayle@google.com>
2023-04-19 08:44:15 +00:00