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

226 commits

Author SHA1 Message Date
HuJK
176980de0d virtio-input: motion sensors fed by the host's own sensors, which a writer on the socket may override
--input motion[path=PATH,host-sensors=BOOL,name=N] is a built-in motion-sensor device, as evdev describes one: INPUT_PROP_ACCELEROMETER,
acceleration on ABS_X/Y/Z (256 per g, +-16 g), angular velocity on ABS_RX/RY/RZ (16 per degree/s), MSC_TIMESTAMP; the same as
example_custom_motion_sensor_config.json. The acceleration is the gravity vector in the screen's frame, as Linux desktops read it
(iio-sensor-proxy: Y negative is "normal", X positive "left-up"): upright at rest, Y is -1 g.

The device reads one end of a socket pair; spawn_motion_feeder writes the other from two sources:
- host-sensors=true: the host's accelerometer and gyroscope at 50 Hz. On Android through the NDK's ASensorManager, loaded from
  libandroid.so at run time as the display backend loads SurfaceControl, and negated (Android reports the reaction to gravity).
  crosvm runs as root under DroidVM, and the sensor service holds continuous sensors back only from app uids in the background,
  so the guest has them whether or not anything is showing it. Elsewhere there is no host source yet.
- path: frames (virtio_input_events ending in SYN_REPORT) from an outside writer, e.g. the app that shows the guest, override the
  host's sensors for as long as they keep coming: a second after the last one, or at once when the writer closes, the host's
  sensors take over again. A presenter that shows the guest's picture turned, or wants it to see other values, sends its own.

Checked on an Ubuntu 26.04 guest (PCI) on the OnePlus Pad 2: "Crosvm Virtio Motion Sensors 0" with PROP=40, udev
ID_INPUT_ACCELEROMETER=1, absinfo -4096..4096 res 256 and -32768..32767 res 16, about 50 accelerometer and 50 gyroscope frames a
second, values matching Android's own (sensorservice shows crosvm's uid-0 connection at 20 ms); monitor-sensor reports right-up
for the tablet held with its natural right edge up (Android ROTATION_90). Before the negation it said left-up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Camiwa7VsPwkhfyscKQ6S
2026-10-27 03:29:01 +08:00
HuJK
a845b0fc2d virtio-input: an axis's resolution, and negative axis bounds in a custom device's config
virtio_input_absinfo lacked the spec's fifth field, res (virtio 5.8.4), so a guest saw every axis's evdev resolution as 0. It is
there now: 0 for the built-in devices as before, the host device's own value for an evdev passthrough, and an optional "res" for a
custom device's axis (units per mm for touch, per g for acceleration, per degree/s for angular velocity). Linux's virtio_input
already reads it; a guest reading only min and max is unaffected (the ABS_INFO payload grows from 16 to 20 bytes).

A custom device's axis "min"/"max" may now be negative (-2048), as an accelerometer's are. They were u32, so the only way to say
it was the two's complement (4294965248), which still parses the same.

devices/tests/data/input/example_custom_motion_sensor_config.json describes motion sensors as evdev does (INPUT_PROP_ACCELEROMETER;
ABS_X/Y/Z acceleration at 256 per g, ABS_RX/RY/RZ angular velocity at 16 per degree/s; MSC_TIMESTAMP), which a Linux guest's udev
tags ID_INPUT_ACCELEROMETER; a test checks its signed bounds and resolutions. The book documents both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Camiwa7VsPwkhfyscKQ6S
2026-10-27 02:56:34 +08:00
Daniel Verkamp
fe99260862 x86_64: fix potential setup_data overlap of mptable
The MPTable is written at a physical offset of 639 KB, which is inside
the region reserved for the Linux kernel setup_data linked list. This is
mostly a theoretical concern, as setup_data is typically not very large,
but to avoid any possibility of a collision, reduce the end of the
setup_data region so that it no longer overlaps the MPTable.

Also add documentation of the MPTable location to the memory layout
page.

BUG=b:398261493

Change-Id: Ie020bdfbec90f04dcf08d3dbe6261a8d8d0b61a5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6292279
Reviewed-by: Michał Mazurek <mazurekm@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2025-02-24 09:59:39 -08:00
Dennis Kempin
964a4a9501 tools: Separate debian packages from other setup
This allows us to create a base container with just debian packages
installed, which we can pin as we uprev other parts of the dev container
(e.g. rust toolchains).

This prevents a frequent annoyance that new debian testing packages
introduce new problems into the build infra.

