summary refs log tree commit diff
path: root/Cargo.toml
Commit message (Collapse)AuthorAge
* Don't build crosvm_*_wlAlyssa Ross2020-06-15
| | | | | We're not going to use these any more, but let's keep the code around for now.
* crosvm: add memfd serverAlyssa Ross2020-06-15
|
* three partsAlyssa Ross2020-06-15
|
* switch from poly_msg_socket to msg_socket2Alyssa Ross2020-06-15
|
* poly_msg_socketAlyssa Ross2020-06-15
| | | | we're gonna need this to send all of VirtioDevice over a socket
* hacky working out-of-process virtio_wlAlyssa Ross2020-06-15
|
* devices: virtio: Initial implementation of virtio-video deviceKeiichi Watanabe2020-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | This CL adds a fundamental part of the virtio video device, which will be shared between the encoder and the decoder. Both devices uses the virtio-video protocol proposed as RFC v3 [1,2]. The corresponding driver code is at CL:2060327 and its children CLs. The actual decoding and encoding logic will be implemented in different CLs. [1]: mail: https://markmail.org/thread/wxdne5re7aaugbjg [2]: PDF: https://drive.google.com/file/d/1jOsS2WdVhL4PpcWLO8Zukq5J0fXDiWn-/view BUG=b:147465619, b:140082257 TEST=cargo check --features=video-decoder,video-encoder TEST=ARCVM started with --video-decoder --video-encoder Cq-Depend: chromium:2203997 Change-Id: I01999eea218ba0f3aaed1558ca2311a57d0c6819 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1973973 Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Tested-by: Keiichi Watanabe <keiichiw@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
* Adding hypervisor crate to abstract out Kvm implementationUdam Saini2020-05-03
| | | | | | | | | | | | | | | | | | | | | | This is a separate hypervisor crate for interacting with Kvm in an abstract manner. The intention is to not leak the internals of kvm with its specific calls in various places in the codebase. Currently, this just creates an initial structure for adding various implementations over time. In addition, a SafeDescriptor class is added, that wraps a raw file descriptor safely, without needing to wrap it in the rust file class. The intention is to use this for non file raw descriptors. BUG=chromium:1077058 TEST=added a basic kvm test that creates a Kvm struct Change-Id: I4229203902e480b52435cde12bf0d25a322c71be Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2174756 Commit-Queue: Udam Saini <udam@google.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* acpi_tables: Add initial ACPI tables supportChuanxiao Dong2020-02-27
| | | | | | | | | | | | | | | | | The basic ACPI table support for creating XSDT. It refers to the implementation of the Cloud-hypervisor's ACPI commit: - Cloud-hypervisor: acpi_tables: Add initial ACPI tables support BUG=chromium:1018674 TEST=cargo test -p acpi_tables Change-Id: Ia3b597936fef214fcb92fce28c91152dfa03bec9 Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2035350 Reviewed-by: Tomasz Jeznach <tjeznach@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* virtio-gpu: gfxstream backendLingfeng Yang2020-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a new backend type, gfxstream, that calls out to a C library implementing the actual rendering. The purpose is to allow the Cuttlefish and Android Studio Emulator teams to use crosvm with the current API-forwarding style of rendering employed in the Android Studio Emulator. Also, introduces a new key to the --gpu command line interface, backend=, which selects from different backends. Note that the previous behavior is now deprecated and will be removed after some time (when all clients switch over to backend=). The gfxstream backend itself implements a subset of 3d-related resource and context creation/transfer/execbuffer commands. Their meaning is specific to the way in which they are interpreted in the backend library. To interface with display, gfx stream backend takes a callback that is run on guest vsync. The callback is responsible for repainting the display's contents. gfx stream provides a callback, get_pixels, that can be used asynchronously. The asyncness is not taken advantage of currently but will be useful for cases where the client attached to the VMM might want to update at a different rate than guest vsync. The guts of the stream backend library is currently defined here: https://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/android-qemu2-glue/emulation/virtio-goldfish-pipe.cpp The linking of the library is controlled via the feature "gfxstream". If the feature is turned off, we use a default do-nothing stub impl. Next steps: - integrate virtio-gpu-next so as to have host coherent memory for vulkan - Figure out low latency command submit/response with SUBMIT_CMD_3DV2 BUG=b:146066070 Change-Id: If647381c15e5459cec85e2325f97e2f0a963b083 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2033305 Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Jason Macnak <natsu@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Auto-Submit: Lingfeng Yang <lfy@google.com> Commit-Queue: Zach Reizner <zachr@chromium.org>
* io_jail: use minijail-sys crateStephen Barber2020-02-15
| | | | | | | | | | | | BUG=chromium:1032360 TEST=cargo build outside of chroot; emerge-board crosvm Cq-Depend: chromium:2055725 Change-Id: I2493f563b07aeaff4627c8b8c4b578901393dc58 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1959449 Reviewed-by: Stephen Barber <smbarber@chromium.org> Tested-by: Stephen Barber <smbarber@chromium.org> Commit-Queue: Stephen Barber <smbarber@chromium.org>
* Add async_core crateDylan Reid2020-02-10
| | | | | | | | | | | This crate will provide asynchronous helpers wrapping primitives provided by sys_util. To start EventFDs and MsgReceivers are provided. Change-Id: Ia8862adafca995a3e3ab56582acc166a37fc8d2c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1955046 Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Dylan Reid <dgreid@chromium.org>
* Add a cros_async crate.Dylan Reid2020-02-10
| | | | | | | | | | | | | | | This crate will house code using the new async/await features to be used by other parts of crosvm. Start the crate with a Future executor that runs tasks in a single thread and allows futures that block on system file descriptors. Change-Id: If77778ac056210dabbfc6e6e1e63df1c1b904a7f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1955045 Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Dylan Reid <dgreid@chromium.org>
* disk: move qcow into disk crateDaniel Verkamp2020-01-06
| | | | | | | | | | | | | | | | | | | Move qcow from being its own crate into a module of the disk crate, similar to the composite disk module. This will allow use of qcow from disk and vice versa without introducing a circular crate dependency. BUG=None TEST=./build_test.py TEST=USE='asan fuzzer' emerge-nami crosvm Change-Id: I77512bbe4b94faff1b5460f9796ee56505135580 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1972477 Reviewed-by: Cody Schuffelen <schuffelen@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
* Remove render node forward codeLepton Wu2019-12-10
| | | | | | | | | | | | | We don't use it for ARCVM now. BUG=None TEST=`emerge-eve crosvm` Change-Id: I14343a2eb24c24a0216950b7c4eeb56ac482973e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1958569 Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Lepton Wu <lepton@chromium.org> Auto-Submit: Lepton Wu <lepton@chromium.org>
* ensure libc crate is at least 0.2.44Zach Reizner2019-11-09
| | | | | | | | | | | | | | BUG=None TEST=emerge-${BOARD} crosvm Change-Id: Ifc7e0b0d8dc42faf54e920533225fafc197e0b7c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1906988 Tested-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Auto-Submit: Zach Reizner <zachr@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org> Commit-Queue: Stephen Barber <smbarber@chromium.org> Commit-Queue: Zach Reizner <zachr@chromium.org>
* Allow use of newer versions of the libc crate.Allen Webb2019-11-07
| | | | | | | | | | | | BUG=None TEST=emerge-${BOARD} crosvm # and manual testing. Change-Id: I1b7f0cd95aac327eeba86e2512a4fad1bf8b150e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1899220 Tested-by: Allen Webb <allenwebb@google.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Stephen Barber <smbarber@chromium.org> Commit-Queue: Allen Webb <allenwebb@google.com>
* usb: replace libusb with Rust usb_util libraryDaniel Verkamp2019-10-17
| | | | | | | | | | | | | | | | | | | | | Drop the dependency on libusb and reimplement the host USB backend using usb_sys to wrap the Linux usbdevfs ioctls. This allows sandboxing to work without any dependency on libusb patches, and it gives us the flexibility to modify and update the USB backend without depending on an external third-party library. BUG=chromium:987833 TEST=`adb logcat` on nami with Nexus 5 attached TEST=deploy app to phone with Android Studio TEST=Run EdgeTPU USB accelerator demo (including DFU mode transition) Cq-Depend: chromium:1773695 Change-Id: I4321c2b6142caac15f48f197795a37d59d268831 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1783601 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* Support composite disks.Cody Schuffelen2019-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new disk file type next to raw files and qcow images that represent an indirection to further raw disk files. The disk file itself is a proto file with references to file paths for other disks to open and their virtual offsets and lengths. The intention is to make it easy to assemble a single virtual hard disk out of several distinct partition files. In the particular case of Cuttlefish running Android in a VM, this is relevant as the Android build system distributes partitions as separate raw files. While the simple solution is to pass each partition as a separate raw disk, some functionality (like the bootloader) assumes there is a partition table with multiple distinct partitions on a single disk. Implementing composite disk support in the VMM bridges this gap through supporting the general-purpose case of a disk built out of multiple component files. If desired, this can be extended to support qcow files to support unusual configurations like a mixed qcow/raw disk. Enabled with the "composite-disk" feature. Bug: b/133432409 Change-Id: I2b0c47d92fab13b5dc0ca5a960c7cfd2b7145b87 Signed-off-by: Cody Schuffelen <schuffelen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1667767 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* crosvm: add 'virtio-gpu-next' feature flagGurchetan Singh2019-10-01
| | | | | | | | | | | | | | | With this, crosvm builds that don't have the CrOS version of virglrenderer can build against master without adjustments. BUG=chromium:924405 TEST=compile Change-Id: Iee27c003bee1eb8947cb048dc16e2da6c68af11e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1797067 Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* Extract disk creation logic out of qcow and src.Cody Schuffelen2019-08-28
| | | | | | | | | Bug: b/133432409 Change-Id: Iba25d5f6bb5f60619bb2f5a3d72ddfd3a81650b4 Signed-off-by: Cody Schuffelen <schuffelen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1691460 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* Remove remaining byteorder crate referencesDaniel Verkamp2019-08-26
| | | | | | | | | | | | | | Remove the last (unused) reference to byteorder in vm_control/Cargo.toml and remove it from the list of external crates in README.md. BUG=None TEST=./build_test Change-Id: Ie70c0bc2f96c19b34ef1596885245eca7bc202f4 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1761156 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* split crosvm into a library and a main "crosvm" binaryZach Reizner2019-08-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change has 3 parts: - Modify the Cargo.toml to point at the bin and the lib source. - Move modules and Config struct into the lib source - Fix the argument/plugins module's doc comments which had never been tested. The motivation for this change is to make testing crosvm's major functionality (booting guest kernels, emulating hardware, etc) easier to do from a cargo test. Being able to launce a crosvm config via the API instead of the binary's command line will be possible with this change. A side benefit is that this also enables doc tests in the lib side of crosvm. The doc tests in binaries are not run due to a limitation in how they get tested by cargo. TEST=cargo test ./build_test kokoro/kokoro_simulator.sh emerge crosvm BUG=None Change-Id: I9d4b3a24231b895e8dfaf9e7b0f2b33350772041 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1730333 Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Zach Reizner <zachr@chromium.org>
* gpu_display: add X11 backendZach Reizner2019-07-25
| | | | | | | | | | | | | | This change adds an X11 backend to the gpu_display crate. With this addition, the virtio-gpu device can display to traditional linux desktops that only have X11 output. Change-Id: I86c80cac91ca5bdc97588194a44040273ae69385 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1591572 Reviewed-by: Stéphane Marchesin <marcheu@chromium.org> Commit-Queue: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Auto-Submit: Zach Reizner <zachr@chromium.org>
* clippy: Resolve cast_ptr_alignmentDavid Tolnay2019-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | This CL fixes four cases of what I believe are undefined behavior: - In vhost where the original code allocates a Vec<u8> with 1-byte alignment and casts the Vec's data pointer to a &mut vhost_memory which is required to be 8-byte aligned. Underaligned references of type &T or &mut T are always undefined behavior in Rust. - Same pattern in x86_64. - Same pattern in plugin::vcpu. - Code in crosvm_plugin that dereferences a potentially underaligned pointer. This is always undefined behavior in Rust. TEST=bin/clippy TEST=cargo test sys_util Change-Id: I926f17b1fe022a798f69d738f9990d548f40c59b Reviewed-on: https://chromium-review.googlesource.com/1566736 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: David Tolnay <dtolnay@chromium.org>
* lints: Enforce sorted order for enum variantsDavid Tolnay2019-04-13
| | | | | | | | | | | | | | | | | | | | | | | | | To avoid wasting time re-sorting these things (CL:1492612). https://docs.rs/remain Disclaimer: I wrote the macro. This CL adds #[sorted] attributes to those Error enums that seemed to have made some effort to be in sorted order. TEST=cargo check TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu TEST=emerge-nami crosvm TEST=local kokoro CQ-DEPEND=CL:1524247 Change-Id: I89685ced05e2f149fa189ca509bc14c70aebb531 Reviewed-on: https://chromium-review.googlesource.com/1515998 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: David Tolnay <dtolnay@chromium.org>
* protos: Merge plugin_proto crate under protos::pluginDavid Tolnay2019-04-12
| | | | | | | | | | | | | | | | | | | | | | | | | This de-duplicates the two separate build.rs files dealing with proto compilation. The trunks interface.proto will be exposed under protos::trunks and the plugin proto will be exposed under protos::plugin. BUG=none TEST=cargo check TEST=cargo check --features tpm TEST=cargo check --features plugin TEST=cargo check --features tpm,plugin TEST=FEATURES=test emerge-nami crosvm TEST=FEATURES=test USE=crosvm-tpm emerge-nami crosvm TEST=FEATURES=test USE=crosvm-plugin emerge-nami crosvm TEST=FEATURES=test USE='crosvm-tpm crosvm-plugin' emerge-nami crosvm TEST=local kokoro CQ-DEPEND=CL:1553971 Change-Id: I203b654a38e9d671a508156ae06dfb6f70047c4f Reviewed-on: https://chromium-review.googlesource.com/1556417 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* protos: Update to protobuf 2.3David Tolnay2019-04-12
| | | | | | | | | | | | | | | | | | | | | This matches the version already used by crostini_client. The newer protobuf version depends on the tempfile crate rather than tempdir, the latter being now deprecated. So I replaced our immitation tempdir crate with one that matches the API of tempfile instead. As a reminder, we use this crate as a patch to avoid pulling in all of the rand crate and its many dependencies. TEST=cargo check --features plugin CQ-DEPEND=CL:1553971 Change-Id: I28eed3ceadb1013f015400b4c582aaf8dc89eee1 Reviewed-on: https://chromium-review.googlesource.com/1562924 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* cargo: Sort all dependency lists in Cargo.tomlDavid Tolnay2019-04-09
| | | | | | | | | | | | | | | This may help reduce cases of conflicts between independent CLs each appending a dependency at the bottom of the list, of which I hit two today rebasing some of my open CLs. TEST=cargo check --all-features Change-Id: Ief10bb004cc7b44b107dc3841ce36c6b23632aed Reviewed-on: https://chromium-review.googlesource.com/1557172 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* edition: Update crosvm crate to 2018 editionDavid Tolnay2019-04-08
| | | | | | | | | | | | | | | | | | Separated out of CL:1513058 to make it possible to land parts individually while the affected crate has no other significant CLs pending. This avoids repeatedly introducing non-textual conflicts with new code that adds `use` statements. TEST=cargo check TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu Change-Id: If27a414db82bd6005d8067af24639f309d3b5e2e Reviewed-on: https://chromium-review.googlesource.com/1519691 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: David Tolnay <dtolnay@chromium.org>
* usb: remove unused usb-emulation feature flagZach Reizner2019-03-17
| | | | | | | | | | | | | | This cleans up some feature flag plumping for libusb sandboxing as well. BUG=chromium:831850 TEST=cargo test CQ-DEPEND=CL:1512762 Change-Id: Ic70784db204ddced94498944b021bcb7dd708bb1 Reviewed-on: https://chromium-review.googlesource.com/1522214 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Jingkui Wang <jkwang@google.com>
* implement xhci and add it to pci busJingkui Wang2019-03-17
| | | | | | | | | | | | | | Implement xhci controller, setup seccomp filters and add xhci to pci bus. CQ-DEPEND=CL:1512761 BUG=chromium:831850 TEST=local build Change-Id: I5c05452ece66e99d3a670e259e095fca616e835d Reviewed-on: https://chromium-review.googlesource.com/1512762 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Jingkui Wang <jkwang@google.com>
* Start render node host service in crosvmLepton Wu2019-03-14
| | | | | | | | | | | | | BUG=b:118408510 TEST=manual - build crosvm with/without crosvm-gpu-forward USE flag and run arcvm. Change-Id: Ibb85d52dc679aa8524b29d86148ca28d82d8fe98 Reviewed-on: https://chromium-review.googlesource.com/1347330 Commit-Ready: Lepton Wu <lepton@chromium.org> Tested-by: Lepton Wu <lepton@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Lepton Wu <lepton@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* crosvm: remove LTO from release profileZach Reizner2019-03-05
| | | | | | | | | | | | | | | | Builders of crosvm, such as the crosvm ebuild, should determine if they want LTO enabled. By having lto removed from the release profile, builders using `--release` will not be forced to use LTO. BUG=None TEST=cargo build --release should be heckin' fast Change-Id: I4e231b6dac7670ab146d36c1c1660ab67935285a Reviewed-on: https://chromium-review.googlesource.com/1497734 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
* Implement PIT.Miriam Zimmerman2019-01-31
| | | | | | | | | | | | | | BUG=chromium:908689 TEST=Unit tests in file. Change-Id: I796478fc65a69c18e70ffeaaac753b722edf9091 Reviewed-on: https://chromium-review.googlesource.com/1413831 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Miriam Zimmerman <mutexlox@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Steve Rutherford <srutherford@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* linux: Add ac97 device with CRAS backendpaulhsia2019-01-27
| | | | | | | | | | | | | | | | | | Add an ac97 device that plays audio through CRAS audio server. BUG=chromium:781398 BUG=chromium:907520 TEST=Test building by $ cargo build TEST=Deploy crosvm to DUT and test audio functionality CQ-DEPEND=CL:1429311 CQ-DEPEND=CL:1429542 Change-Id: Ia273d8f1e82c20d1f1882f088886458339399aae Reviewed-on: https://chromium-review.googlesource.com/1426282 Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Chih-Yang Hsia <paulhsia@chromium.org> Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
* linux: add ac97 to the pci busDylan Reid2019-01-26
| | | | | | | | | | | | | | | Add an ac97 device that plays audio to /dev/null. BUG=chromium:781398 TEST=Test crosvm with null device Change-Id: I3849974b732fc1550ec2bf0f805726bf2ca296f6 Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1398641 Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Chih-Yang Hsia <paulhsia@chromium.org> Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
* devices: Add an Ac97 PCI deviceDylan Reid2019-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Ac97 device provides the guest with an audio playback device. All input devices are stubbed out. Only playback at 48kHz is supported. The device is emulated by `Ac97Dev` which interfaces with the PCI bus. `Ac97Dev` uses `Ac97` to drive audio functions and emulate the device registers. Physical Ac97 devices consist of two parts, the bus master and a mixer. These two sets of registers are emulated by the `Ac97BusMaster` and `Ac97Mixer` structures. `Ac97BusMaster` handles audio samples and uses `Ac97Mixer` to determine the configuration of the audio backend. BUG=chromium:781398 TEST=crosvm run --disable-sandbox --null-audio --rwdisk gentoo.ext4 -c2 -m2048 -p 'root=/dev/vda snd_intel8x0.inside_vm=1 snd_intel8x0.ac97_clock=48000' vmlinux.bin and play audio with aplay -d2 -Dhw:0,0 -f dat /dev/urandom CQ-DEPEND=CL:1402264 CQ-DEPEND=CL:1421588 CQ-DEPEND=CL:1433794 CQ-DEPEND=CL:1432835 Change-Id: I9985ffad753bccc1bf468ebbdacec0876560a5e0 Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1366544 Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Chih-Yang Hsia <paulhsia@chromium.org> Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
* tpm: Virtio tpm deviceDavid Tolnay2019-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds a "tpm" Cargo cfg to crosvm which enables a TPM device backed by libtpm2 simulator. Tested by running the following inside cros_sdk: LIBRARY_PATH=~/src/minijail LD_LIBRARY_PATH=~/src/minijail \ cargo run --release \ --features tpm \ -- \ run \ -r rootfs.ext4 \ --seccomp-policy-dir seccomp/x86_64/ \ -p init=/bin/bash \ -p panic=-1 \ --disable-sandbox \ vmlinux.bin with a Linux image built from CL:1387655. The TPM self test completes successfully with the following output: https://paste.googleplex.com/5996075978588160?raw Justin's TPM playground runs with the following trace output. https://paste.googleplex.com/4909751007707136?raw Design doc: go/vtpm-for-glinux TEST=ran TPM playground program inside crosvm TEST=local kokoro BUG=chromium:911799 Change-Id: I2feb24a3e38cba91f62c6d2cd1f378de4dd03ecf Reviewed-on: https://chromium-review.googlesource.com/1387624 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* crosvm: Support cros-rust version crosvm ebuildpaulhsia2019-01-22
| | | | | | | | | | | | | | | | | | | | | | | To support eclass migration for crosvm ebuild from crate to cros-rust. This CL need to be built with cros-rust version crosvm ebuild. - Upgrage crate cc from 1.0.15 to 1.0.25. - Change local tempdir version from 0.3.5 to 0.3.7 for ebuild integration. - Remove 9s directory since it's moved to platform2. BUG=chromium:781398 BUG=chromium:907520 TEST=Run $ FEATURES=test emerge-eve crosvm in a clean chroot CQ-DEPEND=CL:1421303 Change-Id: Iab615b555a51f8020e5efae1cc40ac6b54ea87f2 Reviewed-on: https://chromium-review.googlesource.com/1421237 Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Chih-Yang Hsia <paulhsia@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* remove rand crateDaniel Prilik2019-01-17
| | | | | | | | | | | | | | | | | | | the few uses of rand::thread_rng() have been replaced with either prngs or reads from /dev/urandom. the implementations are under the `rand_ish` minicrate. `protoc-rust` depends on `tempdir`, which relies on rand, so `tempdir` has been patched with a rewritten version that does not have rand as a dependency. BUG=chromium:921795 TEST=cargo test --features plugin Change-Id: I6f1c7d7a1aeef4dd55ac71e58294d16c291b8871 Reviewed-on: https://chromium-review.googlesource.com/1409705 Commit-Ready: Daniel Prilik <prilik@google.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* crosvm: Split sub-crates into independent workspacepaulhsia2019-01-03
| | | | | | | | | | | | | | | | | | | Split sub-crates under crosvm root directory into several independent workspaces for adding ebuild files for those crates. data_model and sys_util could only be built by emerge after creating their ebuilds. BUG=chromium:916921 TEST='emerge-eve crosvm' TEST=Run 'cargo build' under crosvm directory Change-Id: I2dddbbb7c7344e643183a5885e867f134b299591 Reviewed-on: https://chromium-review.googlesource.com/1385972 Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org> Tested-by: Chih-Yang Hsia <paulhsia@chromium.org> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* usb_util: add sandboxed-libusb featureJingkui Wang2018-12-20
| | | | | | | | | | | | | | | | make open_fd patch optional. if sandboxed-libusb feature is not selected, open_fd is not required. In this case, the code must have access to /dev/bus/usb, and not external fd is needed. BUG=chromium:831850 TEST=cargo test Change-Id: I21fa87dd15d08a03c2fe2b190559abbe6f63dcd5 Reviewed-on: https://chromium-review.googlesource.com/1375019 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* sync: Mutex type with methods that panic instead of return errorDavid Tolnay2018-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds a crate `sync` containing a type sync::Mutex which wraps the standard library Mutex and mirrors the same methods, except that they panic where the standard library would return a PoisonError. This API codifies our error handling strategy around poisoned mutexes in crosvm. - Crosvm releases are built with panic=abort so poisoning never occurs. A panic while a mutex is held (or ever) takes down the entire process. Thus we would like for code not to have to consider the possibility of poison. - We could ask developers to always write `.lock().unwrap()` on a standard library mutex. However, we would like to stigmatize the use of unwrap. It is confusing to permit unwrap but only on mutex lock results. During code review it may not always be obvious whether a particular unwrap is unwrapping a mutex lock result or a different error that should be handled in a more principled way. Developers should feel free to use sync::Mutex anywhere in crosvm that they would otherwise be using std::sync::Mutex. TEST=boot linux Change-Id: I9727b6f8fee439edb4a8d52cf19d59acf04d990f Reviewed-on: https://chromium-review.googlesource.com/1359923 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* usb_util: Create libusb wrapperJingkui Wang2018-12-01
| | | | | | | | | | | | | This wrapper will be part of usb emulation backend. BUG=chromium:831850 TEST=local build Change-Id: I084b15201941e4c16c4e3ff9b967e55db09db567 Reviewed-on: https://chromium-review.googlesource.com/1124870 Commit-Ready: Jingkui Wang <jkwang@google.com> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Jingkui Wang <jkwang@google.com>
* uprev crosvm and 9s libc to 0.2.44Stephen Barber2018-11-27
| | | | | | | | | | | | BUG=chromium:908695 TEST=emerge crosvm CQ-DEPEND=CL:1351218 Change-Id: Ife3895ed07eaba6e768fa7816dca403bc290fb7c Reviewed-on: https://chromium-review.googlesource.com/1351219 Commit-Ready: Stephen Barber <smbarber@chromium.org> Tested-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* move qcow_utils to members from dependenciesZach Reizner2018-11-16
| | | | | | | | | | | | | | | | | | The qcow_utils crate is not a dependency of crosvm and should not be built in the same phase as crosvm. Doing so was harmless before the recent rustc/cargo changes, which seem to be triggering some kind of race condition. This change works around the bug. CQ-DEPEND=CL:1336738 TEST=cargo test --release BUG=chromium:900366 Change-Id: I01048128b20cf06580e809f6701688ab72e7756d Reviewed-on: https://chromium-review.googlesource.com/1336737 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* enable integer overflow checks on release profileZach Reizner2018-10-16
| | | | | | | | | | | | | | This will harden crosvm against potential integer overflow leading to unsafe behavior in unsafe blocks. TEST=cargo test --release BUG=None Change-Id: Ie750906d04c6ef8cb9400b976827c2abeab2ab56 Reviewed-on: https://chromium-review.googlesource.com/1282064 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* crosvm: add msg_sock.Jingkui Wang2018-10-09
| | | | | | | | | | | | | | MsgSock wraps UnixDatagram and provides simple macro to define Messages that could be send through sock easily. TEST=cargo test BUG=None Change-Id: I296fabc41893ad6a3ec42ef82dd29c3b752be8b8 Reviewed-on: https://chromium-review.googlesource.com/1255548 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* 9s: Server binary for the 9p file systemChirantan Ekbote2018-08-08
| | | | | | | | | | | | | | | | | | Add the 9s crate, which provides an executable that can serve the 9p file system protocol. It initially only supports connections over vsock but can easily be extended to support network and unix domain socket based connections. BUG=chromium:703939 TEST=Run the server, have maitred connect to it over vsock, mount the 9p file system in the guest kernel, share it with the penguin container, and run `bonnie++ -r 256 -s 512` CQ-DEPEND=CL:1121550, CL:1166446 Change-Id: Ia0c72bcf29188bba4c07b6c0a2dd5a83d02339b5 Signed-off-by: Chirantan Ekbote <chirantan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1112870 Reviewed-by: Dylan Reid <dgreid@chromium.org>