Clippy only has 6 lints that are defaulted to deny, which this CL fixes.
The first step to running clippy and establishing our own set of default
deny lints, is to ensure we aren't running afoul of the most common
deny lints.
BUG=None
TEST=cargo clippy --all
Change-Id: I225801357d76a8a9e246e3842bc9bf550fcd7207
Reviewed-on: https://chromium-review.googlesource.com/952045
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>
We have decided that API defined in crosvm.h should signal errors by
returning negative values derived from common errno error codes. To
avoid confusion within the rest of crosvm code that is using positive
erro codes, let's perform the conversion to negative on that crosvm API
boundary, so it is contained.
TEST=cargo test --features plugin
BUG=None
Change-Id: Icb1e719c8e99c95fdc32dce13a30d6ff8d3d9dc7
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/947563
Reviewed-by: Zach Reizner <zachr@chromium.org>
This change was overwritten yet again by a bad rebase. In this case it
was CL:942084.
TEST="crosvm run -s" with socket and then subsequent "crosvm stop"
causes the running VM to be shutdown
BUG=811749
Change-Id: I04d9b71b6eeef494eb0ffcd86c7bc71a86730a19
Reviewed-on: https://chromium-review.googlesource.com/951981
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Robert Bradford <robert.bradford@intel.com>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Using an enum implementing PollToken is the recommended way to use
PollContext, but writing the trait impls for each enum is mechanical yet
error prone. This is a perfect candidate for a custom derive, which
automates away the process using a simple derive attribute on an enum.
BUG=chromium:816692
TEST=cargo test -p sys_util
Change-Id: If21d0f94f9af4b4f6cef1f24c78fc36b50471053
Reviewed-on: https://chromium-review.googlesource.com/940865
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
A common cause of silent 100% CPU usage on otherwise idle VMs is because
some poll loop is waiting on sockets that were hung up on. An unrelated
issue is that using the Poller interface requires dynamic allocation on
every poll call for dynamically sized poll lists.
The PollContext struct detects and warns about the first problem at runtime
and solves the latter problem.
TEST=cargo test -p sys_util
BUG=chromium:816692
Change-Id: I42a9c961db07191d25bcba77c5136f5729400ec9
Reviewed-on: https://chromium-review.googlesource.com/933870
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Errno-based error codes are positive and turning them into negatives is
Linxu kernel internal convention. Let's not do this so we do not confuse
the signedness of errors coming from crosvm code and system libraries.
TEST=cargo test --features plugin
BUG=None
Change-Id: Ia89f0b78ad1d2bb30a2f427593f13ebfb548b2b0
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/947562
Reviewed-by: Zach Reizner <zachr@chromium.org>
On ARM we need to set up all CPUs before we can initialize the
interrupt controller, which is unfortunately the opposite of the
required ordering on X86. This separates out the creation of the
VCPUs and puts their FDs into a vector and then launches threads from
that vector later on in the setup sequence.
BUG=chromium:797868
TEST=./build_test passes on all architectures
TEST=crosvm runs on caroline
Change-Id: I108234efd6c53c4681531701c107a11e42c029f5
Reviewed-on: https://chromium-review.googlesource.com/947462
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
On Linux, signal handlers installed with signal() will restart
interrupted system calls. When we moved to using sigaction() we forgot
to specify SA_RESTART and so we started experiencing returns from read
write system calls with EINTR, which throws off some of the code.
Instead of sprinkling "handle_eintr" everywhere, let's restore the old
behavior.
TEST=cargo test --features plugin; cargo test -p sys_util
BUG=chromium:800626
Change-Id: I24c23069ad4c9e7be8c484ee4c57f67451a2944d
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/944848
Reviewed-by: Zach Reizner <zachr@chromium.org>
This is in preparation to make different architectures implement a
trait, but for now it's just moving code out of linux.rs and into
x86_64 trait. A few new functions were required which will become
part of the trait interface. There's still a lot of ugly ifdefs
everywhere that should go away in subsequent CLs.
BUG=chromium:797868
TEST=./build_test
TEST=run crosvm on caroline
Change-Id: Ifc95d4eb84f64ebacb4481a172524d94dc96b7bb
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/942084
Reviewed-by: Zach Reizner <zachr@chromium.org>
I ran into an issue on ARM where ppoll() was returning EINVAL and it
was becuase our timespec value sent to ppoll contained a negative
value for tv_sec. We need to use the correct type when determining
the max value.
BUG=chromium:797868
TEST=./build_test passes on all architectures
TEST=crosvm runs on caroline
Change-Id: I7f8818e5f93e0327fd9facefb5032f7c5fb00ea0
Reviewed-on: https://chromium-review.googlesource.com/945111
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
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>
System functions have 2 ways of signalling errors, either via returning
-1 as result, and setting errno, or directly returning error code, and
we can not distinguish automatically between the 2 options when using
InterruptibleResult trait for i32 values.
Let's remove this trait for i32 and create 2 explicit macros:
handle_eintr_rc and handle_eintr_errno.
TEST=cargo test --features plugin; cargo test -p sys_util
BUG=None
Change-Id: I1dc8e3c023e7bf7875ac3536703eb71fa3206b7b
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/940612
Reviewed-by: Zach Reizner <zachr@chromium.org>
System error codes are positive, we should not try to use the negative
(kernel) form when working with it.
TEST=cargo test --features plugin; cargo test -p sys_util
BUG=None
Change-Id: I8dea773e6148d1814ca0ea5019d5fb7824dc80ac
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/940611
Reviewed-by: Zach Reizner <zachr@chromium.org>
scm_sendmsg() and scm_recvmsg() return negative errors derived from
errnos that are normally positive. When constructing errno::Error from
these error codes we should convert them back into positive values for
error codes to make proper sense.
TEST=cargo test --features plugin; cargo test -p sys_util
BUG=None
Change-Id: Ibf9065b72602e43cb6badd06f85044329d714276
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/940562
Reviewed-by: Zach Reizner <zachr@chromium.org>
This plumbs calls to KVM_GET_SUPPORTED_CPUID and KVM_GET_EMULATED_CPUID
to be available to plugins.
TEST=cargo test --features plugin; cargo test -p kvm
BUG=chromium:800626
Change-Id: I98879599b5f970c6c2720772658689a505d8abe1
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/938674
Reviewed-by: Zach Reizner <zachr@chromium.org>
Small core CPUs have limited physical address space, e.g. 16GB. This
affects both "real" physical address space as well as "virtual"
physical address space implemented by extended page tables.
Any page table entry addressing memory beyond physical address limit
will produce page fault. The change avoids these faults for
memory-mapped devices (e.g. Wayland shared buffers) by moving them
next to physical RAM.
BUG=none
TEST=verified Xwayland boots fine on N3150 (Braswell)
Change-Id: I178aa53eb511a98507b2cb28d28ccf422a08b107
Reviewed-on: https://chromium-review.googlesource.com/940191
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Slava Malyugin <slavamn@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
We need to convert between protobuf and KVM format of cpuid data in
several places, so let's add helpers to plugin_proto crate.
TEST=cargo test --features plugin; cargo test -p kvm
BUG=chromium:800626
Change-Id: Ida7b59825d2146b0d02711e441f477d90dd4263a
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/939660
Reviewed-by: Zach Reizner <zachr@chromium.org>
This is helpful in passing up low-level errors from system calls.
BUG=chromium:797868
TEST=./build_test passes on all architectures
TEST=crosvm runs on caroline
Change-Id: Ic2d8a23240a1449ac78877d37a074fd97a29a065
Reviewed-on: https://chromium-review.googlesource.com/933375
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
This implements the error trait so we can get more useful error
information back on failures.
BUG=chromium:797868
TEST=./build_test passes on all architectures
TEST=crosvm runs on caroline
Change-Id: Ia131b1eb14d24709c10f2ba752a962e822134a42
Reviewed-on: https://chromium-review.googlesource.com/938312
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
This implements the error trait so we can get more useful error
information back on failures.
BUG=chromium:797868
TEST=./build_test passes on all architectures
TEST=crosvm runs on caroline
Change-Id: I888cbe6fca8bc3885eeb4ff747f7b9dc51e0b587
Reviewed-on: https://chromium-review.googlesource.com/938311
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Implement the std::error::Error Trait for Error types within the
x86_64 crate. We will make use of these implementations later on when
we are using the architecture Trait to pass architecture-specific
errors up with meaningful descriptions.
BUG=chromium:797868
TEST=./build_test passes on all architectures
TEST=crosvm runs on caroline
Change-Id: I7a30db69437990608e3a0f5e6e3a200ef6c2d0c3
Reviewed-on: https://chromium-review.googlesource.com/932976
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
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>
Harmonize small 8042 implementation with kvmtool by making read from
port 0x61 return 0x20. This prevents infinite loop in
pit_calibrate_tsc() on small Intel cores.
BUG=none
TEST=reproduced problem on Celeraon N3150 (Braswell), verified
VM boots further with the fix
Change-Id: Ifbee2bc72c4f5acd2551d8dcab466dc5f4907975
Reviewed-on: https://chromium-review.googlesource.com/938759
Commit-Ready: Slava Malyugin <slavamn@chromium.org>
Tested-by: Slava Malyugin <slavamn@chromium.org>
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: Ibe91745c36765c64aeab2f6aae5cd0ca8f243a42
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/939868
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>
The raw_os_error() and errno() return positive values (errno values are
all positive), but the rest of crosvm plugin C API works with negative
return codes, so we need to convert raw_os_error()/errno() into
negatives as well.
TEST=cargo test --features plugin; cargo test -p kvm
BUG=None
Change-Id: I8bd72c2e67cb227a638e5c9478cd2f781f0783d0
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/939865
Reviewed-by: Zach Reizner <zachr@chromium.org>
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>
The initalization code in crosvm used two-level page table
in long mode, with last entry covering 1GB. This assumed
presence of 1GB pages support ('pdpe1gb' in /proc/cpuinfo).
Some CPUs don't have it.
BUG=none
TEST=reproduced bug on Celeron N3150 (Braswell), verified
VM boots on it with fix
Change-Id: I6014c7ea236d8daf95e9f09b68beb7935a267aa3
Reviewed-on: https://chromium-review.googlesource.com/936323
Commit-Ready: Slava Malyugin <slavamn@chromium.org>
Tested-by: Slava Malyugin <slavamn@chromium.org>
Reviewed-by: Slava Malyugin <slavamn@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
I will be refactoring this code to mostly live in the architecture
code, but for now it's simpler to move it out into it's own crate.
BUG=chromium:797868
TEST=./build_test passes on all architectures
TEST=crosvm runs on caroline
Change-Id: I85c12696fcd5cbef6a72a6dcbc484a443e0b0784
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/933084
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>
Use of signal(2) is only portable with SIG_DFL or SIG_IGN, it should not
be used to set real signal handler. sigaction(2) should be used for this
purpose.
TEST=cargo test --features plugin; cargo test -p kvm; ./build_test
BUG=chromium:800626
Change-Id: I5a8d1f68c7f285b489e08f74f63b573f263e09d1
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/930463
Reviewed-by: Zach Reizner <zachr@chromium.org>
We are planning on using KVM_SET_SIGNAL_MASK and have the signal that we
use to kick VCPU permanently masked to close the race around handling
pause requests, so we need a way to clear pending interrupts, otherwise
VM will never run again.
TEST=cargo test --features plugin; cargo test -p kvm; ./build_test
BUG=chromium:800626
Change-Id: I2dfe6fcb129e4b8156f6a7ff842e171661c56440
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/930462
Reviewed-by: Zach Reizner <zachr@chromium.org>
Move creating sigsets and blocking/unblocking signals form signalfd
module to signal module so they are usable by other parties as well.
BUG=chromium:800626
TEST=cargo test --features=plugin
Change-Id: I281ce784ed6cb341cc1e7cf2784f6fb1e8cc894d
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/930461
Reviewed-by: Zach Reizner <zachr@chromium.org>
Check that two address calculations don't overflow. Return an error if
they do. Thanks cargo fuzz.
Change-Id: I9dd301c4e08516cea8456f1ea313d62582979da0
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/932646
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Disk images should never be mounted as writable by multiple VMs at once.
Add advisory locking to prevent this.
BUG=chromium:810576
TEST=run crosvm twice with same rwdisk, check that second VM fails to start
Change-Id: I5e6c178515eafa570812a093449eef5a4edc1740
Reviewed-on: https://chromium-review.googlesource.com/929994
Commit-Ready: Stephen Barber <smbarber@chromium.org>
Tested-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
sys_util errors always have a backing errno. Use these to allow
clients to always get access to the underlying errno when using
ioctl-based operations.
BUG=none
TEST=cargo test
Change-Id: I8853eeb2b9b38e5509c0ef01f507e461d5d36267
Reviewed-on: https://chromium-review.googlesource.com/927804
Commit-Ready: Stephen Barber <smbarber@chromium.org>
Tested-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Allow get/set for the host mac on the tap interface. Also add read accessors
for the host IP address and netmask, and make using IFF_VNET_HDR optional.
BUG=none
TEST=./build_test
Change-Id: I9999bf5aa8aa35b8cae702d9bc6f94602d6fe32e
Reviewed-on: https://chromium-review.googlesource.com/918406
Commit-Ready: Stephen Barber <smbarber@chromium.org>
Tested-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
crosvm supports using vhost for improved networking peformance however
there is no runtime control to enable it. Add a flag to the command line
arguments to enable vhost networking.
This defaults to off, as before, since /dev/vhost-net may not be
accessible to the current user.
TEST=With permissions to open /dev/vhost-net check that running with
--vhost-net shows significantly improved performance. Tested with and
without sandbox.
BUG=none
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
Change-Id: Idfd3f59cc7ff68a3cab7d1855c7d6b8f046f7cec
Reviewed-on: https://chromium-review.googlesource.com/925361
Commit-Ready: Stephen Barber <smbarber@chromium.org>
Tested-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
We may want to issue additional crosvm_pause_vcpu() requests while VCPUs
are waiting to be resumed, so we need to make sure we are not holding
lock while waiting.
TEST=cargo test --features plugin
BUG=chromium:800626
Change-Id: Ia74836a567fc565fbd868abdcaa6d0174a4341ad
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/917426
Reviewed-by: Zach Reizner <zachr@chromium.org>
When creating a new vcpu, setup_vcpu() returns a JoinHandle which allows
the main thread to wait for the vcpu threads to complete. Put this
handle into a vector from which it will be later join()ed with to wait
for its execution to complete. By ensuring that the thread's completion
is waited for all the references to the ProxyDevice will be dropped and
thus the jailed processes will be sent a shutdown message and they will
cleanly exit.
TEST="crosvm run --cpus=2 ..." and observe that the jailed processes are
cleanly shutdown and not forcefully killed.
BUG=812234
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
Change-Id: I771251ff1cdf762ca68c0781dc7de9f95cc1fcfe
Reviewed-on: https://chromium-review.googlesource.com/919165
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>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Remove control_sockets definition that shadows earlier one which
contains the opened socket for receiving messages for controlling the
running VM. This shadowing meant that the messages sent over the socket
were not handled.
TEST="crosvm run -s" with socket and then subsequent "crosvm stop"
causes the running VM to be shutdown
BUG=811749
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
Change-Id: If5a82ec10c29ab037cbedcf7acea23a49b4cfeb6
Reviewed-on: https://chromium-review.googlesource.com/916264
Commit-Ready: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Writing tests that see if crosvm succeeds is difficult if it doesn't
indicate when it fails. Return 1 when something goes wrong so that the
exit code of crosvm can be used in autotest.
Change-Id: Iaaa526bf78da19b73f786f7bbfa8e2f16eb39ca1
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/902779
Reviewed-by: Zach Reizner <zachr@chromium.org>
The reference count table must be continuous in the file, not
preallocating it when creating a file causes errors when setting
reference counts for new blocks later.
BUG=809847
TEST=Replay formatting and downloading container events.
Add unit test that catches error with default files.
Change-Id: I08840958a1180a73f32f42d520517bcf88a158b0
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/909915
Adding the size and offset of a read or write makes errors easier to
reproduce.
Change-Id: Ia1c07f831dc6fb6f08acb87a30459713d0f706c0
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/907420
Reviewed-by: Stephen Barber <smbarber@chromium.org>
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>
A plugin that exits without sending the start message would cause the
main process to exit with a failure code, which made some forms of
unit testing have false negatives.
BUG=chromium:800626
TEST=cargo test --features plugin
Change-Id: I14803ed3d2c933b8591c5370756a5caaa93b97e6
Reviewed-on: https://chromium-review.googlesource.com/906007
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
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>
Dirty logging is not necessary for every memory region, so the plugin
process should be able to specific exactly which regions it would like
dirty logging enabled for.
TEST=cargo test --features plugin
BUG=chromium:800626
Change-Id: I28b8285357e7de1c8c3a1392bdfdb4853ec5a654
Reviewed-on: https://chromium-review.googlesource.com/900294
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>