0
Fork 0
mirror of https://github.com/Droid-VM/crosvm.git synced 2026-11-17 06:58:03 +00:00
Commit graph

38 commits

Author SHA1 Message Date
Elie Kheirallah
17f268191a Merge remote-tracking branch 'aosp/upstream-main' into merge
* aosp/upstream-main: (38 commits)
  aarch64: fix potential initrd size subtraction underflow
  Uprev pkg-config to 0.3.31
  crosvm: upgrade zerocopy to 0.8
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  devices: virtio-snd: simplify zerocopy usage in vios backend
  x86_64: fix potential setup_data overlap of mptable
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  hypervisor: aarch64: Add context to errors in snapshot
  Roll recipe dependencies (trivial).
  devices: virtio-wl: add missing padding in CtrlVfdNewCtxNamed
  devices: virtio-wl: add size check for CtrlVfdNewCtxNamed
  devices: vfio: avoid extra copy in read_config()
  devices: virtio-scsi: simplify write_config()
  Revert "rutabaga_gfx: Add rutabaga_resource_wait_sync interface"
  Roll recipe dependencies (trivial).
  Rename gfxabort to be agnostic of graphics stack
  devices: virtio-scsi: use read_from_prefix() in parse_command()
  ...

Bug: 398839628
Test: atest --test-mapping external/crosvm
Change-Id: I1214e25a5c34a735925c605b8440c870abb0d31b
2025-02-25 18:10:03 +00:00
Frederick Mayle
7ac4c9ad6b ANDROID: simplify crosvm_defaults
* All non-crosvm users of crosvm_defaults are gone, so we don't need a
  separate internal defaults module.
* Edition is set automatically by cargo_embargo.
* authfs only needs visibility on libfuse_rust, which is done via
  cargo_embargo.

Bug: 269356487
Test: m
Change-Id: I3091e76e86435021bc3b1c5deb77a5b5d514ca32
2025-02-10 18:41:03 -08:00
Frederick Mayle
f51ffa9d45 ANDROID: fix cargo_embargo diffs + new apex_avail setup
https://r.android.com/3484205 changed the Android.bp files directly to
fix an issue with setting apex_available on test modules. This commit
refixes the issue in a different way that works better with
cargo_embargo.

Instead of setting apex_available via the rust_defaults, which is used
for every module type, we use cargo_embargo's apex_available config
option, which only applies to non-test modules.

Bug: 269356487
Test: m
Change-Id: Ib7a10e23342ead86553232a7014747b46ffefaf2
2025-02-10 17:56:28 -08:00
Colin Cross
f41e8eaddd Make crosvm tests available to the platform
Soong was accidentally allowing a corner case where modules that
were not supposed to be available to the platform (due to
apex_available being set to an apex and not including
"//apex_available:platform") were being made available to the
platform as long as no apex modules depended on them.  Split
crosvm_defaults into crosvm_defaults and crosvm_test_defaults,
where only crosvm_defaults gets apex_available: ["com.android.virt"],
and switch all the rust_test modules to use crosvm_test_defaults.

Bug: 394664568
Test: compare out/soong/installs-${TARGET_PRODUCT}.mk
Change-Id: I7ce4dabbcf1600cf44833b7883977e27a4ad7561
2025-02-07 20:36:04 +00:00
Andrew Walbran
85f25f9403 Keep using old version of zerocopy.
Bug: 372549215
Test: m crosvm
Change-Id: I1cb74195c62fc9e05d0772a9a13dc90476324977
Merged-In: I1cb74195c62fc9e05d0772a9a13dc90476324977
2024-12-11 08:04:00 +00:00
Devin Moore
64d5dea560 Running cargo_embargo after the merge
Create a new patch file for power_monitor
Fix rutabaga_gfx and disk Android.bp.patch files.

