Commit graph

6607 commits

Author SHA1 Message Date
Ryan Neph
99ca07bd39 gpu_display: pass error logging callback and remove syslog()
syslog() is used on the error path for wayland display management. On
32-bit arm, the glibc implementation of syslog() uses send(), which
causes a seccomp violation. This was regressed a long time ago and never
found until now.

Fixing syslog() on 32-bit arm requires changes to gpu_device.policy on
32-bit arm (to add send() and socket()), but we'd prefer to call
crosvm's configured logger and drop syslog() anyways, so let's just do
that.

TEST=Run crosvm + glxgears/vkcube
BUG=b:281165392

Change-Id: I69bcf8cf3617d117360c4a255b1cc1234493eccc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4517955
Commit-Queue: Ryan Neph <ryanneph@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-05-10 19:56:16 +00:00
Frederick Mayle
6cc983d3f5 hypervisor: kvm: verify get_all_msrs gets all the MSRs
`get_msrs` truncates the vector on partial success.

Haven't seen this fail. Adding the check as a precaution.

Change-Id: I7c3a4c2408daa9d7a00257ae758da45011a40311
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4515456
Reviewed-by: Elie Kheirallah <khei@google.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
2023-05-10 18:38:24 +00:00
recipe-roller
2d7bb01a4b Roll recipe dependencies (trivial).
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/8781465762455899537

depot_tools:
967cf672eb
  967cf67 (sokcevic@chromium.org)
      Revert "Reland "Remove Python 2 support for PRESUBMIT.py""

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: If374f26f739639dc6fb34ba97028deb473f84903
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4521598
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>
2023-05-10 17:24:46 +00:00
recipe-roller
4238254035 Roll recipe dependencies (trivial).
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/8781472053530156577

depot_tools:
d37c0b505e
  d37c0b5 (tikuta@chromium.org)
      Revert "presubmit: remove presubmit step running python2"

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: I7838584fe15edaf21f37df8e8e8257f783465728
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4518851
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-05-10 15:45:31 +00:00
yuanyaogoog
30328ec365 docs: Fix gerrit account hook install guide
At present, if we set up gerrit message hook using `./tool/cl`, there
will appear a usage message. Reader may think they did not install the
message hook successfully.

Add explanation to documentation to explain even the usage messages
appear, the message hook is still successfully installed.

BUG=b:281798401
TEST=mdbook build docs/book

Change-Id: I3be36315e20d79aff58d0777d0c454b42c8c688a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4520798
Commit-Queue: Yuan Yao <yuanyaogoog@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
2023-05-10 09:31:38 +00:00
yuanyaogoog
a0c55f16f0 docs: Swap Testing section and Running crosvm section in crosvm book
At present, the Testing section sits before Running crosvm section which
will confuse readers.

Swap the order of Testing section and Running crosvm section in
SUMMARY.md makes documentation clearer to readers.

BUG=b:281780797
TEST=mdbook build docs/book

Change-Id: I33d78b9eb456bd5ef529e1d3de607e7ec519dac2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4520797
Commit-Queue: Yuan Yao <yuanyaogoog@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2023-05-10 09:26:19 +00:00
recipe-roller
ea0b240fb4 Roll recipe dependencies (trivial).
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/8781530565264136801

depot_tools:
f155639336
  f155639 (tikuta@chromium.org)
      presubmit: remove presubmit step running python2

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: I92102ffef1592d40fe0bdcc8512bf62bcb62c998
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4520056
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-05-10 00:19:03 +00:00
Dennis Kempin
2116c21637 Switch to current cargo resolver
We originally held this back when switching to the 2021 edition of rust
as it was causing issues in downstream projects. If this is still an
issue, I would recommend not merging this change downstream.

BUG=b:223855233
TEST=CQ

Change-Id: I4a3eb99ee34f4495dd42cd0dea0f4864002519c3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4517945
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-05-09 21:17:53 +00:00
Dennis Kempin
01da29a398 net_util/win_audio: Do not use cfg conditional compilation in build.rs
The build.rs file will be compiled for the host platform and cfg()
flags will reflect those of the host platform and not of the build
target.
Use CARGO_CFG_ environment variables instead.