To make this happen, the setup scripts have been split and
moved to tools/deps, with shorthands in tools/setup*.

BUG=b:382504192
TEST=presubmit with new container
TEST=tools/setup* on local workstation

Change-Id: I0561378c76a1de026c895dfd4052ced02cb3fe8e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6153816
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2025-02-11 15:10:36 -08:00
Dennis Kempin
b1730b36b6 dev container: Uprev to latest debian version
Updates both container and testvm to the latest version and
fixes issues arising from that.

- Uprev some runtime dependencies in cloud_init
- Fix testvm Makefile to use same directory for artifacts
  as testvm.py
- Run ext2 test_mkfs_xattr as sudo to allow modification of selinux
  attributes
- Re-format a couple of files with latest versions of formatters
- Use `cp -u` instead of rsync, because for some mysterious reason
  rsync gets permission errors in CI that cannot be reproduced
  locally.

BUG=b:395695390
TEST=dev_container presubmit --no-delta all

Change-Id: Idff5bf4b15c21ecce883ae9213c50caa4f548353
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6254015
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2025-02-11 15:10:32 -08:00
Daniel Verkamp
83cc2e0e97 x86_64: add Multiboot kernel loading support
Generate the appropriate bootloader information structure (either the
Linux boot_params or Multiboot info) depending on the type of kernel.

BUG=b:354053941
TEST=boot x86-64 lk.elf from <https://github.com/littlekernel/lk>

Change-Id: Ie958c483c85450ec2e1b98199f8bd4288c70cbde
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5727077
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2025-02-10 17:55:19 -08:00
Daniel Verkamp
9d7d9d3126 x86_64: move pvmfw region to just below 2 GB
This simplifies the PVMFW build configuration, since it can use the
default -mcmodel=small code generation option.

BUG=b:375568070

Change-Id: I88ae6e3378eeaf1d540ae5c4b3dd6e8a017d89ea
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6081940
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2025-01-30 13:29:35 -08:00
Daniel Verkamp
4241a0ec99 x86_64: move 640K/1M split logic to arch_memory_regions()
Construct a separate guest memory region for each of the traditional PC
memory layout low-memory areas:

- 0 to 640 KB (RAM)
- 640 KB to 1 MB (reserved for memory-mapped devices, BIOS, and ROMs)
- 1 MB+ (RAM up to the 4 GB PCI hole)

This simplifies the e820 memory map generation code (it just copies the
exact layout from guest_mem.regions() and translates the memory type
values) and ensures the layout provided to the guest matches the actual
GuestMemory region layout.

The memory_layout documentation is also updated to reflect the layout
more accurately; the kernel and initrd regions are contained inside the
above-1MB RAM region, not separate regions on their own.

BUG=b:375568070

Change-Id: I1f35694365a0ec9966b4d208190db103b48e9045
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6086957
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2025-01-30 12:57:54 -08:00
Jorge E. Moreira
ba14648d1e Extend custom input device config format
to include properties and axis information. That way any arbitrary
device configuration can be specified.

BUG=b/393195608
TEST=cargo test -p devices virtio::input::tests

Change-Id: Ic70fbcf2c6ca9fe1170ccd61ad61ba8c0dd3fd6e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6216819
Auto-Submit: Jorge Moreira <jemoreira@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2025-01-29 18:05:58 -08:00
Daniel Verkamp
00a75859cb docs: remove mermaid diagram generation
Just use static images rather than using client-side JavaScript to
generate the diagrams.

Change-Id: Ia02cef221ad7f35361f34b8d7715d9fc822c1d9c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6206903
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
2025-01-29 18:01:10 -08:00
Gurchetan Singh
94d4f2ea93 crosvm: update rutabaga docs
- Provide info on Magma
- Update diagrams and minors fixes

BUG=392889751
TEST=CI

Change-Id: I86176039888c91e230f6ea61780856234ad9c566
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6206897
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2025-01-28 12:42:39 -08:00
Devin Moore
8fabc8a488 docs: Change recommendation for include_str! in tests
They should use relative paths for the files. This is documented as the
expected use in https://doc.rust-lang.org/std/macro.include_str.html and
allows us to avoid using CARGO_MANIFEST_DIR in the tests.

BUG=b:370352548
TEST=tools/presubmit

