summary refs log tree commit diff
path: root/kvm_sys
Commit message (Collapse)AuthorAge
* crosvm: add support for immediate exitMatt Delco2019-10-23
| | | | | | | | | | | | | Adds ability to set the immediate exit bit and ask kvm if it's supported. BUG=None TEST=local compile and test Change-Id: I5c58a5920ebda13267efeb079c0bb671f83464ee Signed-off-by: Matt Delco <delco@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1847857 Reviewed-by: Zach Reizner <zachr@chromium.org>
* 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>
* clippy: Switch to tool attributes for suppressing lintsDavid Tolnay2019-04-15
| | | | | | | | | | | | | | | | | | | | | | | Tool attributes were stabilized in Rust 1.31: https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html#tool-lints Before: #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment)] After: #[allow(clippy::cast_ptr_alignment)] TEST=cargo check --all-features Change-Id: If2f1511f6231d60578b5e0d5bd4210a68eb08caf Reviewed-on: https://chromium-review.googlesource.com/1566651 Commit-Ready: David Tolnay <dtolnay@chromium.org> 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>
* edition: Remove extern crate linesDavid Tolnay2019-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Rust 2018 edition, `extern crate` is no longer required for importing from other crates. Instead of writing: extern crate dep; use dep::Thing; we write: use dep::Thing; In this approach, macros are imported individually from the declaring crate rather than through #[macro_use]. Before: #[macro_use] extern crate sys_util; After: use sys_util::{debug, error}; The only place that `extern crate` continues to be required is in importing the compiler's proc_macro API into a procedural macro crate. This will hopefully be fixed in a future Rust release. extern crate proc_macro; TEST=cargo check TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu TEST=local kokoro Change-Id: I0b43768c0d81f2a250b1959fb97ba35cbac56293 Reviewed-on: https://chromium-review.googlesource.com/1565302 Commit-Ready: David Tolnay <dtolnay@chromium.org> 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>
* edition: Fill in macro importsDavid Tolnay2019-04-15
| | | | | | | | | | | | | | | | | | | | Macros were previously imported through `#[macro_use] extern crate`, which is basically a glob import of all macros from the crate. As of 2018 edition of Rust, `extern crate` is no longer required and macros are imported individually like any other item from a dependency. This CL fills in all the appropriate macro imports that will allow us to remove our use of `extern crate` in a subsequent CL. TEST=cargo check --all-features --tests TEST=kokoro Change-Id: If2ec08b06b743abf5f62677c6a9927c3d5d90a54 Reviewed-on: https://chromium-review.googlesource.com/1565546 Commit-Ready: David Tolnay <dtolnay@chromium.org> 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>
* edition: Update kvm and kvm_sys crates 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: If4140face2c291862f73a3bc095cbf968a442095 Reviewed-on: https://chromium-review.googlesource.com/1519699 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>
* edition: Update absolute paths to 2018 styleDavid Tolnay2019-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | This is an easy step toward adopting 2018 edition eventually, and will make any future CL that sets `edition = "2018"` this much smaller. The module system changes in Rust 2018 are described here: https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html Generated by running: cargo fix --edition --all in each workspace, followed by bin/fmt. TEST=cargo check TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu Change-Id: I000ab5e69d69aa222c272fae899464bbaf65f6d8 Reviewed-on: https://chromium-review.googlesource.com/1513054 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>
* lint: Resolve the easier clippy lintsDavid Tolnay2018-12-03
| | | | | | | | | | | | | | | | | | | | Hopefully the changes are self-explanatory and uncontroversial. This eliminates much of the noise from `cargo clippy` and, for my purposes, gives me a reasonable way to use it as a tool when writing and reviewing code. Here is the Clippy invocation I was using: cargo +nightly clippy -- -W clippy::correctness -A renamed_and_removed_lints -Aclippy::{blacklisted_name,borrowed_box,cast_lossless,cast_ptr_alignment,enum_variant_names,identity_op,if_same_then_else,mut_from_ref,needless_pass_by_value,new_without_default,new_without_default_derive,or_fun_call,ptr_arg,should_implement_trait,single_match,too_many_arguments,trivially_copy_pass_by_ref,unreadable_literal,unsafe_vector_initialization,useless_transmute} TEST=cargo check --features wl-dmabuf,gpu,usb-emulation TEST=boot linux Change-Id: I55eb1b4a72beb2f762480e3333a921909314a0a2 Reviewed-on: https://chromium-review.googlesource.com/1356911 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* cargo fmt all source codeZach Reizner2018-10-09
| | | | | | | | | | | | | | Now that cargo fmt has landed, run it over everything at once to bring rust source to the standard formatting. TEST=cargo test BUG=None Change-Id: Ic95a48725e5a40dcbd33ba6d5aef2bd01e91865b Reviewed-on: https://chromium-review.googlesource.com/1259287 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>
* kvm: fix definition of KVM_SET_XCRS ioctlDmitry Torokhov2018-05-16
| | | | | | | | | | | | The ioctl in question is defined as write ioctl, not read/write. BUG=b:79692549 TEST=cargo test -p kvm Change-Id: I6683291d38f170713b949a56251c970038f2652b Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1060612 Reviewed-by: Zach Reizner <zachr@chromium.org>
* crosvm: aarch64 guest supportSonny Rao2018-04-03
| | | | | | | | | | | | | | | | | | | - removes old ARMv7a (32-bit) bindings as we're only supporting aarch64 guests right now - switches both ARMv7 and aarch64 builds to use aarch64 kvm bindings - adds support for ARMv8 Linux guest with dynamic flattened-device-tree CQ-DEPEND=990894 BUG=chromium:797868 TEST=./build_test passes on all architectures TEST=crosvm runs on caroline TEST=crosvm runs on kevin built with USE="kvm_host" Change-Id: I7fc4fc4017ed87fd23a1bc50e3ebb05377040006 Reviewed-on: https://chromium-review.googlesource.com/969987 Commit-Ready: Sonny Rao <sonnyrao@chromium.org> Tested-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* add plugin support for configuring CPUIDZach Reizner2018-02-12
| | | | | | | | | | | | | | The guest expects to be able to read the CPUID, so the plugin process needs to specify what the CPUID for each VCPU will have. TEST=cargo test --features plugin; ./build_test BUG=chromium:800626 Change-Id: I9258540ab2501126c3d8cadbd09b7fc01d19f7a9 Reviewed-on: https://chromium-review.googlesource.com/906006 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* kvm: add set_irq_routing methodZach Reizner2018-01-25
| | | | | | | | | | | | | | | This is used by the plugin process API, which may register an IRQ routing table. TEST=./build_test BUG=chromium:800626 Change-Id: If40965e8abfb0c9074c90b5fc77f9042f06499e0 Reviewed-on: https://chromium-review.googlesource.com/857910 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* kvm_sys: update bindings and add aarch64 bindingsSonny Rao2018-01-02
| | | | | | | | | | | | | | | | | | Re-generated the bindings for x86_64 and arm which now use union types so a little bit of code in the library also changed, and adds bindings for aarch64 which are required to run an aarch64 guest. Also, I manually fixed the zero-length array cases where rust bindgen doesn't properly align the structs. See rust bindgen bug 684. BUG=chromium:797868 TEST=run crosvm on x86_64, ensure networking works TEST=./build_test passes on x86 Change-Id: Iab2193a8f1d4c68bd3346ae683c74bbf16fe45d4 Signed-off-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/845519 Reviewed-by: Zach Reizner <zachr@chromium.org>
* fix compiler errors and warningsZach Reizner2017-08-30
| | | | | | | | | | | | | | | | | | | | | | Problems that were fixed: - gcc crate deprecated compile_library - `cargo test -p kvm` had a compile error - `cargo test -p kvm_sys` failed to link with libc - main.rs failed to include `getpid` and had dead code - fork.rs had a warning in `cargo test -p sys_util` - unused const in serial.rs BUG=None TEST=sudo cargo test -p data_model -p io_jail -p kernel_loader -p kvm \ -p kvm_sys -p net_sys -p net_util -p syscall_defines -p sys_util \ -p virtio_sys -p vhost -p x86_64 -p crosvm Change-Id: Iaf0389013fbcdfbfaa7cf37ea1a1fc045f480ada Reviewed-on: https://chromium-review.googlesource.com/642509 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Jason Clinton <jclinton@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
* sys_util: add ioctl moduleStephen Barber2017-07-13
| | | | | | | | | | | | | | | | Factor out common ioctl wrappers and macros into their own module. Signed-off-by: Stephen Barber <smbarber@chromium.org> BUG=none TEST=cargo test Change-Id: Ibede8a853f5cc6c6d62565930f312b11024cc5b5 Reviewed-on: https://chromium-review.googlesource.com/566540 Commit-Ready: Stephen Barber <smbarber@chromium.org> Tested-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* kvm-sys: rename to kvm_sysDylan Reid2017-05-02
underscores are better Change-Id: Ida36de419f6ecf704f40d868cf7296d4d4fc41e6 Reviewed-on: https://chromium-review.googlesource.com/492666 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>