Test: m
Bug: 335312770
Change-Id: Ie08db8cabf55b38976be0343a8a41b7111a8d0f1
2024-06-25 22:54:34 +00:00
Frederick Mayle
c223989d84 Merge remote-tracking branch 'aosp/upstream-main'
Had to update the rust version to compile the new nix version.

The metrics protos have been deleted upstream, so those `out` files are
deleted (and we don't need to `sed` them in the script).

Added default_team for `hypervisor` to satisify a lint error, will add
it everywhere else later.

* aosp/upstream-main: (86 commits)
  Roll recipe dependencies (trivial).
  devices: vhost-user: fix test flake
  Roll recipe dependencies (trivial).
  Cargo.lock: switch to tokio 1.29.1
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  cros_async: Tokio IoSource for windows
  cros_async: Add AsyncFd to Tokio linux implementation
  cros_async: Blocking tokio executor for linux
  devices: Fix nested executor invocation in async virtio-console
  cros_async: Move `concurrency` to Overlapped enum
  Roll recipe dependencies (trivial).
  Create a minimal virtualization and hypervisor integration test.
  gpu_display: add max_num_displays to GpuParameters.
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  Refactor android display backend
  e2e_tests: wait for restore to complete before sending commands
  ...

Bug: 332584046
Test: TH
Change-Id: I25dd0124d719a59c312ba31f060c1b37f1d2a1b6
2024-04-15 13:00:06 -07:00
Jiyong Park
5f7ae3703d Rerun android-merge-2-cargo-embargo.sh
Rerun the tool to update the comments in the bp file. Also re-generate
the patch file for rutabaga_gfx. Below were what I did.

0. sync to ToT
1. delete rutabaga_gfx/patches/Android.bp.patch
2. stash rutabaga_gfx/Android.bp to somewhere else
3. run ./android-merge-2-cargo-embargo.sh (without the step 1)
4. create a temp commit
5. re-apply #2 and manually update the comment
6. git diff > rutabaga_gfx_patches/Android.bp.patch
7. amend the commit #4 with the changes in #5 and #6.

Bug: N/A
Test: N/A

Change-Id: Ieb9c8c6a811e9fd09b52910f504c454eaec9b80f
2024-03-12 16:40:32 +09:00
Frederick Mayle
565d643567 Merge remote-tracking branch 'aosp/upstream-main'
* aosp/upstream-main: (45 commits)
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  [rutabaga_gfx:ffi] Locate target build directory.
  devices: virtcpufreq: stub out virtcpufreq
  rutabaga_gfx: add FFI API for snapshot-restore
  rutabaga_gfx: use thread_local for debug handler callback
  crosvm: add "writable" option for create_composite
  Cargo.lock: update to shlex 1.3
  kernel_loader: Add support for LZ4-compressed kernels
  Roll recipe dependencies (trivial).
  dev_container: Pass proxy setting
  Roll recipe dependencies (trivial).
  hypervisor: haxm: Update bindings
  Roll recipe dependencies (trivial).
  hypervisor: haxm: Disable read-only memslots
  docs: Fix link to the internal uprev playbook
  e2e_tests: Revert unnecessary version bump of anyhow/libc crates
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  ...

Bug: 320546603
Test: boot CF
Change-Id: I3e95152dc161e792dff2cb1012d71d489527632b
2024-01-26 14:19:05 -08:00
Frederick Mayle
cb2b2c9b9e ANDROID: add layer of indirection to crosvm_defaults module
Bug: 269356487
Test: m
Change-Id: I1079c5602219eb647875c23d383f26695142ab84
2023-02-15 15:57:00 -08:00
Steven Moreland
b68a6374ce Merge remote-tracking branch 'aosp/upstream-main' into merge
Bug: 268061413
Test: TEST_MAPPING

* aosp/upstream-main:
  Roll recipe dependencies (trivial).
  swap: refine swap status response
  base: fix mmap doc test on Windows.
  Roll recipe dependencies (trivial).
  tools: make scripts windows/downstream friendly
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  crosvm: unix: add bind_mounts to SandboxConfig
  crosvm: unix: refactor the interface of jail_helpers
  Roll recipe dependencies (trivial).
  New nextest based test runner
  Roll recipe dependencies (trivial).
  base: Add custom_serde lib for custom serializers
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  devices: use base::error instead of eprintln
  e2e_tests: suspend_resume: consume exec_command_async response
  crosvm: Partially convert DataInit to zerocopy (1/n)
  Roll recipe dependencies (trivial).

Change-Id: I6339fed9f53069fba52015987657c6c5167386a1
2023-02-06 22:40:00 +00:00
Frederick Mayle
9a7b1b87f3 ANDROID: switch to cargo_embargo generated Android.bp files
The scripts need to be updated to use the new tool. That will come in a
later CL.

Summary of Android.bp changes:

* Deleted apex_available fields.
    - The default is "//apex_available:platform", so no change in
      behavior.
* Deleted "// has rustc warnings" comments.
    - Will re-add support for reporting warnings later, in a different
      form.
* Added cargo_pkg_version always.
    - New tool is better at detecting the pkg version. No behavior
      change expected.
* Removed "libprebuilts" deps.
    - This lib is used to download prebuilt binaries. Including it
      before was a mistake.
* Deleted auto-generated "rust_defaults".
    - They made the Android.bp files shorter, but more difficult to read
      and added complexity to the tool.
* More accurate "crate_name" in "rust_test" modules.
* disk/patches/Android.bp.patch is a bit smaller.
    - "qcow" and "android-sparse" features flags are enabled via the
      root package, so the tool infers more of this correctly, including
      enabling the features in the unit tests (!!).
* third_party/vmm_vhost/Android.bp sets the "default" feature flag.
    - "default" just implies the existing flags. No behavior change.

Bug: 261486161
Test: TH
Change-Id: Ie2d211046ff228b44abf362afed008b4a64d6245
2022-12-05 17:51:47 -08:00
Frederick Mayle
2188ee8e42 crosvm: Limit apex visibility of crosvm modules
This undoes some of the changes made in https://r.android.com/2138858.
Rust modules now are apex_available by default, but we don't want that
for crosvm's crates.

Test: ./all2android.sh
Bug: 238440998
Change-Id: I7226d929a10ffd6a48fa5413c7710ef0eaf2185c
2022-07-14 17:23:32 +00:00
Frederick Mayle
f7b8566e2d Merge remote-tracking branch 'aosp/upstream-main' into AOSP
The "virtio-iommu" flag was dropped because of a cmdline arg
refactoring. I'm reintroducing it in a separate commit.

The many "apex_available" changes are a result of cargo2android's
defaults changing in https://r.android.com/2128853.

Had to enable a feature flag for serde_keyvalue now that more of the
library is used in android-enabled code paths.

Added the "no_presubmit" flag to the root crate, which controls whether
the tests are considered unit tests. Necessary because some of the tests
now check if "/dev/kvm" exists (and it doesn't in TH host tests).

* aosp/upstream-main: (125 commits)
  crosvm: implement lock-guest-memory feature.
  hypervisor: enable TSC cpuid leaf synthesis for haxm.
  x86_64: add TSC leaf synthesis.
  virtio: Enable build and tests for some virtio mods
  ffmpeg: specify supported resolution range for input formats
  vcpu: refactor scheduler config into a new function
  tools: Set host as default target
  seccomp: add arm policy for Goldfish battery
  hypervisor: update CpuIdEntry uses for haxm and whpx
  crosvm: rename DevicesCommand to DeviceCommand
  vm_control: use Protection in mapping requests
  tools: Make run_tests python3.8 compatible
  base: Upstream stream_channel
  base: add nanoseconds to log timestamps.
  devices: virtio: snd: Support num_{output,input}_devices
  crosvm: Add documentation for crosvm_control
  devices: virtio: console: use ReadNotifier trait for polling
  devices: virtio: console: add async console device shared with vhost-user
  base: Add safety comments in net.rs
  examples/baremetal: exit instead of hanging
  ...

Test: TODO
Bug: 236873276
Change-Id: I2bd8fe8580cf2bdee1dbe0d20594e4090afc4125
2022-06-29 21:43:06 +00:00
Steven Moreland
bc538b3b98 Merge remote-tracking branch 'aosp/upstream-main' into master
Bug: 226645768
Test: boot cuttlefish

Change-Id: I04d4e1afbc61a94f9a1cda2bdb045066eb803cfa
2022-04-04 16:05:48 +00:00
Andrew Walbran
4cc712a41d Re-run all2android.sh.
There have been some changes to cargo2android.py which affect the
output. This will make the following merge from upstream cleaner.

Some host tests were failing which for reasons unclear apparently
weren't being run previously, so I had to disable them from presubmit.

Test: atest VirtualizationTestCases
Change-Id: Iec700d1c7c7746bd5ac9beca329eb493c605e2ae
2022-01-10 17:17:13 +00:00
Andrew Walbran
c0875bfef0 Merge remote-tracking branch 'aosp/upstream-main' into master
Change-Id: I7b9003e0d43f1dc56458bc73272138671de9f4e6
2021-11-01 10:59:26 +00:00
Andrew Walbran
6c29b1ead8 Changes from latest cargo2android.py.
Bug: 204072128
Test: m crosvm
Change-Id: I00a30f787462176541e1fcbd1dc3e292c1523c4b
2021-10-28 17:55:53 +00:00
Andrew Walbran
b1fcab2fda Don't include comments with version numbers in Android.bp files.
They just make it harder to review actual changes.

Bug: 161898213
Test: mm
Change-Id: I48e0fe920f26b55650233cb8789419b51796d409
2021-07-30 14:41:46 +00:00
Andrew Walbran
f9d2d64e56 Merge remote-tracking branch 'aosp/upstream-main' into master.
Updated Android.bp files after merge.

Bug: 193402941
Bug: 192256642
Test: atest VirtualizationTestCases
Change-Id: I397b6e75a01677913331548ffef3cd24f4dc6dea
2021-07-16 12:56:15 +00:00
Jason Macnak
b5d1bc4e9f Merge remote-tracking branch 'aosp/upstream-main' into 'aosp/master'
... and update Android.bp to update Crosvm for Cuttlefish to pull
in multi-display virtio gpu support.

Bug: b/189933900
Test: launch_cvd
Test: launch_cvd --gpu_mode=gfxstream
Change-Id: I8af7120a22ebd35739805333536f95b94c4795f7
2021-07-07 12:18:01 -07:00
Jason Macnak
f510eeedd0 Update Android.bp after latest Crosvm merge
Bug: b/189933900
Test: m crosvm
Test: launch_cvd
Test: launch_cvd --gpu_mode=gfxstream
Change-Id: I3fdd59ca616c2f5671508af87fdea1299d2db54f
2021-06-02 19:01:05 -07:00
Jorge E. Moreira
b36408f79c Fix build files
Bug: 185155959
Test: locally
Change-Id: I53ce0b62c3e18e2edfe43aa36d13bc29e039f5ac
2021-04-23 11:04:56 -07:00
Alistair Delva
8863c0f061 Merge remote-tracking branch 'aosp/upstream-main' into master
Another crosvm update to bring in a fuse fix, and to enable
virgl_renderer_next.

Change-Id: I7d447b6293397494148ee3aa01b5fb94d7e3b3b0
2021-03-05 10:44:18 -08:00
Jorge Moreira Broche
a98536ac04 Revert^2 "Update Android.bp files"
a4b0e0a9bf

Change-Id: Ic3383ee55d4a9c75d4f01ea324aaa66639476443
2021-03-03 00:32:22 +00:00
Florian Mayer
a4b0e0a9bf Revert "Update Android.bp files"
Revert "Merge branch 'upstream-master'"

Revert submission 1579283-jemoreira-crosvm-update

Reason for revert: Broke build.
Reverted Changes:
I7cf3fe07f:Merge remote-tracking branch 'aosp/upstream-main'
Icb5f26241:Update Android.bp files
I25af576b6:Merge branch 'upstream-master'

Change-Id: I0de5edb44928aaf487bc475dab0060e821ff3372
2021-02-22 10:36:02 +00:00
Jorge E. Moreira
af377bff4d Update Android.bp files
Change-Id: Icb5f26241067b989cfda6af9470cc1266b162023
2021-02-19 00:56:50 -08:00
Bob Badour
a028314501 [LSC] Add LOCAL_LICENSE_KINDS to external/crosvm
Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  seccomp/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  Android.bp

Added SPDX-license-identifier-BSD
to:
  aarch64/Android.bp
  acpi_tables/Android.bp
  arch/Android.bp
  assertions/Android.bp
  base/Android.bp
  bit_field/Android.bp
  bit_field/bit_field_derive/Android.bp
  cros_async/Android.bp
  crosvm_plugin/Android.bp
  cuttlefish/Android.bp
  data_model/Android.bp
  devices/Android.bp
  disk/Android.bp
  enumn/Android.bp
  fuse/Android.bp
  gpu_buffer/Android.bp
  gpu_renderer/Android.bp
  hypervisor/Android.bp
  io_uring/Android.bp
  kernel_cmdline/Android.bp
  kernel_loader/Android.bp
  kvm/Android.bp
  kvm_sys/Android.bp
  linux_input_sys/Android.bp
  msg_socket/Android.bp
  msg_socket/msg_on_socket_derive/Android.bp
  net_sys/Android.bp
  net_util/Android.bp
  protos/Android.bp
  qcow_utils/Android.bp
  rand_ish/Android.bp
  resources/Android.bp
  sync/Android.bp
  sys_util/Android.bp
  sys_util/poll_token_derive/Android.bp
  syscall_defines/Android.bp
  tempfile/Android.bp
  tpm2-sys/Android.bp
  tpm2/Android.bp
  usb_sys/Android.bp
  usb_util/Android.bp
  vfio_sys/Android.bp
  vhost/Android.bp
  virtio_sys/Android.bp
  vm_control/Android.bp
  vm_memory/Android.bp
  x86_64/Android.bp

Added SPDX-license-identifier-BSD SPDX-license-identifier-MIT
to:
  gpu_display/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Iba8885dd405a152edec01f7c4655a70b214d4449
2021-02-12 21:32:01 -08:00
Victor Hsieh
7085735299 Merge commit '4799680841' into HEAD
Notable changes:
 - fuse crate was introduced.
   * Path of depended crates (base and data_model) are edited to refer
     to local directories.

Bug: 174797066
Test: lunch aosp_cf_x86_phone-eng; m
Test: lunch aosp_cf_x86_64_phone-eng; m

Change-Id: I9b6c6f8ab47507f0c0555af9c4ef905fcbb30c18
2020-12-07 12:19:30 -08:00
Alistair Delva
5e9995b0a4 Merge commit 'a5262a177f' into HEAD
This merges up to the point the fuse crate is added, which is not in
AOSP yet.

Change-Id: I0e399b5740c974dd3fe6ff0cefc43a6d366434a8
2020-11-23 14:47:00 -08:00
Alistair Delva
57d4f3a2ac Merge commit 'ab04758814' into HEAD
Merge the version of upstream-master just before the dependency on
downcast_rs, which hasn't been imported into AOSP yet. This merges
to ~Oct 1.

Change-Id: If89c81d17acb255556852d390fa2bf1dd10ba77d
2020-10-21 08:42:59 -07:00
Andrew Scull
c956513c95 Allow building for device as well as host.
Exclude graphics and audio features for device builds.
Don't try to build libx86_64_rust for Arm targets.

Bug: 158290206
Test: atest -c -m --include-subdirs .
Change-Id: I2a71245466eee54f25b8c4dc27693f0b4ad6c0bf
2020-08-27 16:07:03 +01:00
Andrew Walbran
5d1e8e6f23 Merge remote-tracking branch 'aosp/upstream-master' into master.
Re-ran cargo2android.py after merge and fixed up results.

Bug: 158290206
Bug: 161898160
Test: atest -c -m --include-subdirs .
Change-Id: I132f6355bd88139f432bea95fba781c4feec0f00
2020-08-12 17:48:23 +01:00
Chih-Hung Hsieh
8071fd3740 Update .bp files and add rust test modules
* Problems to solve:
  * Running cargo2android.py under crosvm does not
    generate .bp files in some subdirectories because
    the workspace does not include them.
  * Even when .bp files are generated, rust test modules
    are not generated because cargo test does not run
    tests in subdirectories.
* Solution: run cargo2android.py in subdirectories:
    cargo2android.py --run --tests --dependencies
    --global_defaults=crosvm_defaults --add_workspace
  * If a directory contains subdirectory, run cargo2android.py
    with additional flag --no-subdir to avoid wrong changes to
    the subdirectory .bp files.
  * When cargo2android.py is running with --add_workspace in a directory,
    the Cargo.toml file is changed temporarily and cargo or
    cargo2android.py should not be run at the same time in any parent
    directory.
* Upgrade cros_async/Cargo.toml to use paste-1.0.0.
* Result: In 40 subdirectories, 14 need manual changes in Android.bp
  and/or have commented out tests in TEST_MAPPING.
  The commented out tests passed locally but failed in TH sandbox.

Bug: 161716839
Test: atest -c --include-subdirs external/crosvm
Change-Id: Ic14d461cd1b47e5cb38511cb6204a5e655092d2c
2020-07-27 18:00:07 -07:00
Andrew Walbran
faacadde3d Re-run cargo2android.py and fix up results.
Test: atest -c -m --include-subdirs .
Change-Id: Iffcae6f52bb6efb86f4b9dd3cd3f826698b46e66
2020-07-22 18:30:30 -07:00
Ivan Lozano
324ed13034 Add crosvm_defaults with only supported platforms.
Adds a rust_defaults module that ensures that our crosvm modules are
only built on supported platforms.

Bug: 144553403
Bug: 140938178
Test: m -j crosvm.experimental
Test: modules disabled for unsupported platforms.
Change-Id: I0baec2b4f8c6839c858678270c1c6d527ba4716d
2019-11-15 08:16:19 -08:00
Chih-Hung Hsieh
0074e65988 Use default module name 'liblibc'
Test: mm all rust projects
Change-Id: I09d488eaf93e4a1023292d0feed3bfc57ab52535
2019-10-31 12:00:31 -07:00
Chih-Hung Hsieh
497df9d05d Generate Android.bp into subdirectories.
* Use a script cargo2android.py to generate Android.bp files
  from cargo build -v output. Cargo.toml and some build.rs
  files were temporarily changed to pass cargo build.
* Missing output are copied from old Android.bp file:
  * Rerun cargo2android.py in:
    ./tempfile ./gpu_display ./gpu_buffer ./gpu_renderer
  * Native code modules are not handled by cargo2android.py:
    * Copy modules from old Android.bp to ./gpu_display
    * Copy attributes of crosvm from old Android.bp to ./Android.bp
    * Copy libhost_cpuid to x86_64/Android.bp

Test: mm in crosvm and other rust directories.
Change-Id: I987dd881d088d950e073dc127d19240b6abc57f2
2019-10-14 22:41:39 -07:00