Change-Id: I97ca771c54275859c0c4a293084de68af78ce914
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6159966
Commit-Queue: Devin Moore <devinmoore@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
2025-01-08 15:04:50 -08:00
Keiichi Watanabe
0e7e3a5b1c book: Add a section about pmem-ext2
Bug: none
Test: mdbook serve

Change-Id: I323ccd29eb0f54b2d940900924935826d6bb217e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6099776
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
2024-12-18 02:11:52 -08:00
Keiichi Watanabe
836413c845 book: Make mdbook_linkcheck mandatory
BUG=none
TEST=mdbook build

Change-Id: I99775c6aa131e79169b7952206b062d2e4829087
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6090773
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2024-12-12 21:33:19 -08:00
Frederick Mayle
c8826242f4 docs: memory_layout: fix aarch64 pci mem reference
Accidentally listed the CAM base for the MEM base.

Change-Id: I5485678f228f9c13b9d68d4c8498af3bfe094bd4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6092549
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Frederick Mayle <fmayle@google.com>
2024-12-12 20:20:05 -08:00
Keiichi Watanabe
187639d12b book: appendix: Fix a missing link in memory_layout.md
Following up https://crrev.com/c/6042654, which forgot to update a link
name.

BUG=none
TEST=mdbook build

Change-Id: I78a29d633d3f5389e2e0e77e816bc7544fe38f9f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6090772
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
2024-12-12 00:34:58 -08:00
Yuan Yao
e0a600c8e4 book: add File Access in Unit Tests section
This CL added recommendation and example codes for the topic of file
access in unit test.

BUG=b:381319960
TEST=mdbook build

Change-Id: Ia04b91b5db334ffab424a8646f0a7bc91e415cb1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6073290
Commit-Queue: Yuan Yao <yuanyaogoog@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2024-12-10 02:04:04 +00:00
Yuan Yao
30c8b4a384 input: fix custom input device parameter doc
The custom input device uses kebab case config-path instead of
config_path.

BUG=b:361215918
TEST=mdbook

Change-Id: Ie0f41d460fb7f8b4002b022d8247248c9f63c374
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6072590
Reviewed-by: Yuan Yao <yuanyaogoog@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Yuan Yao <yuanyaogoog@chromium.org>
2024-12-06 06:53:25 +00:00
Yuan Yao
a4f3659ef0 input: add example keyboard config file
This CL adds example of custom input config file, and shows it on crosvm
book. The example config file matches with the crosvm's default keyboard
config. A unit test is added to ensure the exmaple config file's
supported events is equivalent to the default keyboards.

The example file could benefit users who wants to create their own
configs by modifying it.

BUG=b:361215918
TEST=mdbook build & check the doc

Change-Id: I655c954dca7dc2aa40bc87aa9192ba35712116e0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6033859
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Yuan Yao <yuanyaogoog@chromium.org>
2024-11-27 01:26:18 +00:00
Yuan Yao
2118fbb57c input: Add custom input device
Currently other virtio input devices's configuration are provided from
part of command line, the rest unconfigured part is hard-coded.

This CL introduces a custom device which can configure its name,
serial_name, supported by config file. Crosvm will read and parse the
config file(json format) and create the VirtioInputConfig while
initializing the input device.

By having the custom input device, we can have more flexibility of
creating devices.

Check parse_input_event_config_success() unit test for example of
configuration file format.

BUG=b:361215918
TEST=cargo test

Change-Id: I49fbc33ea655a7c620f82317d556a5d67e7c2765
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5998932
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Yuan Yao <yuanyaogoog@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2024-11-25 02:10:57 +00:00
Frederick Mayle
0f36f6e532 aarch64, x86_64: add cmdline option to configure PCI mem region
This replaces the --pci-start option, allowing the size to be optionally
specified. Also, adds support for aarch64.

BUG=b:361390145

Change-Id: I04c1a59e4c955fe1f222b82b558cdbe7bdd40daf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6042654
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2024-11-22 23:17:50 +00:00
Frederick Mayle
389e62502c aarch64: add cmdline option to configure PCI CAM region
BUG=b:361390145

Change-Id: If9a9baaae6756cf19610d94920b7ac947fbabd27
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6033719
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2024-11-22 23:17:45 +00:00
Daniel Verkamp
af7d4bf7ea docs: memory_layout: fix aarch64 PCI CAM size
The PCI config space is 16 MB (256 bus * 32 dev * 8 func * 256 bytes of
config). Fix the ending address and size in the memory layout
documentation. (The code already correctly had AARCH64_PCI_CFG_SIZE set
to 16 MB, so this is purely a documentation issue.)