BUG=b:240593511
TEST=CQ

Change-Id: Ib8b6c8e8bfb44ad83212bb2aa40a17a4e16a4adf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4518569
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
2023-05-09 20:27:26 +00:00
recipe-roller
a57d2ac499 Roll recipe dependencies (trivial).
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/8781552584895763793

depot_tools:
119cff3d2f
  119cff3 (brucedawson@chromium.org)
      Reland "Remove Python 2 support for PRESUBMIT.py"

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: I36d696bfdea7486604406d81a83f458a5d39c9d8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4518568
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>
2023-05-09 18:33:37 +00:00
Daniel Verkamp
a758a209ba kvm_sys: finish KVM_SYSTEM_EVENT_S2IDLE removal
This was left over from commit a8985f0ba8 ("x86: remove deprecated
KVM based s2idle notification related code"). Additionally, the comment
about the bindgen script was removed even though it is still in the
script, so the generated output did not match what was checked in.

BUG=None
TEST=kvm_sys/bindgen.sh

Change-Id: I241220dd5d0121ce2dca1ce0597ebf1f258f1c20
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4518567
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-05-09 18:17:17 +00:00
recipe-roller
b260b1502b Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

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

recipe_engine:
8eb2bbe93b
  8eb2bbe (meiring@google.com)
      [ResultDB][Analysis] Roll updated 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: Ic96a1bee2f7f6d91d8b73c3f94c822098a6c5a14
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4518566
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>
2023-05-09 18:09:24 +00:00
David Dai
07b5aeeb1c aarch64: fdt: Add kvm-cpufreq device
Add devicetree node for a kvm-cpufreq device for arm64. If the guest
kernel has kvm-cpufreq driver and the host supports required hypercalls,
the kvm-cpufreq driver will start working.

This depends on out-of-tree kernel driver (crrev/c/4037181), so this
will be reverted when that driver is upstreamed correctly.

BUG=b:249685960
TEST=Boot ARCVM and confirm there are policies under
  /sys/devices/system/cpu/cpufreq
UPSTREAM-TASK=b:256983979

Change-Id: I2f86e10a984b0adbbd93f34f39ee7e7b13571a6d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4453483
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Masami Hiramatsu <mhiramat@google.com>
Commit-Queue: Masami Hiramatsu <mhiramat@google.com>
2023-05-09 06:58:28 +00:00
Daniel Verkamp
386a86740b unix: bind-mount Wayland socket dir with MS_REC
On a normal Linux desktop system, the Wayland socket is usually in
/run/user/<id>, which can contain other mount points. The mount syscall
will fail when trying to use MS_BIND alone on this directory. Adding
MS_REC for a recursive mount allows the bind mount to succeed.

BUG=b:281542226
TEST=crosvm run --wayland-sock $XDG_RUNTIME_DIR/wayland-0 ...

Change-Id: I42c2a9492c01f224ef7e1b0fb77729b0aaf6cecc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4514518
Reviewed-by: Shin Kawamura <kawasin@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2023-05-09 05:31:50 +00:00
recipe-roller
9b940c57aa 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/8781613610907426577

depot_tools:
89c463be12
  89c463b (vadimsh@chromium.org)
      [cipd] Update cipd to v2.6.13.

recipe_engine:
4aaa1ced56
  4aaa1ce (meiring@google.com)
      [ResultDB] Add support for -sources(-file) to recipe module.

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: I59179aacf88c62d5745325fe56dae29499dc9445
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4513701
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>
2023-05-09 02:14:47 +00:00
Daniel Verkamp
b654b15dde devices: virtio: create Reader and Writer in DescriptorChain
This is a follow-up to commit 63f50362ec ("devices: virtio:
overhaul DescriptorChain API"). With this change, the normal case of
creating a single Reader and Writer per DescriptorChain, there is no
need to copy the MemRegion lists, which minimizes the extra allocation
and copying overhead.

Additionally, the ExportedRegion list is now stored in an Arc, so no
copying is required; instead, the reference count is incremented.

BUG=None
TEST=tools/dev_container tools/presubmit

Change-Id: Ibd0b2bfc5bfd2d8c84e7ed4d024e314cbdf33a81
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4510437
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
2023-05-08 22:28:54 +00:00
Daniel Verkamp
3b63747469 devices: remove PciDevice::ioevents()
Devices now handle ioevent registration dynamically, which makes
ioevents compatible with BAR reprogramming, so we can remove the
PciDevice trait function and its callers.

Change-Id: Ic178c48e585b24a56f017d824602f6856f6b40a6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500898
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-05-08 20:48:12 +00:00
Gurchetan Singh
83453921d4 rutabaga_gfx: more cross-platform support
For AEMU, we'll want MacOS support for sure.

BUG=b:281527670
TEST=cargo build --target=x86_64-apple-darwin --release

Change-Id: Ia7ce0e33df52b8b94426aafd70a0129670c1539e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4513917
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-05-08 20:35:37 +00:00
Daniel Verkamp
48181d5536 devices: coiommu: register ioevents when activated
This makes sure the BAR location registered for ioevents is correct if
the guest reprograms the BAR registers before activating the device.

It is also the last use of the PciDevice::ioevents() function, which
will be cleaned up in another commit.

Change-Id: I57d0625974e67ce313d44c83b155bf906a686e92
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500897
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-05-08 20:31:12 +00:00
Junichi Uekawa
5e6d272282 crosvm: Remove unneeded cros_asyncv2 directory.
For some reason Cargo.lock remained.

BUG=b:265082456
TEST=build

Change-Id: I06605907ff220b5e4aac3d88151a99a4defb6fe8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4505421
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
2023-05-08 07:22:23 +00:00
recipe-roller
e60a78e0ae Roll recipe dependencies (trivial).
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/8781703579435323361

depot_tools:
4931c18599
  4931c18 (ukai@google.com)
      Roll out goma client VERSION=259

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: Iad20fe736abe7416cb166fff5808ddf37293c768
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4510385
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-05-08 02:24:34 +00:00
Shintaro Kawamura
ca6adae33c crosvm_control: add swap status/trim command support
SwapStatus, SwapState, SwapStateTransition, SwapMetrics are directly
contained into crosvm_control.h

SwapState is translated as C++ enum.

SwapStateTransition::time_ms is now u64 because u128 does not support
repr(C).

Changed usize in the structs to u64 because usize is translated as
uintptr_t.

BUG=b:265386761
TEST=cargo build -p crosvm_control

Change-Id: Ia9df56d40c1884067a712620e0fc797e07af77a2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4486549
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-05-08 01:37:43 +00:00
Lepton Wu
31a4a4c08e devices: Log arcvm cpu share when booting gpu
This add one line log on x86 devices. This will be reverted after we
collect some samples from production.

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

Change-Id: Ib542742726cf4112953b959dfe5a88b71131991e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4510029
Auto-Submit: Lepton Wu <lepton@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Lepton Wu <lepton@chromium.org>
2023-05-06 00:07:30 +00:00
recipe-roller
8398df9441 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

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

recipe_engine:
f31086e3f6
  f31086e (iannucci@chromium.org)
      [doc] Remove py3 notations in doc.

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: Ie49a6103542c5eb3e3378a626d276ef2b1801481
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4510436
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>
2023-05-05 23:16:08 +00:00
Grzegorz Jaszczyk
769c452925 devices: Introduce virt PMC device support allowing to notify about s2idle
Adding Victual PMC device allows to trap on MMIO access caused by its
Linux driver counterpart upon entering s2idle state. Linux Virtual PMC
driver registers notify() hook, which is triggered before system
actually enters s2idle state and triggers _DSM method which in turn
triggers MMIO access causing mentioned trap.

More info can be found in relevant linux kernel mailing list thread which
implements kernel counterpart:
https://patchwork.kernel.org/project/linux-pm/patch/20230213100921.268770-2-jaz@semihalf.com/

Upon Virtual PMC BusDevice write() handling, trigger functionality
responsible for handling s2idle notification, which is: wakeup blocked
thread awaiting guest suspension to finish.

Old functionality for handling s2idle request based on non-accepted by
Linux community, hypercall based solution - is removed as separate patch
CL:4507305

BUG=b:194391015
TEST=Make sure that S2Idle notification from guest are seen by crosvm
when --s2idle parameter is used. In such case the guest suspension is
detected quite fast and 15s timeout is not reached.

Change-Id: I79e1755cd344c46e7fa0dabc211cf7e354583204
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780642
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
2023-05-05 22:26:02 +00:00
Grzegorz Jaszczyk
24bbacfda0 acpi: aml: make the BufferData public
The BufferData can be used for constructing the ACPI tables - make it
public so it can be used by different modules.

BUG=None
TEST=None

Change-Id: Ie35196dbff57845c410d895e73b9aafbac2cf66e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4507051
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-05-05 22:26:02 +00:00
Grzegorz Jaszczyk
a8985f0ba8 x86: remove deprecated KVM based s2idle notification related code
This commit reverts 344e2432d1 "x86:
handle KVM_SYSTEM_EVENT_S2IDLE request" but also some other parts which
grow around this concept. The s2idle notification linux counterpart
based on KVM hypercall was rejected in the linux kernel mailing list and
new approach was suggested which is based on virtual PMC.  Additionally
the privileged guest term was introduced only for ManaTEE, which is not
evaluated anymore.

The new Virtual PMC related approach is used instead for getting guest
s2idle notifications, see CL:3780642.

BUG=None
TEST=Build + tools/presubmit crosvm_tests_x86_64

Change-Id: I3cf4b77ab192198fe9e8b990b994a41105c2e72f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4507305
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-05-05 22:24:58 +00:00
recipe-roller
fed899f79e Roll recipe dependencies (trivial).
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/8781917476390637073

depot_tools:
bcb9577a46
  bcb9577 (mfoltz@chromium.org)
      [depot_tools] Update messages for git cl upload.

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: I36b944725e8c0044cb6b5199938d3898f2c09490
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4506080
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>
2023-05-05 17:50:17 +00:00
recipe-roller
df69dbcffc 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/8781918747211861297

depot_tools:
71ab1b77a7
  71ab1b7 (iannucci@chromium.org)
      [cipd] Simplify .cipd_impl.ps1.

recipe_engine:
a3d5bd82c0
  a3d5bd8 (iannucci@chromium.org)
      [test] Fix missed reference to py3_only.

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: I9b19c0bcfc5797f78862e1e38cdb95402c37f044
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4508665
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>
2023-05-05 17:24:06 +00:00
Sam Wu
d516e8a2c3 Enable dynamic power coefficient for guest OS
To more accurately model the underlying hardware, add dynamic power
coefficient as a parameter to pass from the host OS to the guest OS.
This gives an indication to the guest OS about which CPUs and which
clusters of CPUs are more efficient.

Add a config option "--dynamic-power-coefficient" that allows the power
coefficients of individual CPUs on the guest to be customized at a more
granular level. The new parameter is a scalar coefficient for
calculating power.

See Documentation/devicetree/bindings/arm/cpus.yaml for more info

Bug: b:280358794
Test: ./tools/presubmit passes; Verified new parameters show up when
running crosvm
Change-Id: I0246adcb893546a88a292fcfe9ff40fb08411b10
Signed-off-by: Sam Wu <wusamuel@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4497380
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: David Dai <davidai@google.com>
2023-05-04 23:16:23 +00:00
Daniel Verkamp
7aacb523e4 crosvm: enable gdb feature on all architectures
Remove the architecture-specific requirements from the gdb config
checks. This enables gdb across every supported target_arch without
having to manually add new architectures to each cfg check.

For the specific case of target_arch = "arm", this patch will newly
enable gdb support. The gdbstub protocol will still send aarch64 state,
matching the guest.

This stubs out enough riscv64 gdb functions and types to make
`cargo build --features=gdb` compile, but gdb support will not be
functional on that architecture without additional work.

Change-Id: I63b079b7a3dca4aec2c13c775c0ccb8850625884
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4506285
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dylan Reid <dgreid@rivosinc.com>
2023-05-04 22:59:01 +00:00
recipe-roller
ab156de7d5 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

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

recipe_engine:
69c68cafe7
  69c68ca (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 8e891f86d2a9 to 29cec89d9991

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: Iec91301256e4c331f5b2dacab09567c23781e9f2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4506286
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>
2023-05-04 20:04:11 +00:00
Dennis Kempin
fba40af410 dev_container: Remove argh import
It is no longer needed.

BUG=b:267499599
TEST=CQ

Change-Id: I06b6cee2c09d8c24e424c341ce93ee091d83002c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4506282
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-05-04 19:40:36 +00:00
Dennis Kempin
4ffe779216 rutabaga_gfx: Only use pkg_config provided virglrenderer on ChromeOS
It's a common problem that the system installed version of virglrenderer
is used during the build, which almost always is too old to be used
with crosvm.

BUG=b:220199446
TEST=CQ

Change-Id: Iaf8c8a6ac359eecee4fff4025c04c524ced2e329
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4506283
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-05-04 18:05:38 +00:00
Dennis Kempin
63ae7f76b4 infra: Add riscv64 postsubmit builder
The infrastructure to build, test, clippy is there, we just need to
enable it.
Once it's confirmed to be stable, we can enable it in presubmit as
well.

BUG=b:280448021
TEST=https://ci.chromium.org/swarming/task/620097348c96e910

Change-Id: I40e4b6bb921685ba57886bebafd0ddb14baf5e39
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4506279
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-05-04 18:05:05 +00:00
Dennis Kempin
d385d47365 build_release: Handle riscv64 excludes
This is called during CI builds.

BUG=b:280448021
TEST=https://ci.chromium.org/swarming/task/620097348c96e910

Change-Id: I037124f71343bb646297e20ff8e1082d3556caec
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4505940
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-05-04 18:05:05 +00:00
recipe-roller
397ab45a53 Roll recipe dependencies (trivial).
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/8782007457727511265

depot_tools:
ead9b43bd5
  ead9b43 (alexschulze@chromium.org)
      [cipd] Run cipd_impl.ps1 in constrained language mode

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: Ic05a2fac8815f506f1596f99123b96060ec386bc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4506284
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>
2023-05-04 17:59:34 +00:00
recipe-roller
8526197d36 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

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

recipe_engine:
63e03ca57c
  63e03ca (iannucci@chromium.org)
      [engine] Ignore all python compatibility flags.

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: I7585f68845673b91c7a39ee502dafbbbaccd3214
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4506281
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>
2023-05-04 17:35:08 +00:00
recipe-roller
61616cfc03 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

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

recipe_engine:
443d5bec45
  443d5be (iannucci@chromium.org)
      [url/pycurl] Set default User-Agent header.

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: Ic8b8dffc85e53eb27788be30cd578b22ffeb4185
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4506280
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>
2023-05-04 17:17:54 +00:00
Dylan Reid
69c7b3bf78 tools: skip build-excluded crates for clippy
Filter riscv crates that can't yet build so clippy can run on those that
do.

Change-Id: I43ddd5ab6c12a42812949d552037a35a1e928296
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4505758
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-05-04 15:48:00 +00:00
Dylan Reid
1940445671 riscv64: Fix clippy lint
In preparation for enabling tools/clippy to check riscv, clean up the
warning in the hypervisor crate.

Change-Id: I8b1c6ff54548ee5a3752fb453a4030b7d4582364
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4505757
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-05-04 15:44:54 +00:00
Dylan Reid
3df3d394cd hypervisor: fix riscv clippy lint
In preparation for enabling tools/clippy to check riscv, clean up the
warning in the hypervisor crate.

Change-Id: Iab2d1f703e0ab5e40ed165873376cdfabdc3de60
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4505756
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-05-04 15:43:59 +00:00
Dennis Kempin
1d839d694b dev_container: Remove dependenices on 3p python packages
This reduces the number of dependencies for development using
the container to just python and podman (or docker). All other
tooling can then be run inside the container where it will have
access to 3p packages (i.e. argh and rich).

BUG=b:267499599
TEST=dev_container workflows with --stop, --clean --use-docker etc.

Change-Id: I7f2d51cd6b7126fcde4967da2f9c526f71b93de5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4499659
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
2023-05-04 15:31:47 +00:00
Dennis Kempin
55c171466d Include riscv toolchain in dev container
Updates the riscv install script to use the debian ports repository
to install dependencies.

The container version is upreved to use the newly built image
that includes the changes in this CL.

BUG=b:280448021
TEST=dev_container run_tests -p riscv64
TEST=https://ci.chromium.org/swarming/task/61fca4b26ac4de10

Change-Id: I7dbfac56fd04c8fd9635c981c13dcfcbdad90bcc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500611
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-05-04 15:21:31 +00:00
Shintaro Kawamura
8590cdcc8a swap: expose Status interface to all variants
Status does not depend on any swap related feature. Exposing Status to
all variants is easy to implement swap status FFI at crosvm_control.

The new "swap/enable" feature switches the actual vmm-swap functionality
to be compiled. The feature is enabled by default on "swap" crate but
disabled on the root package for test dependency.

Vmm-swap feature is enabled by `--features=swap` flag on cargo build as
before.

swap/src/controller.rs is copied from swap/src/lib.rs.

BUG=b:265386761
TEST=tools/dev_container tools/run_tests2

Change-Id: Ifc2539a62d0f594fd5bbb41623c735ea2621f7b6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4486546
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
2023-05-04 12:30:09 +00:00
Shintaro Kawamura
17cbb09b7a tools: refine optional crate check on custom_checks
The name "swap" is used for both crate name and feature name. By
https://crrev.com/c/4486546 the swap crate is no longer optional crate
and "swap/enable" feature dependency in "swap" feature cause infinite
recursion on tools/custom_checks.

The optional crate consideration was introduced by
https://crrev.com/c/3943594.

The optional crate should be validated more accurately.

BUG=b:265386761
TEST=tools/presubmit

Change-Id: Icb787b37392576519dbaeb3f0d78a0a5d8775098
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4495925
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Shin Kawamura <kawasin@google.com>
2023-05-04 12:30:09 +00:00
Daniel Verkamp
ea7fb124d6 devices: virtio: remove Queue::iter() and AvailIter
This functionality is not used anywhere.

BUG=None
TEST=cargo test -p devices
TEST=tools/dev_container tools/presubmit

Change-Id: I8664c0a4f7c7b9ea8b074982a9eb9733e3e52f05
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4496847
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Zihan Chen <zihanchen@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
2023-05-04 10:09:34 +00:00
Gurchetan Singh
f90779dae8 rutabaga_gfx: finish removing set_use_guest_angle
Missed a spot last time.

BUG=278138335
TEST=compile

Change-Id: I74edbdded7614250ef55a51370a5faa6a2ee0cbf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4505110
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2023-05-04 00:19:00 +00:00
Frederick Mayle
5441c064e5 hypervisor: kvm: check for KVM_SET_MSRS failures
The KVM docs say

  If setting an MSR fails, ..., it stops processing the MSR list and
  returns the number of MSRs that have been set successfully.

So, a return value of zero really means the operation completely failed.

Change-Id: Ic98cdb02513ff86e22fb6b048e7ceb2d6b7e554a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500732
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
2023-05-03 20:52:05 +00:00
recipe-roller
2fb38f73d5 Roll recipe dependencies (trivial).
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/8782094908571728337

depot_tools:
dbcecc9017
  dbcecc9 (linxinan@chromium.org)
      Allow 409 error from Gerrit when creating the branch

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: Ie96f469fe9b6f3ebfcb63c5acdd3ee61239b0fac
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4500971
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>
2023-05-03 18:44:52 +00:00