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

39 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
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
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
Frederick Mayle
2de0adb3ab ANDROID: run cargo_embargo + post merge fixes
jail/seccomp/gen_android.sh:

    Path update because the "seccomp" dir was moved to "jail/seccomp".

jail/seccomp/x86_64/gpu_common.policy:

    Modified policy to avoid duplicate syscall error. Upstream isn't
    seeing the same issue because they precompile the policies and
    minijail has a bug where duplicates are allowed for precompiled
    policies but not runtime-compiled policies (http://b/268567700).

Bug: 268120263
Test: TH, etc
Change-Id: If0821bb43c9972da8353d345500b099d45d80fbe
2023-02-14 14:42:54 -08: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
7a84feecfa ANDROID: crosvm: Run cargo2android after merge
Some tests are being removed. Notes on each below.

  * aarch64: has tests, but not mentioned in cargo.out, likely because we aren't cross compiling
  * anti_tamper: no tests
  * bit_field: no tests
  * broker_ipc: no tests
  * common/balloon_control: no tests
  * common/sync:  no tests
  * crosvm_control: no tests
  * gpu_display: tests guarded by unused feature flag
  * kvm_sys: no tests (in src/lib.rs, there are tests in basic.rs, but that has a separate target)
  * libcras_stub: no tests
  * linux_input_sys: no tests
  * metrics: no tests
  * net_sys: no tests
  * power_monitor: no tests
  * protos:  no tests
  * system_api_stub: no tests
  * tracing:  no tests
  * usb_sys: no tests
  * vfio_sys: no tests
  * virtio_sys:  no tests

I spot checked a few to see if there were relevant changes in the merge
(e.g. if the tests got deleted) and didn't find any (e.g. libcras_stub
has never had code, let alone tests).

Test: virtualization tests on CF
Bug: 243039383
Change-Id: I653b4f7669c18560663f3d62dcce64cce8276c94
2022-08-23 01:48:40 +00:00
Steven Moreland
bd20aa69a6 ANDROID: add back test files
Due to a cargo2android bug and various tool
changes, these were not included sometimes.

In two cases (serde_keyvalue_derive and arg_helpers),
we don't have the required dependencies for these
tests setup, b/c the component is a rust_proc_macro.

In the case of rutabaga_gfx, no change is made here
because it does not compile with the in-tree cargo
install.

Bug: 242733327
Test: build only
Change-Id: Ib0a1f80b62286cd5e77f7ff116f839ace34ebc81
2022-08-18 18:24:27 +00:00
Steven Moreland
c3ce8f368b ANDROID: all2android.sh - clean output
Restore to clean output state.

all2android.sh should not change the ToT build files. It's unclear
currently why the tests were generated in some cases. The bug is
filed to make sure we generate all tests and run them, though
for minimal merges, we need to keep this delta at zero.

Bug: 242733327
Test: n/a
Change-Id: Ic9e295f19e7055116c0495361df358ee48520cf2
2022-08-17 00:10:45 +00:00
Elie Kheirallah
abafb2dbb2 Merge remote-tracking branch 'aosp/upstream-main' into aosp/upstream-main
* aosp/upstream-main: (44 commits)
  Reformat imports with tools/fmt --nightly
  main: print parsing errors to stderr
  vm_control: use HotplugCommand for hotplug devices
  devices: pci: impl pci root worker
  config: convert --file-backed-mapping to serde_keyvalue
  Roll recipe dependencies (trivial).
  media: ffmpeg: Free AvPacket through av_free_packet.
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  x86_64: configure MSRs needed by intel_pstate in initramfs
  Roll recipe dependencies (trivial).
  Roll recipe dependencies (trivial).
  x86_64: add new option enable-hwp to expose HWP feature to guests
  media: ffmpeg: add pixel format wrapper and iterator
  virtio: video: decoder: ffmpeg: use zero-copy for input buffers
  Revert "crosvm: Embed seccomp filters into binary"
  devices: vhost: user: snd:: Implement VVU snd
  audio: Support null backend for Vhost User Snd
  ...

Bug: 241784778
Test: m && TH
Test: launch_cvd
Change-Id: I17fbe1468ad4d539fc716e34d4b408431436cb70
2022-08-11 22:07:10 +00: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
e5a3f609b4 Merge remote-tracking branch 'aosp/upstream-main' into master.
Bug: 207770431
Test: m crosvm
Change-Id: I37b38586b77042179d8dba81ca43a369b2fa112d
2021-12-02 17:08:25 +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
Lingfeng Yang
8e416c5780 Enable Android build for latest crosvm
This uses a combination of cargo2android.py and manual changes
to enable the latest crosvm build (parent commit) to build via

Test: m crosvm.experimental (but need to pin external/minijail to aosp
master first)

Bug: b/146066070

Change-Id: I82095f31ddc683c556eb5fb04e6e072f3e648eaf
2020-02-21 07:41:40 -08:00
A. Cody Schuffelen
bc128a9aa4 Manually update Android.bp files for the newer crosvm
Edited Android.bp files and source files until "m crosvm.experimental"
worked.

Test: m crosvm.experimental
Bug: 140069322
Change-Id: Ie86f0c76fc8aea329ff38cb01ce54398f4d31f97
2020-01-25 01:27:55 +00:00