Change-Id: Ibbb2c2b15c38d626101ed980580e311519019884
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6042653
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-11-21 23:08:48 +00:00
Frederick Mayle
e500f8851c aarch64: delete AARCH64_AXI_BASE constant
This doesn't seem to correspond to any devices setup by crosvm. We don't
support an AXI bus. Searching for 0x40000000 doesn't turn up anything
relevant.

BUG=b:361390145

Change-Id: Ica4c5bf6ca7b8b417470c37bffd5790776d4086d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5984062
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2024-11-20 22:33:08 +00:00
Junichi Uekawa
e2cdbba57b docs: book: Explicitly mention frontend and backend.
It's a basic terminology but not clearly stated.

BUG=None
TEST=None

Change-Id: I23180f13b0a6053e95441c16d8b9f43706d70a57
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6024730
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
2024-11-19 07:23:45 +00:00
Keiichi Watanabe
7d917b9b06 docs: Add a section for debugging tips of tests
BUG=none
TEST=CQ

Change-Id: I3b89b972d54fd496db1eb017d0af0d6aa183dae1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5960780
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2024-10-25 02:13:01 +00:00
Elie Kheirallah
9861eeb943 docs: add Rust in building crosvm
Noticed there's no mention of Rust in the book to build crosvm, so
adding it here.

BUG=N/A
TEST=mdbook build

Change-Id: Id667e1dc4f99e459b0a592fcce69a8f402fd3beb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5939968
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Elie Kheirallah <khei@google.com>
2024-10-17 20:52:44 +00:00
Gurchetan Singh
76c3a1bfea docs: update gfxstream guest docs
gfxstream guest location has moved.

BUG=329882826
TEST=CI

Change-Id: I265300e079a036c37614cb1d28de29f12a7a8591
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5883907
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2024-09-23 22:54:07 +00:00
Dmytro Maluka
6baab1b86b docs: x86_64 memory layout: update line numbers in code links
BUG=None
Test=click through the URLs

Change-Id: Ic0f7dba5ad7684372627badf909f53168ca26803
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5872816
Commit-Queue: Dmytro Maluka <dmaluka@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2024-09-20 20:04:49 +00:00
Dmytro Maluka
6aed5cc351 x86_64: support --unprotected-vm-with-firmware
As pKVM and pvmfw development for x86 is ongoing, add initial support
for running VMs with pvmfw as the VM bootloader. For now only support
the --unprotected-vm-with-firmware development flag, for running regular
non-protected VMs with pvmfw, which doesn't require pKVM support.

Similarly to ARM, add a dedicated memory region for pvmfw to the x86-64
memory map. This region is located right below the PCI MMIO memory hole.
Its size is 4MB, like on ARM.

Similarly to ARM, the pvmfw entry point is at the beginning of the pvmfw
image, the normal x86-64 boot protocol is kept as is, and additionally
the VM payload (i.e. kernel) entry point is passed to pvmfw in the %rdi
register. This ABI is a subject to change, the final ABI for x86 pvmfw
is not defined yet.

BUG=b:354676864
TEST=1. Run a VM with "--unprotected-vm-with-firmware pvmfw_test.bin"
where pvmfw_test.bin begins with the "jmp *%rdi" instruction (2 bytes:
0xff 0xe7), i.e. pvmfw immediately jumping to the VM entry point.
Result: VM runs as usual.
2. Run a VM with "--unprotected-vm-with-firmware pvmfw_random.bin" where
pvmfw_random.bin contains just random data. Result: VM crashes.

Change-Id: Ib0ee998a99a0cf352a97222769b87be615419187
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5797353
Commit-Queue: Dmytro Maluka <dmaluka@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2024-09-20 19:49:24 +00:00
Dmytro Maluka
01caf160c3 docs: x86_64 memory layout: document sizes of boot page tables
Describe exact memory regions occupied by page tables in the memory
map, not just their offsets.

BUG=b:354676864
TEST=None

Change-Id: I14a9b4480c7b0d002b133481d0735389ad22716f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5878320
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dmytro Maluka <dmaluka@chromium.org>
2024-09-20 19:49:11 +00:00
Dorinda Bassey
bedeb1675f docs: add documentation to build and install virglrenderer
The system-installed version of virglrenderer is often too old
to be compatible with crosvm, particularly on some Linux
distributions. To ensure compatibility, add documentation to
manually build and install `virglrenderer` from source
instead of relying on potentially outdated system versions.

