Age | Commit message (Collapse) | Author |
|
Only currently works for the sdcard device in crosvm
Heavily based on the crosvm vhost-user gpu code in crosvm_manager.cpp by
natsu@.
On fully enabling it with crosvm, u-boot no longer seems able to inspect
the partition table and the partition entries are gone.
```
Driver uid uclass Devices
----------------------------------------------------------
blk_partition 083 partition <none>
```
versus a successful run:
```
Driver uid uclass Devices
----------------------------------------------------------
blk_partition 083 partition virtio-blk#22:1
virtio-blk#22:2
...
```
On fully enabling with QEMU there's some conflict with using it on any
devices.
```
2024-06-12T22:35:11.479077Z qemu-system-x86_64: Failed to read msg header. Read -1 instead of 12. Original request 1.
2024-06-12T22:35:11.479123Z qemu-system-x86_64: Failed to write msg. Wrote -1 instead of 20.
2024-06-12T22:35:11.479136Z qemu-system-x86_64: vhost VQ 0 ring restore failed: -22: Invalid argument (22)
2024-06-12T22:35:11.479151Z qemu-system-x86_64: Failed to set msg fds.
2024-06-12T22:35:11.479162Z qemu-system-x86_64: vhost_set_vring_call failed 22
2024-06-12T22:35:11.479195Z qemu-system-x86_64: Failed to set msg fds.
2024-06-12T22:35:11.479208Z qemu-system-x86_64: vhost_set_vring_call failed 22
2024-06-12T22:35:11.479305Z qemu-system-x86_64: vhost-user-blk: vhost start failed: Error starting vhost: Protocol error
[2024-06-12T22:35:11.479867813+00:00 ERROR crosvm::crosvm::sys::linux] error while running device block-0: invalid message
[2024-06-12T22:35:11.482253282+00:00 INFO crosvm::crosvm::sys::linux] process for device block-0 (PID 42777) exited with code 1
[2024-06-12T22:35:11.482381564+00:00 INFO crosvm::crosvm::sys::linux] all device processes have exited
[2024-06-12T22:35:11.482432972+00:00 INFO crosvm] exiting with success
```
The only working mode I see now is enabling it for the sdcard disk,
which has minimal interaction with the bootloader.
```
$ cvd start --resume=false --vhost_user_block --daemon
$ adb shell
$ su
$ mkdir /data/local/mnt
$ mount /dev/vdc1 /data/local/mnt
$ echo "b" > /data/local/mnt/b
$ cat /data/local/mnt/b
```
Bug: b/346855591
Change-Id: I2d4b83d515d091bae5e8bae1bf50976de8798778
Test: cvd start --resume=false --vhost_user_block
|
|
* changes:
Move graphics property_contexts into shared/graphics
Add new sysprop for display framebuffer format
Add property to cuttlefish config about BGRA framebuffers
|
|
... as we will want a way to save and communicate this information
to the webrtc server from the launcher.
Bug: b/341647448
Test: cvd start --gpu_mode=guest_swiftshader
Change-Id: Ifda07c1097f7003d818ba28d60df27feda4463ad
|
|
606a9272d07d1e6dc52a2b9e03b905a010e74b32
Test: Local run
Bug: 328316981
Change-Id: Ic79873754673235f8a30da7e409c4e71787b2e10
|
|
* changes:
Revert "Add a VHAL host-side proxy server."
Revert "Create new CF VHAL binary."
Revert "Add vhal_proxy_server component."
|
|
Revert submission 3095794
Reason for revert: b/344460489
Reverted changes: /q/submissionid:3095794
Change-Id: I22e7c4aa073cc87b35e22935367d3b8f59b18c57
|
|
crosvm places this in memory right under the bios / bootloader:
https://cs.android.com/android/platform/superproject/main/+/main:external/crosvm/x86_64/src/lib.rs;l=1577;drc=309accd0ef59358ac8a417d519bf34e29fb3566a
At the moment, crosvm only supports pflash on x86_64.
The QEMU configuration of two pflash devices matches one of the standard
patterns of running OVMF, a "split image" configuration:
https://wiki.archlinux.org/title/QEMU#Booting_in_UEFI_mode
https://lists.nongnu.org/archive/html/qemu-discuss/2018-04/msg00045.html
Bug: 344691679
Test: cvd start --resume=false
Change-Id: I7344341663f09ab4f1f8f67542848a88f4ff746c
|
|
Add a component to run vhal_proxy_server binary in cvd. The component
starts a host side GRPC server listening on vsock port. The guest
side VHAL connects to this server through GRPC.
The vsock port information is passed through bootconfig and read during
VHAL init time.
Test: Local run cf_auto. Verify setting HVAC.
Flag: EXEMPT for dev not for prod
Bug: 328316981
Change-Id: I5124f8fce635977e6f923ccee8614d29f5a49c0c
|
|
This commit sets OpenThread simulation node id according to
Cuttlefish's instance number, so that the guest can simulate
different nodes on different cuttlefish, which allows Thread
traffice across Cuttlefish instances.
Test: presubmit
Bug: 329188649
Change-Id: I32a6955beff065ef739cb09f50729307d659d8bf
|
|
... to strongly type, avoid lots of string comparisons, and centralize
the location of the string constants.
Note: there is still a little weirdness with CuttlefishConfig's
`ap_vm_manager` which seems to be more of a name than a vmm type
given the kApName constant.
Bug: b/285953644
Test: cd device/google/cuttlefish && mma
Test: cvd start
Test: cvd start --vm_manager=crosvm
Test: cvd start --vm_manager=qemu_cli
Change-Id: Id780bb8cb1533fb1261e37638cef4903c9cc167d
|
|
Bug: b/261231681
Test: build
Change-Id: Icab278e490f40d5225c6167b8135e69fd5d9628c
|
|
Instead of waiting for logcat output, run the `crosvm resume` command to
block until the vCPUs have begun.
CvdBootStateMachine starts a thread to run that command. When the
command completes, it notifies the other CvdBootStateMachine thread via
a pipe, which then sends a value to the `--daemon` parent indicating
that the restore is complete (using the same mechanism as for a normal
boot complete).
Bug: 333111958
Test: m && (stop_cvd; launch_cvd --noresume --enable-sandbox=false --daemon) && snapshot_util_cvd --subcmd=snapshot_take --auto_suspend --force --snapshot_path=$HOME/cf-snapshot && stop_cvd && launch_cvd --snapshot_path=$HOME/cf-snapshot
Change-Id: Ia515c0485a7d6ec5cda611a7423674422b9f28d5
|
|
Should enable improved testing of display integration, since
most embedded integrations will use a real and not fake Wayland
server for performance.
BUG=336291294
TEST=compile
Change-Id: I5765e672a0e395e61b73be9ce7c87503034c1d50
|
|
To enable cross-domain on CF, we must first allow it to passed
to crosvm. Only works with crosvm.
launch_cvd --gpu_mode=custom
--gpu_context_types=gfxstream-vulkan:gfxstream-composer
--guest_vulkan_driver=ranchu
Assumes ANGLE as the GLES driver. Immediate goal is to enable
cross domain.
launch_cvd --gpu_mode=custom
--gpu_context_types=gfxstream-vulkan:cross-domain:gfxstream-composer
--guest_vulkan_driver=ranchu
"gpu_context_types" and "guest_vulkan_driver" are ignored without
--gpu_mode=custom.
Long-term, since Android requires the VK driver to be specified
at boot-time, it should be possible to test real VK drivers
(for example, "--vulkan-driver=amdvlk"). One should know the
system image contains the desired driver. For example, it
makes sense for Trout to build vendor specific drivers, but not
more generic images which just neeed gfxstream.
BUG=336291294
TEST=Launch CF with cross domain, crashes tho
Change-Id: Ia31913a8e2fb98f52cef7d2d76913c24d1988dd9
|
|
|
|
add enable_usb_passthrough with default value FALSE.
Bug: 335492801
Test: cvd start --enable_usb=true
Test: cvd start --enable_usb
Test: cvd start --enable_usb=true --enable_virtiofs=false && try to snapshot the VM.
Change-Id: I50c716c37bc21f661640fcde2ac92c8c87e4abe1
|
|
* changes:
Expand the list of vendor images
Add a new_vbmeta_image path for regeneration
Add `make_vbmeta_image` to `Avb`
|
|
This new path will be used when the `vbmeta` image for the
os_composite_disk is regenerated during mixed builds.
Added a prefix to the generated `vbmeta.img` for the
persistent_composite_disk to make it clearer what it is used for.
Bug: 322887496
Test: launch --resume=false --daemon
Test: # verify in cuttlefish_runtime.1 there is a persistent_vbmeta.img
Change-Id: Ifc2883fe6c9af5bec09355bdb98fa24ce14206cb
|
|
|
|
`IsRestoring` was recently introduced to detect if the new device is for
a restore. If the device is reboot'd or powerwash'd, it correctly
returns `false`. However, the adb vsock proxy was still using its own
config option, `sock_vsock_proxy_wait_adbd_start`, that continues
returning `true` even after powerwash and so the adb proxy was
incorrectly waiting for a signal from some restore-only code. (this
isn't an issue for `adb reboot` because it doesn't restart the vsock
proxy process)
To fix, this commit deletes `sock_vsock_proxy_wait_adbd_start` and
instead uses `IsRestoring` directly.
Bug: 331741524
Test: m && (stop_cvd; launch_cvd --noresume --enable-sandbox=false --daemon --secure_hals=keymint,oemlock,guest_keymint_insecure && snapshot_util_cvd --subcmd=snapshot_take --auto_suspend --force --snapshot_path=$HOME/cf-snapshot && stop_cvd && launch_cvd --snapshot_path=$HOME/cf-snapshot) && powerwash_cvd
Change-Id: I493741948c2a3e87d41551820aa808c33d6cafc3
|
|
The keystore service communicates with both the guest keymint and the
guest gatekeeper to decide on a per-boot shared secret hmac key for
signing authentication tokens.
The host code is present to select the new guest implementation, but it
is not actually installed. Installing it will happen in a later change,
so that the OTA tests stay passing.
Test: launch_cvd --noresume
Change-Id: I9ab638ebac84689846625cc0d6892d9f0222ada9
Bug: 332376454
|
|
into main
|
|
... to help prevent the guest from trying to map AHB memory.
Bug: b/283005889
Test: cvd start --gpu_mode=gfxstream_guest_angle_host_swiftshader
cts -m CtsNativeHardwareTestCases
Change-Id: I0fe3b90f9150b754da3edc544feecef9a2c7b604
|
|
This field is only set in the environment config.
Bug: 331276623
Test: builds
Change-Id: Ic3f5148521e9f0a8738da7b26a2bf56467f2e328
|
|
Nonsecure one is the default one. To use the other one, set one of the
following property with the apex filename.
- persist.vendor.apex.com.android.hardware.keymint (and reboot)
- ro.boot.vendor.apex.com.android.hardware.keymint (and re-launch)
Bug: 331474817
Test: launch_cvd --noresume --secure_hals=keymint,oemlock,guest_keymint_insecure
Test: launch_cvd --noresume --secure_hals=keymint,oemlock,gatekeeper
Test: launch_cvd --noresume
Change-Id: Ifd7ce27d18d77804b5374aa998ad6044645a3946
|
|
- JobExecutor in GceService can produce VIRTUAL_DEVICE_BOOT_FAILURE if a
blocking dependency takes too long.
- kernel_log_monitor watches for VIRTUAL_DEVICE_BOOT_FAILURE and
VIRTUAL_DEVICE_BOOT_PENDING messages
- CvdBootStateMachine will initiate a launcher exit on seeing
VIRTUAL_DEVICE_BOOT_FAILURE
- This is controlled by the new `--fail_fast` flag, which defaults to
`true
- ServerLoopImpl gains a new "failure exit" request type.
- Some refactoring to use `List` rather than `ArrayList` types in
GceService code.
- Update the `.clang-format` file to 4-space-indent java code.
It's still somewhat messy that CvdBootStateMachine sends messages to the
external unix socket API of SeverLoopImpl.
Actually limiting the wait time for bluetooth will happen in the
following CL, so that can be rolled back on its own.
Test: m
Bug: 331668246
Change-Id: I92850b219dc9098b2b3c5139b091324b6bee03a2
|
|
Note that this CL corresponds with cvd PR at: https://github.com/google/android-cuttlefish/pull/483
Test: Do the following:
- lunch the minidroid target
- ensure android-info.txt has the vhost_user_vsock=true stanza. This is the feature flag needed to enable this feature.
- m #build the target
- Follow instructions at device/google/cuttlefish/tools/testing/gen_local_configs.sh to generate test JSON configs
- run `cvd load ~/tmp/local_vsock_isolation.json`
- Wait for `adb devices` to show 4 devices booted
- open one adb shell to each device via: adb -s 0.0.0.0:652[0/1/2/3] root && adb -s 0.0.0.0:652[0/1/2/3] shell
- Test 1: In shell 1: vsock-test 1234
- Test 2: In shell 2: vsock-test 3 1234 test1
- Test 3: In shell 3: vsock-test 1234
- Test 4: In shell 4: vsock-test 5 1234 test2
- Test 5: In shell 4: vsock-test 3 1234 test2
- Verify results: Test 1,2,3,4 succeed Test 5 should fail. These results verify isolation works properly.
Change-Id: I515034af5e647cf4f314f8bd44ad519d50b6b4d6
Bug: 315356037
|
|
Currently cuttlefish tracks if a restore is happening by checking the
config. Once the config is created, it cannot be modified. This caused
issues when attempting to powerwash or restart the device after it was
restored, since the config would remain the same. This lead to a bug
where powerwash/restart would actually perform a restore instead.
Change the behavior so that if FLAGS_snapshot_path is set, create a file
in assembly called "restore".
When restoring, we check if the file "restore" exists.
If trying to powerwash or restart, delete the file "restore" to ensure a
restore does not happen.
Bug: 323596000
Test: boot CF, snapshot, restore, powerwash.
Change-Id: I0a7b79e5fd9f13504cf0f596e4c02c8069fedfbf
|
|
Start adbd once the device resumes as opposed to eagerly when restoring.
Attempts of connecting were causing delays and the device to appear offline
due to failure. This would cause a delay in the device coming online.
Bug: 320760033
Test: boot CF, snapshot, restore
Change-Id: Iec19c7e0f83c547ff8d4819f3f4b30cefb3f5de6
|
|
Bug: 315335613
Test: m -j 10
Change-Id: I50aa69a89449259d8dbb75bd9a8a56b4ecc3b0e4
|
|
This reverts commit 9cf8a0dc493231fa64b866f2d71dda5ebd7e2064.
Change-Id: I725299b13419d15814b2b311f92d8b9054f97dd6
|
|
This code needs to be built outside of android, where the fmt library is
not as recent.
Bug: 315335613
Test: m cvd
Change-Id: Ic796a6a8ed7d08e41e422368dfdff90dfe4f438b
|
|
processor" into main
|
|
Signal restore completed from logcat_receiver to boot_state_machine.
Once logcat starts printing again, the device should be active and safe
to daemonize.
Bug: 309006171
Test: boot cf, snapshot, restore.
Change-Id: I78ff09cfddbf7d20f1bf3087c645969bbc817f09
|
|
processor
Test: m
Bug: 240946444
Change-Id: Ic9c9c3aa8382192c6db227ee032b07fddd4c450c
|
|
Add a new `--host_sandbox` flag to `assemble_cvd` and thereby `cvd
start`. Add support for `cuttlefish::SubprocessOptions` to include a
`sandbox2::Policy` that is applied to a `cuttlefish::Command`.
This carries with it some messy changes:
- `sandboxed_api_sandbox2` is a new shared library dependency for host
tools that include `subprocess.h`.
- `SubprocessOptions` is now only movable rather than copyable.
Bug: 318571494
Change-Id: Ic72427749ea0c85a46f771ba12444777a6800e3d
Test: cvd start --noresume --gpu_mode=guest_swiftshader --enable_host_sandbox=true --daemon
|
|
This is a temporary fix until b/288987294 is fixed.
Because start_wmediumd config is moved to environment config, and
wmedimd not yet moved to run_env, all cvd runs tries to launch wmediumd
and this causes race condition about UDS path.
Test: `cvd start --num_instances=7` only executes one wmediumd process
Bug: 317170946
Bug: 317319382
Change-Id: I24fbee747edc85149ddfb5ffd08ce8adc011fa44
|
|
Test: 1) Sync AOSP 'main' branch,
2) lunch aosp_cf_x86_64_minidroid-trunk_staging-userdebug
3) follow instructions in /device/google/cuttlefish/tools/testing/gen_local_configs.sh to generate some test configs
4) run `cvd load /tmp/local_bootconfig.json`
5) then `adb shell` to running instance and verify value via 'adb getprop ro.boot.W'
Change-Id: I2afd741fa6608d5c235cf609f100a58e71f0b0e2
|
|
This will make it easier to write seccomp rules for `run_cvd` children.
Bug: b/317944244
Test: cvd start --noresume --gpu_mode=guest_swiftshader --console --straced_host_executables=console_forwarder,logcat_receiver
Change-Id: Ic02c0b71eadbfbef84b0266fe51cdaae3fa0baf9
|
|
The flakiness has been resolved with b/317172854
Bug: 315126493
Bug: 277909042
Test: cf_arm64 boot test * 100
Change-Id: I4d61625894b5e17eb092c3717e5fadef5f606228
|
|
mis-identified as numerical formatting (fmt::underlying)
during fmtlib migration; actually formatted with
an operator<<(ostream&) implementation.
Bug: 317046846
Test: mmm device/google/cuttlefish
Change-Id: I47106361c57fb05ba61d0e9901708afb256f8277
|
|
ChromeOS disk
The Cuttlefish bootloader is configured to launch the GRUB EFI
application in the ChromeOS ESP. This flashes the GRUB menu on the
console for a moment before booting into ChromeOS with the kernel flags
defined in its ESP.
Test: launch_cvd \
--chromeos_disk=$HOME/partitions2/chromiumos_test_image.bin \
--resume=false --gpu_mode=guest_swiftshader \
-display0 width=1280,height=720,dpi=120 --console
Bug: b/315230363
Change-Id: I32b4c055572daf31f77dcbb61f0ae7a6d6a9fc23
|
|
These launch a rootfs and kernel image from ChromeOs, using a new chrome
os boot flow that is distinct from the linux boot flow.
The "stateful partition" is required to be partition #1 on the disk that
the root filesystem lives on. The bootloader configuration is changed to
move the ESP out of slot #1. The previous code tried to find the ESP with
${devplist} but I was not able to get that to work, it was always using
slot #1.
https://chromium.googlesource.com/website/+/HEAD/site/chromium-os/chromiumos-design-docs/boot-design/index.md#Filesystem-Initialization-and-Layout
Bug: b/315230363
Test: launch_cvd --chromeos_kernel_path=$HOME/partitions2/bzImage --chromeos_root_image=$HOME/partitions2/rootfs.img --resume=false --gpu_mode=guest_swiftshader --console -display0 width=1280,height=720,dpi=120
Change-Id: Icf238e3f6d48b9e46066203e04d8eb81db32c8fb
|
|
This change adds support for running an external MCU emulator and
connecting it with the main VM. For now only a serial connection is
supported between the two.
The MCU emulator launcher expects a json MCU configuration. The
configuration file defaults to $ANDROID_HOST_OUT/etc/mcu_config.json
and it can be changed with the -mcu_config_path option.
If $ANDROID_HOST_OUT/etc/mcu_config.json does not exist and
-mcu_config_path is not set and the MCU emulator is not started.
For now the following configuration is supported:
- "start-cmd" - an array of string that is used to start the MCU
emulator process; "${wdir}" is replaced with the internal cuttlefish
working directory
- "control" - configuration for a virtio console reserved for
controling the MCU emulator (e.g. transport to the qmp channel for
qemu)
- "path": path relative to the MCU emulator working directory that
is going to be used as the backend for the virtio console
- "type": currently only "serial" is supported and path is expected
to be a link to a pty
- "uart0" - configuration for virtio console reserved for the MCU
emulator
- "path": path relative to the MCU emulator working directory that
is going to be used as the backend for the virtio console
- "type": currently only "serial" is supported and path is expected
to be a link to a pty
Example mcu_config.json:
{
"start-cmd": [
"socat",
"PTY,link=${wdir}/ap_uart,wait-slave",
"EXEC:sh -c \\'while true; do echo test; sleep 1; done\\'"
],
"uart0": {
"path": "ap_uart",
"type": "serial"
}
}
Bug: b/292271389
BYPASS_INCLUSIVE_LANGUAGE_REASON=socat config option
Test: launch_cvd w/o an MCU config
Test: launch_cvd w/ an MCU config and check test messages on /dev/hvc15
Test: tested on x86_64 with both qemu and crosvm
Change-Id: I28a9a7088a2272200c72270c1eddb24afdc52326
|
|
... as this currently does not work due to a KVM limitation with
TTM pages.
Also moves the Gfxstream transport option logic into
graphics_flags.cc so that all of the logic is in the same place.
Bug: b/254721007
Test: cvd start --gpu_mode=gfxstream
Test: cvd start --gpu_mode=gfxstream_guest_angle
Change-Id: I2d9ce310acb7eba51d24b26b20ef96c78baa4cea
|
|
* changes:
Reland "Turn on vhost-user-vsock for arm64 by default"
Reland add vhost-user-vsock option
|
|
if vhost-user-vsock is true, it uses vhost-user-vsock.
with vhost-user-vsock, we can remove dependency on cid, and it is useful
to run cuttlefish inside container without concern about cid conflicts
* In this reland commit, I added
- handle the case socket_vsock_proxy server is running in host
- vhost_user_vsock cid has slightly different meaning svm_cid, so
handle it properly
Bug: 277909042
Test: booting and adb connection for both vhost-user-vsock and vsock
Change-Id: I848028d11682ea7c154297422ba90f252315b1be
|
|
Bug: 312741424
Test: m -j 10
Change-Id: I46fccd0e754e0f43be269219a56a5012a11195a4
|
|
Revert submission 2836276
Reason for revert: b/312683356
Reverted changes: /q/submissionid:2836276
Change-Id: I99dc7c2429c1243d26acdb623ab388e643159458
|
|
if vhost-user-vsock is true, it uses vhost-user-vsock.
with vhost-user-vsock, we can remove dependency on cid, and it is useful
to run cuttlefish inside container without concern about cid conflicts
Bug: 277909042
Test: booting and adb connection for both vhost-user-vsock and vsock
Change-Id: I7b9d596144b64cd14827b2fdc8343fc35ccf3078
|