summary refs log tree commit diff
path: root/Cargo.lock
Commit message (Collapse)AuthorAge
* 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>
* gpu_display: add X11 input bindings.Noah Gold2020-01-03
| | | | | | | | | | | | | | | | Adds bindings to the X11 display window to capture keyboard & mouse input & send it to the guest via an EventDevice. Original implementation by zachr@chromium.org. BUG=chromium:1023975 TEST=None Change-Id: I33156a8ca0b8c610a2080e3b6891cca2a865734b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1971121 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Noah Gold <nkgold@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* crosvm: move vec_with_array_field to data_modelGurchetan Singh2019-12-11
| | | | | | | | | | | | | | Move it to the newly created flexible array file. BUG=chromium:892806 TEST=compiles Change-Id: I6c423a885cec17e376b0da87a4adbd17c71ff6f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1325510 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* 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>
* Cargo.lock: add sync to libcras dependenciesDaniel Verkamp2019-11-23
| | | | | | | | | | | | | | | | | | | libcras now depends on crosvm's sync crate; add it to Cargo.lock to satsify non-portage builds of crosvm with cargo (otherwise cargo updates Cargo.lock itself). The dependency was added here: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/1871758 The pinned commit for adhd used in the Docker build is also upgraded to the current master so that it matches. BUG=None TEST=`cargo build; git diff` and verify Cargo.lock was not modified Change-Id: I53526ae2448b95c287528596099a804ec28a16d1 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1924784
* io_jail: add additional apisMatt Delco2019-11-16
| | | | | | | | | | | | | | | | | | This change adds additional APIs that are present in the libminijail header file but not in the rust thunk. In particular it adds the API that allows pre-compiled bpf files to be used as a policy file. The native API lacks an API to specify a filename (it only provides an API to provide the contents of the file). BUG=None TEST=Local run of build_test to confirm that both .bpf and .policy files work in a subsequent change. Change-Id: I15510ffa857b501512f3f9905882545f407bcd78 Signed-off-by: Matt Delco <delco@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1914415 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* net_util: impl FileReadWriteVolatile for TapStephen Barber2019-11-05
| | | | | | | | | | | | | BUG=chromium:753630 TEST=cargo build Change-Id: I55e0d47c4afcb1bf01f4d7f738bda09022956898 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1881418 Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Stephen Barber <smbarber@chromium.org> Commit-Queue: Stephen Barber <smbarber@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
* devices: fs: Implement virtio-fs serverChirantan Ekbote2019-10-27
| | | | | | | | | | | | | | | | Add a `Server` type that links the FUSE protocol with the virtio transport. It parses messages sent on the virtio queue and then calls the appropriate method of the `Filesystem` trait. BUG=b:136128319 TEST=`tast run vm.VirtioFs` Change-Id: I7d6fb521f6c620efe1bdb4fa0fa8fb8c42a82f45 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1757242 Auto-Submit: Chirantan Ekbote <chirantan@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org> Tested-by: Chirantan Ekbote <chirantan@chromium.org>
* Cargo.lock: update rust-protobuf to 2.8.1Daniel Verkamp2019-10-22
| | | | | | | | | | | | | | | | | | | | | | This is the latest version of rust-protobuf at the moment, and it includes fixes so that the generated code no longer triggers rustc warnings about missing `dyn` specifiers on trait objects. Note that Cargo.lock is unused in normal Chrome OS builds; this only affects other environments like running `cargo build` directly. This change was generated using: cargo update -p protobuf -p protoc-rust --precise 2.8.1 BUG=chromium:1015571 TEST=cargo check --features=plugin Change-Id: Id1ea387be70ef81ae62b6d39f99d85d48c938d58 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1869552 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@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>
* devices: fs: Add fuse constants and struct definitionsChirantan Ekbote2019-10-16
| | | | | | | | | | | | | | | | | Add the constants and struct definitions from the kernel fuse interface. These bindings are manually generated from `include/uapi/linux/fuse.h` in the kernel repo. BUG=b:136128319 TEST=none; these aren't used anywhere yet Change-Id: I03d11bc55eca6b8269f1e63a1187ef458ee16f28 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1705655 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
* 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>
* vfio: Implement PciDevice Trait for vfio deviceXiong Zhang2019-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | According to kernel Documents/vfio.txt and Documents/vfio-mediated-device.txt,user pass host assigned device or mdev to crosvm through --vfio parameter, vfio module open this device and get this device's information. Implement PciDevice trait on this device, then vfio_pci module could trap guest pci cfg r/w and mmio r/w, and transfer this operation into kernel vfio. Currently the relationship of vfio container:group:device are 1:1:1, in the future it could extend to 1:m:n. BUG=chromium:992270 TEST=none Change-Id: I8006ef65022d56197eaeb464811a59db2ce54b9a Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1580458 Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@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>
* devices: pci: replace byteorder with from_le_bytes()Daniel Verkamp2019-08-26
| | | | | | | | | | | | | | Use the standardized from_le_bytes() functions rather than the byteorder crate. BUG=None TEST=./build_test Change-Id: I07a062bf63c5d3ae1e25f403713bf9a1677e8cba Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1761155 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* x86_64: replace byteorder with {to,from}_le_bytes()Daniel Verkamp2019-08-26
| | | | | | | | | | | BUG=None TEST=./build_test Change-Id: Ic7873c6b70d9a0e9f34b7a2977845552144934ea Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1761152 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* qcow: replace byteorder with {to,from}_be_bytes()Daniel Verkamp2019-08-26
| | | | | | | | | | | | | | | | Use the standard byte order conversion functions rather than the byteorder crate. BUG=None TEST=./build_test TEST=cargo build -p qcow_utils TEST=cargo test -p qcow Change-Id: I9ff7368cc54c539db1996f81d4220cabf7e6e301 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1761151 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* arch: fdt: replace byteorder with to_be_bytes()Daniel Verkamp2019-08-26
| | | | | | | | | | | | | | Use the standard library u32 and u64 byteorder conversion functions (now that they are stabilized) rather than the byteorder crate. BUG=None TEST=./build_test Change-Id: I7d2b523c2df5f7cdf1cd7d5b760ede8e827e0517 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1761150 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* tempfile: Unify the two tempdir implementationsDavid Tolnay2019-07-11
| | | | | | | | | | | | | | | | | | | | | | Looks like we ended up with two totally different tempdir implementations: one from CL:520706 and the other from CL:1409705. This CL consolidates them into one implementation. BUG=chromium:974059 TEST=tempfile: cargo test TEST=crosvm: cargo check --all-features TEST=devices: cargo check --tests TEST=sys_util: cargo check --tests TEST=local kokoro TEST=./build_test Cq-Depend: chromium:1574668 Change-Id: Id70e963c9986ed2fc5f160819c4a7f9f16092b3b Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1573227 Tested-by: kokoro <noreply+kokoro@google.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
* tempfile: reimplement using libc::mkdtempDaniel Verkamp2019-07-03
| | | | | | | | | | | | | | | | | | POSIX provides a standard mkdtemp() function to securely create a temporary directory; use it rather than reinventing the wheel. This also drops the dependency of tempfile on rand_ish, which will allow easier use of the tempfile implementation outside of crosvm. BUG=chromium:974059 TEST=cargo test -p tempfile Change-Id: I34a226b046dc6f272106988a78d121a24a377f44 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1659971 Tested-by: kokoro <noreply+kokoro@google.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* eliminate mut from non-mut referencesZach Reizner2019-06-04
| | | | | | | | | | | | | | | | | | | | | | | This manifested itself in a couple places that were turning shared memory buffers into slices for the purposes of passing these slices to `Read` and `Write` trait methods. However, this required the removal of the methods that took `Read` and `Write` instances. This was a convenient interface but impossible to implement safely because making slices from raw pointers without enforcing safety guarantees causes undefined behaviour in Rust. It turns out lots of code in crosvm was using these interfaces indirectly, which explains why this CL touches so much. TEST=crosvm run BUG=chromium:938767 Change-Id: I4ff40c98da6ed08a4a42f4c31f0717f81b1c5863 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1636685 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Zach Reizner <zachr@chromium.org>
* Add cargo-generated Cargo.lock comment blockDaniel Verkamp2019-04-19
| | | | | | | | | | | | | | | | | | Cargo 1.34.0 insists on adding a header comment to Cargo.lock on each invocation to indicate that the file is not meant to be edited by hand. Add the header to our checked-in copy of Cargo.lock so it doesn't continually dirty the working copy. BUG=None TEST=cargo build Change-Id: I2ef10bfd997a9a1f7d4928467daa830d227cf165 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1568829 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>
* 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: Compile protos for trunks daemonDavid Tolnay2019-04-12
| | | | | | | | | | | | | | | | | | | | | | | The TPM device will need these protos to communicate TPM commands to the Trunks daemon and receive TPM responses. BUG=chromium:911799 TEST=cargo check TEST=cargo check --features tpm TEST=FEATURES=test emerge-nami crosvm TEST=FEATURES=test USE=crosvm-tpm emerge-nami crosvm TEST=local kokoro CQ-DEPEND=CL:1553610 CQ-DEPEND=CL:1553971 Change-Id: I1a67a7b4a3714236b20a790068ca19129446f71c Reviewed-on: https://chromium-review.googlesource.com/1554982 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> Reviewed-by: Zach Reizner <zachr@chromium.org> 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>
* Revert "qcow_utils: Add tests"Dylan Reid2019-03-28
| | | | | | | | | | | | | | | This test breaks the asan builders BUG=945423 This reverts commit fbbcf7ad1457b5daff1be151793441006f186683. Signed-off-by: Dylan Reid <dgreid@chromium.org> Change-Id: I4db9720118ea6e3002045fad997774ab84d3b59a Reviewed-on: https://chromium-review.googlesource.com/1540339 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
* Move split_irqchip_common to devices/.Miriam Zimmerman2019-03-20
| | | | | | | | | | | | | | | Previously, code in devices/ couldn't use split_irqchip_common, since x86_64/ already has a dependency on devices/. TEST=Built. BUG=chromium:908689 Change-Id: I481514ae6bbd68e47feecc6f364ca8f4fd798e67 Reviewed-on: https://chromium-review.googlesource.com/1526762 Commit-Ready: Miriam Zimmerman <mutexlox@chromium.org> Tested-by: Miriam Zimmerman <mutexlox@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>
* qcow_utils: Add testsDylan Reid2019-03-16
| | | | | | | | | | | Add basic tests that qcow_utils compiles. Change-Id: I433dc7cb55d42997ba060f9bd989ca3b5c8b0045 Reviewed-on: https://chromium-review.googlesource.com/895189 Commit-Ready: Dylan Reid <dgreid@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* usb: add usb hub, transfer and usb backend interfaceJingkui Wang2019-03-16
| | | | | | | | | | | | | | | Those are bridges between xhci and backend. CQ-DEPEND=CL:1510818 BUG=chromium:831850 TEST=cargo test Change-Id: I04feab449d48b0c908aeebfda08d1869239cbe6f Reviewed-on: https://chromium-review.googlesource.com/1510819 Commit-Ready: Jingkui Wang <jkwang@google.com> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* 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>
* Add common types and constants for split IRQ chip.Miriam Zimmerman2019-03-13
| | | | | | | | | | | | | | | These will come in handy for reducing code duplication and simplifying PIC/IOAPIC/PIT/interrupt routing code. TEST=Built BUG=chromium:908689 Change-Id: I696e9f51231a8e39640f1fd0af055b48048bc134 Reviewed-on: https://chromium-review.googlesource.com/1518557 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: David Tolnay <dtolnay@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>
* crosvm: x86_64 guest support for android device-treeTristan Muntsinger2019-01-28
| | | | | | | | | | | | | | | | This device tree is derived from the Android fstab file which is provided via command line flag. BUG=chromium:922737 TEST=None CQ-DEPEND=CL:1415390 CQ-DEPEND=CL:1415270 Change-Id: Idd007c844f84cab3ff37be16a718f14e5f630312 Reviewed-on: https://chromium-review.googlesource.com/1370058 Commit-Ready: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> 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>
* plugin: allow retrieving and setting VM clockDmitry Torokhov2019-01-22
| | | | | | | | | | | | | Add crossvm plugin API to allow reading and setting guest clock. BUG=b:122878975 TEST=cargo test -p kvm; cargo test --features=plugin Change-Id: I3fd656c06b0e7e43ac88a337ac5d0caec8c59dba Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1419373 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@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>
* resources: data_model is not used, don't depend on itDylan Reid2019-01-11
| | | | | | | | | Signed-off-by: Dylan Reid <dgreid@chromium.org> Change-Id: I7bbef003a77aae7303940ef183de14950e47453b Reviewed-on: https://chromium-review.googlesource.com/1403893 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* usb: add xhci abi.Jingkui Wang2018-12-25
| | | | | | | | | | | | | | Add xhci abi structs. BUG=chromium:831850 TEST=cargo test Change-Id: I80cf96a2bd52c1db0ebd7e6bdb90b45a5b2d03bd Reviewed-on: https://chromium-review.googlesource.com/1144264 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* devices: allow virtio-wayland to use virtgpu resourcesZach Reizner2018-12-11
| | | | | | | | | | | | | | | | This change uses the resource bridge between virtio-gpu and virtio-cpu to send resources over the host wayland connection that originated from the virtio-gpu device. This will help support gpu accelerated wayland surfaces. BUG=chromium:875998 TEST=wayland-simple-egl Change-Id: I3340ecef438779be5cb3643b2de8bb8c33097d75 Reviewed-on: https://chromium-review.googlesource.com/1182793 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* poll_token: Use syn to simplify poll token deriveDavid Tolnay2018-12-09
| | | | | | | | | | | | | | | This CL removes 300 lines of parsing code and 200 lines of tests of parsing code by using the parsers provided by Syn, which we already use in implementing our other custom derives. TEST=cargo test poll_token_derive TEST=cargo check crosvm Change-Id: Ie2743b1bbb1b374326f9845fc37fc578b178c53d Reviewed-on: https://chromium-review.googlesource.com/1365112 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* assertions: Use compile-time assertion macroDavid Tolnay2018-12-09
| | | | | | | | | | | | | | | This depends on the `assertions` crate added in CL:1366819. `const_assert!(boolean expression)` is a compile-time assertion that fails to compile if the expression is false. TEST=`cargo check` each of the modified crates Change-Id: I559884baf2275b1b506619693cd100a4ffc8adcd Reviewed-on: https://chromium-review.googlesource.com/1368364 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>