summary refs log tree commit diff
path: root/kvm/src
Commit message (Collapse)AuthorAge
...
* kvm: plumb accessors for VCPU XCR stateDmitry Torokhov2018-05-16
| | | | | | | | | | | | | Plumb in KVM_GET_XCRS and KVM_SET_XCRS to allow saving and restoring extended control registers of VCPUs. BUG=b:79692549 TEST=cargo test -p kvm Change-Id: I77dcb2ac488bf73b7503f49875d91e7c0cb21003 Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1060613 Reviewed-by: Zach Reizner <zachr@chromium.org>
* crosvm: aarch64: get kernel's preferred target type for vcpusSonny Rao2018-04-03
| | | | | | | | | | | | | | | | | | | | This fixes an issue on kevin where if we start on a little core, the kernel doesn't like the generic ARMv8 target cpu type for some reason. To fix this we must query the preferred type from the vm device first and supply that to the vcpu init ioctl. We need to change the signature of the configure_vcpu method to pass in the vm object even though we aren't using it on x86. BUG=chromium:797868 TEST=./build_test passes on all architectures TEST=crosvm runs on kevin Change-Id: I460cb9db62a8805bb88f838956aa4f1c69183961 Reviewed-on: https://chromium-review.googlesource.com/982996 Commit-Ready: Sonny Rao <sonnyrao@chromium.org> Tested-by: Sonny Rao <sonnyrao@chromium.org> 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>
* kvm: fix fetching irqchip state for PICs other than the first oneDmitry Torokhov2018-03-30
| | | | | | | | | | | | | | | | The KVM API to fetch interrupt controller state expects caller to supply number (id) of the interrupt controller number in which state the caller is interested. To allow crosvm to fetch the correct state and to improve type safety we split the API into one that handles the PIC (primary and secondary) and the one that handles IOAPIC. BUG=b:76083711 TEST=cargo test -p kvm Change-Id: Ia45b51cb218072a275c244af2de1b4a73a1d3352 Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/986510 Reviewed-by: Zach Reizner <zachr@chromium.org>
* kvm: plumb accessors for VCPU MP stateDmitry Torokhov2018-03-29
| | | | | | | | | | | | | Plumb in KVM_GET_MP_STATE and KVM_SET_MP_STATE to allow saving and restoring "multiprocessing state" of VCPUs. BUG=b:76083711 TEST=cargo test -p kvm Change-Id: Ia6e98a09c12dcc859196908f865fac57d48b2ddd Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/982372 Reviewed-by: Dylan Reid <dgreid@chromium.org>
* crosvm: fix documentation for SystemEventSonny Rao2018-03-29
| | | | | | | | | | | | | | The documentation for the SystemEvent exit reason needs to specify the positions for the two fields. BUG=chromium:797868 TEST=./build_test passes on all architectures Change-Id: Ida98ba4a6b383a1c10fa48356decc1c5264999ec Reviewed-on: https://chromium-review.googlesource.com/986721 Commit-Ready: Sonny Rao <sonnyrao@chromium.org> Tested-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* crosvm: support VM shutdown via SystemEventSonny Rao2018-03-29
| | | | | | | | | | | | | | | | | ARM systems don't have an exit event fd like x86, instead one of the Vcpus will exit with the SystemEvent reason and put a code into the kvm run union of either shutdown, reboot, or crash. We currently don't handle reboot or crash differently but can do so in the future. BUG=chromium:797868 TEST=./build_test passes on all architectures TEST=crosvm runs on kevin - manually test shutdown via maitred Change-Id: I455cbe1ac653f61a1e9eae1ce22922d14cff4e3c Reviewed-on: https://chromium-review.googlesource.com/982531 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* kvm: plumb accessors for IRQCHIP and PIT stateDmitry Torokhov2018-03-27
| | | | | | | | | | | | | | Plumb in KVM_GET_IRQCHIP/KVM_SET_IRQCHIP and KVM_GET_PIT2/KVM_SET_PIT2 to allow saving and restoring irqchip and PIT state. BUG=b:76083711 TEST=cargo test -p kvm Change-Id: I45a0beb3315f67af7cd9deee80dce0ca25f05001 Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/981592 Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* kvm: silence a warning on non-x86 buildsSonny Rao2018-03-12
| | | | | | | | | | | | | | | We don't use this particular constant on non-x86 builds, so let's leave it out if when it's not needed. BUG=chromium:797868 TEST=build_test passes TEST=crosvm runs on caroline Change-Id: Ic752f9ae33d577d78c7df282e9803936aa181504 Reviewed-on: https://chromium-review.googlesource.com/952166 Commit-Ready: Sonny Rao <sonnyrao@chromium.org> Tested-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* kvm: add tests for get_supported_cpuid() and get_emulated_cpuid()Dmitry Torokhov2018-03-08
| | | | | | | | | | TEST=cargo test -p kvm BUG=None Change-Id: I2af245cb94d68faf091bf6788842c1932240df3d Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/947320 Reviewed-by: Zach Reizner <zachr@chromium.org>
* kvm: fix invocation of KVM_SET_SIGNAL_MASK ioctlDmitry Torokhov2018-03-08
| | | | | | | | | | | | | | | | Linux kernel expects size of sigset passed in through KVM_SET_SIGNAL_MASK ioctl to be exactly 8, but Rust's sigset size is 128 bytes, so we can not use sizeof to set up the size. Also let's add test set_signal_mask(). TEST=cargo test --features plugin; cargo test -p kvm; ./build_test BUG=chromium:800626 Change-Id: Ica757ad63d6754d5c8008ba1735982c7ca026f33 Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/944849 Reviewed-by: Zach Reizner <zachr@chromium.org>
* kvm: fix a couple of typos in commentsDmitry Torokhov2018-02-28
| | | | | | | | | | BUG=None TEST=cargo test --features plugin; cargo test -p kvm Change-Id: If3408984ebb4f9212aaaae6084353a411a7f902b Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/938845 Reviewed-by: Zach Reizner <zachr@chromium.org>
* kvm: plumb in KVM_GET_EMULATED_CPUIDDmitry Torokhov2018-02-27
| | | | | | | | | | | | | | This plumbs in KVM_GET_EMULATED_CPUID to allow userspace to figure out whether a certain feature(s) can be used or whether they are too expensive. TEST=cargo test --features plugin; cargo test -p kvm BUG=chromium:800626 Change-Id: I914415a311f40d079b1703efb5129fd91b0d24ad Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/933243 Reviewed-by: Zach Reizner <zachr@chromium.org>
* kvm: do not use negative error coded for errno-based errorsDmitry Torokhov2018-02-27
| | | | | | | | | | | | | | | Errors derived from sysem errors delivered via -1 return code/errno should use positive error codes, not negative, in order for them to be recognized by other components. I.e. we should use errno::Error::new(EINVAL) and not -EINVAL. TEST=cargo test --features plugin; cargo test -p kvm BUG=None Change-Id: Ibe91745c36765c64aeab2f6aae5cd0ca8f243a42 Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/939868 Reviewed-by: Zach Reizner <zachr@chromium.org>
* kvm: do not pass max number of cpuid entries in get_supported_cpuid()Dmitry Torokhov2018-02-27
| | | | | | | | | | | | | | It does not make sense to have users of the API limit number of cpuid entries retrieved. Just have KVM select reasonable upper limit and return the true number. TEST=cargo test --features plugin; cargo test -p kvm BUG=chromium:800626 Change-Id: I8ab7e8d901bc408d17c23bfe798d89f921488673 Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/933242 Reviewed-by: Zach Reizner <zachr@chromium.org>
* kvm: plumb in KVM_SET_SIGNAL_MASK ioctlDmitry Torokhov2018-02-26
| | | | | | | | | | | | We need this ioctl to implement race-free support for kicking/pausing VCPUs. TEST=cargo test --features plugin; cargo test -p kvm; ./build_test BUG=chromium:800626 Change-Id: I5dcff54f7eb34568a8d8503e0dde86b6a36ac693 Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/932443 Reviewed-by: Zach Reizner <zachr@chromium.org>
* allow plugin to query for KVM extensionsZach Reizner2018-02-12
| | | | | | | | | | | | | | The guest may need to check for KVM extensions before blindly using them. TEST=cargo test --features plugin; cargo test -p kvm; ./build_test BUG=chromium:800626 Change-Id: If87b928753cd71adeabac4fc7732c3fce7265834 Reviewed-on: https://chromium-review.googlesource.com/906008 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* add plugin support for model specific registersZach Reizner2018-02-12
| | | | | | | | | | | | | | The MSRs are useful for booting a full operating system that requires them. TEST=cargo test --features plugin; cargo test -p kvm; ./build_test BUG=chromium:800626 Change-Id: I817fbf3e6868c85b373808bd48e568b5b2b458eb Reviewed-on: https://chromium-review.googlesource.com/897412 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* add support for accessing debug registers in the plugin processZach Reizner2018-02-12
| | | | | | | | | | | | | | The debug registers are useful to access for the plugin process in some cases. TEST=cargo test --features plugin; cargo test -p kvm; ./build_test BUG=chromium:800626 Change-Id: I8f3f6c31c6989061a43cef948cf5b4e64bd52d30 Reviewed-on: https://chromium-review.googlesource.com/896945 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* kvm: support irqfds with resample eventfdsZach Reizner2018-02-06
| | | | | | | | | | | | | | | The plugin process may require resample events to implement a device properly. TEST=cargo test -p kvm; ./build_test BUG=chromium:800626 Change-Id: I47a3336195f212c9f6c49adfaec24757803c3b7f Reviewed-on: https://chromium-review.googlesource.com/900489 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: support adding read only memory to VMsZach Reizner2018-02-06
| | | | | | | | | | | | | | | | | Read only memory is useful for triggering VM exits when the VM writes to memory while allowing reads transparently and quickly. For example, a virtual device implementation might not care if the VM reads a memory mapped device register, but a exit would be required if the VM wrote to the same register. TEST=cargo test -p kvm; ./build_test BUG=chromium:800626 Change-Id: Ic605b2cfc2a1e44941d91945f9390b9abb820040 Reviewed-on: https://chromium-review.googlesource.com/903075 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* crosvm: change GuestAddress to always be a u64Sonny Rao2018-02-01
| | | | | | | | | | | | | | | We want to be able to run 64-bit ARM kernels using a 32-bit version of crosvm, to make it more consistent use a u64 to represent GuestAddress. BUG=chromium:797868 TEST=./build_test passes on all architectures TEST=crosvm runs on caroline Change-Id: I43bf993592caf46891e3e5e05258ab70b6bf3045 Signed-off-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/896398 Reviewed-by: Dylan Reid <dgreid@chromium.org>
* kvm: fix and test set_identity_map_addrZach Reizner2018-01-30
| | | | | | | | | | | | | | The kernel expects a pointer to a physical address, not a physical address directly in the ioctl argument. TEST=cargo test -p kvm BUG=chromium:800626 Change-Id: I4a7298149373c00b5b9c634cd1dead7053d053c3 Reviewed-on: https://chromium-review.googlesource.com/893215 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Stephen Barber <smbarber@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: add dirty_log_bitmap_size helperZach Reizner2018-01-18
| | | | | | | | | | | | | | | | For the callers of get_dirty_log, they must pass in bitmap large enough to hold the log. Instead of duplicating that calculation inside the method and the caller, this change provides a public helper usable by both to calculate the bitmap's minimum size. TEST=./build_test BUG=chromium:800626 Change-Id: I349aa0dd7e78e7f9ea3d35ba0acba8088fd77a4e Reviewed-on: https://chromium-review.googlesource.com/857909 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* kvm: add ioeventfd and irqfd unregister supportZach Reizner2018-01-18
| | | | | | | | | | | | | | This is needed to support the plugin API, which might unregister such eventfds. BUG=chromium:800626 TEST=./build_test Change-Id: Ic4e74ffd4b2374868644d1f6598509aba741ce00 Reviewed-on: https://chromium-review.googlesource.com/857908 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* sys_util: replace sysconf(_SC_PAGESIZE) with a safe wrapperZach Reizner2018-01-10
| | | | | | | | | | | | | | | | There were a few places that used this to get the page size inside of an unsafe block, For convenience, this adds a safe wrapper in sys_util and replaces all extant usage of sysconf with the wrapper version. BUG=chromium:800626 TEST=./build_test Change-Id: Ic65bf72aea90eabd4158fbdcdbe25c3f13ca93ac Reviewed-on: https://chromium-review.googlesource.com/857907 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* kvm: add dirty log supportZach Reizner2018-01-03
| | | | | | | | | | | | | This add safe support for KVM's KVM_GET_DIRTY_LOG ioctl. TEST=./build_test BUG=None Change-Id: I3d0f996927844a33addd072f2bfc62361f8b7fe0 Reviewed-on: https://chromium-review.googlesource.com/848019 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* kvm: add KVM_SET_IDENTITY_MAP_ADDR ioctlZach Reizner2018-01-03
| | | | | | | | | | | BUG=None TEST=./build_test Change-Id: Ic5b479487f45949fd0888af6d670293931a6a0a7 Reviewed-on: https://chromium-review.googlesource.com/848017 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
* kvm: add KVM_GET_FPU ioctlZach Reizner2018-01-03
| | | | | | | | | | | BUG=None TEST=./build_test Change-Id: I38ee166d9c7a0340d58fb3fd7f51895ca158f8b3 Reviewed-on: https://chromium-review.googlesource.com/848016 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
* kvm: open /dev/kvm with close on execZach Reizner2018-01-03
| | | | | | | | | | | | | Without this, the KVM FD may leak to child processes. BUG=None TEST=./build_test Change-Id: Ic2f6db6c787d99865c2eefb40ad8993471ee82b2 Reviewed-on: https://chromium-review.googlesource.com/848015 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Stephen Barber <smbarber@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>
* kvm: reuse memory region slotsZach Reizner2017-10-30
| | | | | | | | | | | | | | | | | | | | There is a low limit on the maximum memory slot number imposed by the kernel. On x86_64, that limit is 509. In order to delay hitting that limit, we attempt to use the lowest unused slot number. As memory regions are removed from the VM, the slot for that region is stored in a heap so that that slot number can quickly be reused next time a memory region is added. BUG=None TEST=finish a game of gnome-mahjong using virtio-wayland Change-Id: I786c2e2b8ff239c19b3c8a18bd0f6e8f8dc2acbf Reviewed-on: https://chromium-review.googlesource.com/740102 Commit-Ready: Stephen Barber <smbarber@chromium.org> Tested-by: Stephen Barber <smbarber@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* convert println logs to logging macrosZach Reizner2017-09-29
| | | | | | | | | | | | TEST=build_test BUG=None Change-Id: Ia184e994e996eef427e1b50ce019403f4521f008 Reviewed-on: https://chromium-review.googlesource.com/693138 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* fix armv7a and aarch64 build errors and warningsZach Reizner2017-09-01
| | | | | | | | | | | | | | BUG=None TEST=cargo build --target=armv7a-cros-linux-gnueabi && cargo build --target=aarch64-cros-linux-gnu Change-Id: I954c152f3c8086e24c4809dd5aabb5043fdd63af Reviewed-on: https://chromium-review.googlesource.com/644408 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> Reviewed-by: Dylan Reid <dgreid@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>
* crosvm: refactor and expand vm control socket IPCZach Reizner2017-08-25
| | | | | | | | | | | | | | | | This CL adds VM request capabilities to the control socket. These requests include the basic exit as well as the essential ioeventfd and irqfd requests. For virtio wayland, the register/unregister device memory request was added. TEST=cargo test BUG=chromium:738638 Change-Id: I0cbf62d85a299cf454bcf6924a4e1d52d5b7183f Reviewed-on: https://chromium-review.googlesource.com/602593 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* kvm: add device memory interface to VmZach Reizner2017-08-05
| | | | | | | | | | | | | | This interface is to dynamically add and remove memory mappings to guest physical address space. TEST=cargo test BUG=chromium:738638 Change-Id: I695775289d56686ef16a1e3cf7640c97d5da2662 Reviewed-on: https://chromium-review.googlesource.com/599040 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@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>
* sys_util: Add guest_memoryDylan Reid2017-05-25
| | | | | | | | | | | | | | Add a module for accessing guest memory. This module will replace all the slices that are used to access it currently as those slices aren't valid because the memory is volatile and a volatile slice doesn't exist in rust. Modify the existing users so they no longer depend on the deprecated slice access. Change-Id: Ic0e86dacf66f68bd88ed9cc197cb14e45ada891d Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/509919
* kvm: Add reg setting to kvmDylan Reid2017-05-11
| | | | | | | | | | Add the ability to set sregs, lapic, and msrs as they are needed before running the VM. Change-Id: I5c6f01f6e5302e3c3519f8748dd292a60180b6d5 Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/498129 Reviewed-by: Zach Reizner <zachr@chromium.org>
* kvm: add kvm crate to safely use kvmZach Reizner2017-05-08
This change adds a library that makes the usage of kvm safe. Features that are in this initial patch are: - checking for kvm extensions - creating vms and vcpus - adding memory regions - accessing cpu registers - running vcpus - using kvm_run structure on kvm exit - registering ioevents and irqevents TEST=cargo test [--target=armv7a-cros-linux-gnueabi] BUG=chromium:711556 Change-Id: I1f18aad0341ef5129bc5504e9419a3c422d8bdfd Reviewed-on: https://chromium-review.googlesource.com/478551 Commit-Ready: Dylan Reid <dgreid@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>