Change-Id: I862f8fe82bbb5a45bae540bd70e3e8d7fdd16e1f
Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5836695
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
2024-09-09 16:29:24 +00:00
Daniel Verkamp
8cc63c4219 devices: virtio: make Queue track its own Interrupt
When constructing a Queue from a QueueConfig, require the caller to pass
the corresponding Interrupt, and remove the &Interrupt argument from the
Queue::trigger_interrupt() function. This prevents mismatches of Queue
and Interrupt, especially in the case of a re-activation after a reset
where the old and new Interrupt are not the same.

BUG=b:360926085

Change-Id: I31ad9704d4963e46f7ce1b7b7a43aec1a92e342d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5798666
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
2024-08-23 01:23:11 +00:00
Gurchetan Singh
e2c2ce901a docs: update kumquat instructions
Using kumquat no longer requires a separate build,
just an separate environment variable.

BUG=357650978
TEST=none

Change-Id: Ie94da7de0fcc7bdea7e41638d986b69bcf5f6daf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5799157
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2024-08-20 16:01:44 +00:00
Frederick Mayle
49a6c3cf2d aarch64: add cmdline param to control FDT address
On aarch64, we load BIOS payloads at offset 0x200000 because
cuttlefish's u-boot BIOS requires the FDT at offset zero. However, in a
separate use case, we are loading BIOS payloads that are OK with dynamic
FDT addresses, but might use the Gunyah hypervisor, which currently
requires the payload to be loaded at offset zero. One algorithm can't
satisfy both.

Both the u-boot setup and Gunyah ought to be made more flexible, but it
seems useful to make crosvm's behavior configurable. It lets us adjust
those use cases eventually without causing an immediate backwards
incompatability scramble.

A new "after-payload" mode is included that matches crosvm's RISCV FDT
address behavior and potentially helps with the TODO for >4GB VMs.

BUG=b:353758405

Change-Id: I886f47cf8e0a6b02218794615215a0e972a4ace2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5740018
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Frederick Mayle <fmayle@google.com>
2024-08-06 00:06:52 +00:00
Gurchetan Singh
eb4de73dc9 docs: more changes to kumquat docs
- build.rs appends gfxstream_unstable automatically
- documentation on Nvidia

BUG=300140266
TEST=CI

Change-Id: I376d36c9e354fa06b20e4556dbe49cd3e31cd9f8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5698194
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2024-07-12 23:48:51 +00:00
Frederick Mayle
7ddec973f5 fix memory size when static swiotlb is enabled
Previously, if `--mem` was set to 100MB and `--swiotlb` to 1MB, then
we'd essentially allocate 101MB of RAM for the guest and tell it about a
single 101MB memory region in the FDT (adjacent regions are merged in
the FDT). In contrast, for hypervisors that don't require static
swiotlb, we'd only allocate 100MB of RAM (and then the guest would need
to choose 1MB of its own memory to dedicate to this purpose).

Now both cases will get the same RAM size.

Removed the swiotlb reference from memory_layout.md since it is part of
the RAM region from the perspective of the guest. The need for the
static swiotlb to be created as a separate memslot is more of a
hypervisor implementation detail I think.

BUG=b:346770542

Change-Id: I60b10521635c16fa77b4320de0e11f03ebeca0c5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5637774
Reviewed-by: Elliot Berman <quic_eberman@quicinc.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Richard Zhang <rizhang@google.com>
2024-07-12 23:46:00 +00:00
Sachin Parekh
432c84f9a9 docs: building_crosvm: Add crosvm executable path information
Document the path of crosvm executable in case of building inside
development container

BUG=None
TEST=mdbook build

Change-Id: Iee0e697cc4d1949b7b02f4f12b4504ec6a1b1862
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5693364
Commit-Queue: Sachin Parekh <sachinparekh@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2024-07-12 05:09:33 +00:00
Gurchetan Singh
5fe9b39d53 docs: appendix: update rutabaga docs
- How to use Kumquat to run GL/VK apps
- How to contribute to AOSP projects
- Various nits

BUG=b:300140266
TEST=mdbook build

Change-Id: I31a7143ba3ed9ed56c55d7ff56f764dcf2fc3a42
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5683770
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2024-07-08 17:22:02 +00:00
Gurchetan Singh
a2d37e76b3 docs: specify proper release
We want to go proper release model.

BUG=none
TEST=none

