summary refs log tree commit diff
path: root/protos
Commit message (Collapse)AuthorAge
* crosvm: add handling for hyperv exitsMatt Delco2020-03-05
| | | | | | | | | | | | | | | | | When features for Hyper-V are enabled there's a another type of exit that can be triggered. This change attempts to add support for those types of exits. BUG=b:150151095 TEST=ran build_test Change-Id: I3131a2c8d9c610576ac177dbfe82f78e8d5dbfb1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2073254 Reviewed-by: Matt Delco <delco@chromium.org> Tested-by: Matt Delco <delco@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Matt Delco <delco@chromium.org> Auto-Submit: Matt Delco <delco@chromium.org>
* crosvm: add ability to enable caps on vcpuMatt Delco2020-02-20
| | | | | | | | | | | | | | | | | This change primarily adds functionality to allow kvm features to be enabled on a vcpu (most of the current infra only supporst the ioctl for the vm fd). BUG=b:144746965 TEST=ran 'build_test' and verified that the added tests passed. Change-Id: I30c00b6f462377c21d477602ceba5853df953b37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2055883 Tested-by: Matt Delco <delco@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Matt Delco <delco@chromium.org>
* crosvm: support kvm's hyper-v cpuid ioctlMatt Delco2020-02-20
| | | | | | | | | | | | | | | | | | | | | Kvm can emulate the hyper-v paravirt interface. Newer versions of kvm can advertise the features they support via an ioctl() that reports the cpuid leafs for this interface. This change adds some support for the ioctl() and plumbs it through the plugin interface so that plugins can determine the level of support available in kvm. BUG=b:144746965 TEST=Ran build_test on kernel that supports the ioctl. Added temporary code to print the cpuid leafs and verified that the output is as expected. Instrumented failure as expected from older kernels and verified that results still passed. Change-Id: I6cd7dade1793e4edb52b331d5b960685541f7ba3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2037919 Tested-by: Matt Delco <delco@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Matt Delco <delco@chromium.org>
* crosvm: add plugin API for async writesMatt Delco2019-11-06
| | | | | | | | | | | | | | | | | | | | | | | A plugin might care to be immediately notified when a write is made to a port, but it doesn't care to have the VM stopped while the plugin calls back to resume the VM. Unfortunately this means that multiple messages can be queued up in the pipe and read() together by the plugin API. Protobuf's parsing function doesn't report how many bytes it read, so I've resorted to having crosvm prefix every message with a length and then have the plugin lib parse this number. Impact on performance has not been measured. BUG=b:143294496 TEST=Local build and run of build_test. Verified that new unit test was executed, exercised the case where multiple msgs are received together, and completed successfully. Change-Id: If6ef463e7b4d2e688e649f832a764fa644bf2d36 Signed-off-by: Matt Delco <delco@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1896376 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Stephen Barber <smbarber@chromium.org>
* crosvm: pre-cache answers to plugin get callsMatt Delco2019-10-31
| | | | | | | | | | | | | | | | This change tries to improve the performance of a plugin-based VM by adding a hint API that allows crosvm to proactively push cpu state to the plugin when certain ports for hypercalls are accessed by the VM. BUG=None TEST=build and run. See performance increase significantly. Change-Id: I71af24ebc034095ffea42eedb9ffda0afc719cd6 Signed-off-by: Matt Delco <delco@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1873005 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* crosvm: defer IPC on set callsMatt Delco2019-10-23
| | | | | | | | | | | | | | If a plugin makes a set call on vcpu registers then we can improve performance by deferring the IPC and instead conbining the request with the next resume call. BUG=None TEST=build and run. Change-Id: I4eb54a3f6eb30c98971aa2f099e3ea5899767eed Signed-off-by: Matt Delco <delco@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1825262 Reviewed-by: Zach Reizner <zachr@chromium.org>
* crosvm: delete resume response from protobufMatt Delco2019-10-23
| | | | | | | | | | | | | | | The resume response was deleted in a earlier change. This change removes the message type from the proto file and adjusts crosvm so it can still build after this removal. BUG=None TEST=build and run. Change-Id: I27d36a51b1e7eb59258d23da38199b86d7cb3659 Signed-off-by: Matt Delco <delco@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1825260 Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@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 license blurb to all filesStephen Barber2019-04-24
| | | | | | | | | | | | | | A few files were missing license blurbs at the top, so update them all to include them. BUG=none TEST=none Change-Id: Ida101be2e5c255b8cffeb15f5b93f63bfd1b130b Reviewed-on: https://chromium-review.googlesource.com/1577900 Commit-Ready: Stephen Barber <smbarber@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* crosvm: use pipe instead of socket for vcpu communicationMatt Delco2019-04-24
| | | | | | | | | | | | | | | | | | | | | Pipes have better performance than sockets, so switch the vcpu communication over to pipes. The vm communication channels will continue to use sockets since that communication isn't performance critical (and those messages sometimes exchange file descriptors, and that functionality requires sockets). TEST=local compile and confirmed that my diagnostic plugin is still happy. The time it takes to run my benchmark plugin has decreased by 20%. This combined with my prior commit results in a net wall-clock time reduction of 32%. BUG=None Change-Id: I44c198d62a3bbe3b539ff6ac79707d02488876e3 Signed-off-by: Matt Delco <delco@google.com> Reviewed-on: https://chromium-review.googlesource.com/1572873 Commit-Ready: Matt Delco <delco@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* clippy: Suppress warning from protoc_rust generated codeDavid Tolnay2019-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Protoc_rust emits this into every file it generates: #![cfg_attr(feature = "cargo-clippy", allow(clippy))] which is the old style of tool attribute. It is deprecated in favor of actual tool attributes that stabilized in rust 1.31. #![allow(clippy::all)] Without this PR, the warning when running bin/clippy looks like: warning: lint name `clippy` is deprecated and may not have an effect in the future. --> /chromiumos/src/platform/crosvm/target/debug/build/protos/out/trunks/interface.rs:6:10 | 6 | #![cfg_attr(feature = "cargo-clippy", allow(clippy))] | ^^^^^^ | = note: #[warn(renamed_and_removed_lints)] on by default TEST=bin/clippy Change-Id: I1a484379a8f53d76d3667590cd8458588492d2b1 Reviewed-on: https://chromium-review.googlesource.com/1567849 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>
* 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>