Fix a couple more spaces where we used negative errno values.
TEST=cargo test -p vm_control
BUG=None
Change-Id: Id622192d025d0ac733419411492ca53a50f957f3
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/942087
Reviewed-by: Zach Reizner <zachr@chromium.org>
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: I10d5992cb1e1750aa9b8a7269c4f574d7c753683
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/939866
Reviewed-by: Zach Reizner <zachr@chromium.org>
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>
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>
On older kernels, the memfd_create syscall isn't available. Skip shm
tests if that is the case.
Change-Id: I39c1f1779f1f02e90df727c6ca18b5bdae52e855
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/768102
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Break out vm_control to a crate that will be able to used by more
modules. Having vm_control usable from outside crosvm makes it possible
to move the devices out of crosvm in a later commit.
Change-Id: I1f060700ed49b5d77519d55efa2430490d521256
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/706558
Reviewed-by: Zach Reizner <zachr@chromium.org>