Change-Id: I56a4e2522f809556710b8762c62104c1a79c0242
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5664541
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2024-06-28 19:08:50 +00:00
Daniel Verkamp
36c4eca13f cmdline: add root option for --pmem
Similar to the root option for virtio-block devices, make it possible
to automatically add a kernel root=/dev/pmem<N> command line parameter
for a pmem device.

BUG=b:340780535
TEST=crosvm run --pmem vm_rootfs.img,root=yes bzImage

Change-Id: I938ca1dcedda1392474a91924c02c4b02f114fe9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5545760
Reviewed-by: Richard Zhang <rizhang@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-05-17 19:15:09 +00:00
Keiichi Watanabe
0ab7bf56aa docs: book: testing: Add sample commands for running e2e tests
BUG=none
TEST=check a rendered page with `mdbook serve`

Change-Id: I9fc33a5008141d0381d948c544770f48ffd8e682
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5542384
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2024-05-17 02:05:59 +00:00
Daniel Verkamp
55c3856818 docs: update ChromeOS developer guide links
These have moved back to the www.chromium.org website.

Change-Id: I2e29687a8a074b308249949d4272357ec20af8ba
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5381669
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-03-21 17:41:27 +00:00
Junichi Uekawa
8c8939860e book: qemu-user not qemu-static.
static is just describing how the binaries are linked; the emulator being used
is the qemu-user, which emulates guest userspace syscall API and uses the host
kernel.

BUG=None
TEST=read it

Change-Id: I8b827498727de4ce85604dc3b9efebd89df56e62
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5308639
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2024-03-14 09:33:50 +00:00
Federico 'Morg' Pareschi
e59edadc4e docs: Add u2f device support page to mdbook
BUG=b:326345530
TEST=built mdbook

Change-Id: Iff8aee96b640b954cf9caf58c5618c48e0168b7d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5320441
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Morg <morg@google.com>
2024-03-14 02:45:28 +00:00
Noah Gold
2bc8a5d7c6 book: style guide: add dispatch enum pattern.
auradkar@, fmayle@, schuffelen@, and nkgold@ discussed
the guidance for cross platform enums and have decided
to recommend a new pattern for dispatch style enums.

BUG=NONE
TEST=builds

Change-Id: I07ce234753a5c39873ae214d6407181cbd46fcf0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5369097
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Cody Schuffelen <schuffelen@google.com>
2024-03-13 22:53:09 +00:00
Bogdan-Cosmin Chifor
244f1e1d37 x86_64: Enable identity map address and accomodate larger BIOS size
On Azure Dv3 instances `unrestricted guest` is not available.
This prevents crosvm from booting, because TSS address overlaps
with BIOS memory region when BIOS is larger than ~250K.
This fix allows 16M BIOS maximum size and enables identity map address
which allows crosvm to boot on machines where `unrestricted guest` is
not available.

BUG=None
TEST=tools/presubmit
TEST=Boot an AOSP Cuttlefish VM on Azure (without unrestricted guest) and GCP (with unrestricted guest)

Co-authored-by: Bogdan-Cosmin Chifor <bogdan.chifor@tii.ae>
Co-authored-by: Mikko Koivisto <mikko.koivisto@unikie.com>
Co-authored-by: Myung Kyu Kim <myung.kyu.kim@unikie.com>
Change-Id: Ibf7b6685eca969f5f52dd6e5f3510bf919c14e2c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5290234
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-02-16 21:41:01 +00:00
Daniel Verkamp
e23ea9b060 cmdline: add --input to consolidate virtio-input options
Add a single --input command-line option that can accomodate all virtio
input device types. This will eventually replace the existing input
options such as --keyboard, --mouse, and --multi-touch. For now, a
deprecation notice is added and the existing options continue to work as
before.

BUG=b:255223604
BUG=b:321746987

Change-Id: I243c76a6e16ee0019b4538a39af0363bdfe32d59
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5226605
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-02-13 21:56:14 +00:00
Keiichi Watanabe
1790e3681a docs: Fix link to the internal uprev playbook
BUG=none
TEST=mdbook serve

Change-Id: Id18cb9f43e96d0736384d5a8f20cb36706e16830
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5223795
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
2024-01-23 18:49:48 +00:00
Shintaro Kawamura
aa0e6ea99a doc: how to cherry-pick to release branch
BUG=none
TEST=mdbook serve

Change-Id: Ie21d9e3c8e575785d0907b5a39bcb8bca1d5e8f6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5201654
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2024-01-18 08:00:31 +00:00