Start a system resource allocator that will be able to manage the
resources specific to each architecture.
Change-Id: I98cf35c280fefd7b0000801eb7405a236373b753
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1089719
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Add the AddressAllocator module that will be used by both architectures
to manage distributing address ranges to devices. This will make the
addition of PCI devices easier as now both MMIO and PCI will need to
share address space. Add this to a new resources crate.
Change-Id: I6a971dd795f2118bd6cfec7dc34a65b0d4a32f9b
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1072570
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Don't allow clients to create files and directories that are writable by
anyone other than the user. This is equivalent to having a umask of
022.
BUG=chromium:703939
TEST=change the umask in the container, mkdir, and see that it has 0755
Change-Id: I0622fcd89935512969bcd25a9b1fece1e72e1f38
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1112869
Reviewed-by: Dylan Reid <dgreid@chromium.org>
We calculate the size of the buffer to allocate for a read message by
finding the minimum of the requested size and the number of bytes left
in the response message buffer.
However, we then turned around and used an unsafe block to set the
length of the allocated buffer to the requested size rather than the
calculated size. This could lead to memory corruption if the file we
were trying to read had enough bytes to fill up the whole buffer and the
requested size was larger than the max message size.
Replace both unsafe blocks with a resize function instead. The
compiler is smart enough to turn this into a memset and
zero-initializing a few KB of memory is not that expensive.
BUG=chromium:703939
TEST=none
Change-Id: Ia9911d4176322bc9af0753541bd29d7a4723503b
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1110479
Reviewed-by: Dylan Reid <dgreid@chromium.org>
This function will be used elsewhere in gpu_display.
TEST=None
BUG=None
Change-Id: I58b820511ea5a55a53ad640fdfe7c96d2dbdc73b
Reviewed-on: https://chromium-review.googlesource.com/1105481
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>
This provides proper synchronization for guest access to
DMABufs.
Virtio wayland device is given access to the DMA_BUF_SYNC ioctl
in order to implement this. Being able to use this directly in
the virtio wayland device process is important as these calls
can sometimes be relatively expensive and they are frequent
enough that avoiding another context switch is useful for good
performance.
TEST=cache-line artifacts no longer noticeable
BUG=chromium:837209
Change-Id: Ibb8d7c01f70ed5b74afd69288015a65186fec52a
Reviewed-on: https://chromium-review.googlesource.com/1076928
Commit-Ready: David Reveman <reveman@chromium.org>
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Implement all the server methods for the 9P protocol.
BUG=chromium:703939
TEST=bonnie++ -r 256
Change-Id: I6b1b5fe4fea4d4941db42e5c1a364a54d0827054
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1013203
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Add a way to iterate over all the descriptors in a descriptor chain.
This is different from AvailIter, which iterates over all the descriptor
chain heads in a queue.
The new iterator struct provides readable() and writable() methods for
iterating over just the readable or writable descriptors, respectively.
BUG=chromium:703939
TEST=none
Change-Id: Iea3fa5bb7662146a2d156a49ce8bb8ef00c522da
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1065172
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Add an is_read_only method to the DescriptorChain struct. This is
easier to read at a glance than `!is_write_only()`, which looks almost
the same as `is_write_only()`.
BUG=chromium:703939
TEST=none
Change-Id: I0cb3b17c30e38804a21d3e63e975157c96879cb4
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1067703
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Allow DescriptorChain to be cloned. This will enable devices to
maintain a read head and write head in the same DescriptorChain.
BUG=chromium:703939
TEST=clone the DescriptorChain in a method
Change-Id: I1d775a9e0b7ed42052272f22a9b308ad4d108e45
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1065171
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
On Mediatek systems like hana we see there's are three drm renderer
devices including vgem, pvr, and mediatek. We should exclude the pvr
device along with the vgem device for crosvm usage.
BUG=none
TEST=manual test on hana
TEST=build_test passes on all architectures
Change-Id: I834c231a08a7193bd358b3543ed0ed81a6d8bd84
Reviewed-on: https://chromium-review.googlesource.com/1087250
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Allow the process that spawned crosvm to pass in a configured tap file
descriptor for networking. If this option is provided then crosvm will
ignore the other networking related command line flags (like mac
address, netmask, etc).
Passing in a configured tap device allows us to run crosvm without
having to give it CAP_NET_ADMIN.
BUG=none
TEST=Start a container and verify that networking still works
Change-Id: I70b9e6ae030d66c4882e4e48804dc2f29d9874ba
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1081394
Reviewed-by: Zach Reizner <zachr@chromium.org>
Before this CL, the WlState object would close VFDs that had been hungup
on the remote end as a means to removing the underlying FD from the
PollContext. However, this has some unintended side-effects. For one,
the guest would later try to delete the VFD after it was closed, which
was a double-free. Another was that every pending message that was
waiting to enter the virtio queue would get dropped if it was destined
for the closed VFD. This was especially bad if the virtio queue became
full because data would get dropped when a VFD was hungup before the
guest had any chance to read it.
This CL leaves the hungup VFDs (and therefore their pending message) as
is, but removes it from the PollContext if there is nothing left to read.
No data is removed until after the guest explicitly closes the VFD.
TEST=paste 100k characters into a guest app from Chrome
BUG=chromium:849317
Change-Id: I20e3bc7c32c3f654f88f6ef9cdfcb853f2d52f09
Reviewed-on: https://chromium-review.googlesource.com/1088308
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
It looks like on ARM we use the real gettimeofday system call when
we're outputting error messages, so we need to whitelist this to avoid
crashing instead of seeing the error messages.
BUG=chromium:843807
TEST=run vm_CrosVmStart and make sure there are no crashes for crosvm
Change-Id: I9f47da8dabe31f0677bcaa1d431e56545e20c9c9
Reviewed-on: https://chromium-review.googlesource.com/1081390
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Multi-plane DMABufs are useful for efficient video playback. The
guest can already use this but has to guess the stride and offsets
for the second and third plane as they are not passed by virtwl
to the guest kernel.
This extracts the correct strides and offsets for each buffer and
passes them back to the guest in the allocation response message.
BUG=chromium:837209
TEST=sommelier can use nv12 buffers without guessing stride/offset
Change-Id: I36ae2fad6605293c907802121676296cbc607a57
Reviewed-on: https://chromium-review.googlesource.com/1070799
Commit-Ready: David Reveman <reveman@chromium.org>
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
The p9 crate needs the libc::DT_UNKNOWN constant, which isn't available
in version 0.2.34 but is available in version 0.2.40.
BUG=chromium:703939
TEST=none
CQ-DEPEND=CL:1065064
Change-Id: If1451d5bcc2737abc2a14d2b81005c6318165e1f
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1013202
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Add definitions for all the messages we expect to send and receive over
the wire.
BUG=chromium:703939
TEST=none
Change-Id: I6b48f3e2eb9779fca57f8b71120b7bb1e8ab4ab9
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1013201
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Implement encoding and decoding various primitives using the p9
protocol. In addition, add a procedural macro to derive the encoding
and decoding implementation for structs built out of the primitives.
BUG=chromium:703939
TEST=unit tests
CQ-DEPEND=CL:1065063
Change-Id: I7256633fb7002da9ce8af03be2f24410b90ccf3f
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/969965
Reviewed-by: Stephen Barber <smbarber@chromium.org>
We do not want to add dependencies on GCC. Switch to cc crate
instead of gcc to honor CC setting.
CQ-DEPEND=CL:1066462
BUG=chromium:814480
TEST=emerge-{eve,kevin} crosvm works.
Change-Id: I4e846b2080503e5617ed66e709f7af5263c98fba
Reviewed-on: https://chromium-review.googlesource.com/1066461
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Signal to the OS that we want these writes committed all the way to
disk. Replace an existing call to flush as that's not sufficient.
Change-Id: I9df9e55d2182e283e15eebc02a54c1ce08434f42
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1060696
Reviewed-by: Zach Reizner <zachr@chromium.org>
name/date/desc_len fields of drm_version struct are of type __kernel_size_t
and not unsigned long long.
BUG=chromium:837209
TEST=crosvm finds DRM device on kevin
Change-Id: If940b31cb730cbaa46ed781021cbe60189da9f65
Reviewed-on: https://chromium-review.googlesource.com/1064913
Commit-Ready: David Reveman <reveman@chromium.org>
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Remove "enable-" prefix from wayland-dmabuf argument. This prefix is not
used when specifying the argument in run_vm.
BUG=chromium:837209
TEST=crosvm usage output matches what is a valid argument
Change-Id: Ib9402842c6ce58b4b3d1646c0df3acb5c5de4b0c
Reviewed-on: https://chromium-review.googlesource.com/1064725
Commit-Ready: David Reveman <reveman@chromium.org>
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
The extension condition was reversed, also SSE is not enabled by default
in guest VCPU, so limit the test to setting the FP bit.
BUG=b:79692549
TEST=cargo test -p kvm
Change-Id: I2959fe7dfff79703777d6254deae817fea892b00
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1062645
Reviewed-by: Zach Reizner <zachr@chromium.org>
This implements DMABuf allocation type in the virtio wayland
device.
We attempt to locate a supported DRM device prior to engaging
the device jail. If found, the DRM device is passed to the
wayland device code and used to serve DMABuf allocations.
DMABuf support can be disabled by not providing crosvm with
access to any DRM device nodes.
The guest is expected to handle the case when DMABuf allocation
fails and fall-back to standard shared memory.
This initial change uses DRM directly but is structured in a
way that would allow the allocator to be replaced by minigbm
with minimal effort.
BUG=chromium:837209
TEST=crosvm finds drm device and returns valid dmabufs to guest
Change-Id: Ic1fd776dfdfefae2d7b321d449273ef269e9cc62
Reviewed-on: https://chromium-review.googlesource.com/1034088
Commit-Ready: David Reveman <reveman@chromium.org>
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Plugin often needs access to various objects on disk; let's allow caller
to prepare root filesystem for the plugin to pivot to.
BUG=None
TEST=cargo test --features=plugin
Change-Id: I4f91511c776a06e4c329fe5aa42df4bb613ab5ab
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1055666
Reviewed-by: Zach Reizner <zachr@chromium.org>
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>
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>
Add a build-time feature that allows having plugin and other parts of
crosvm to run outside of jailed environment. This is strictly a
development time feature and is not expected to be activated with
shipping code.
Sandbox can still be activated by passing -u (--multiprocess) option.
BUG=None
TEST=cargo test --feature=default-no-sandbox
Change-Id: If9ef1ce8ed0b5d23cef3ad193679baca94413360
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1054194
Reviewed-by: Zach Reizner <zachr@chromium.org>
Like block_device, also needs to use ftruncate64 instead of ftruncate.
BUG=chromium:840048
TEST=manual test of graphics on kevin
Change-Id: Ib24b12fd681c96ecc2fec796fe480e94a96a0626
Reviewed-on: https://chromium-review.googlesource.com/1050916
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
The signature for this system call was wrong, but somehow managed to
work on x86_64. This should fix it to work on all architectures.
BUG=chromium:840048
TEST=build_test passes
TEST=virtio wayland works on ARM
Change-Id: I295548357f688be4772e65991fb65178ead3b1e8
Reviewed-on: https://chromium-review.googlesource.com/1050915
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
This is a pfn (page-frame number) not a raw address, so we need to
shift it right by 12.
BUG=chromium:840048
TEST=manual test on kevin with virtio wayland and --disable-sandbox,
should not get "failed to recv from vfd: VmBadResponse" message
Change-Id: I788712ec7b9b3e9b4ada481d62a5f2ae1624e929
Reviewed-on: https://chromium-review.googlesource.com/1049060
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
These bindings are needed to allocate dmabufs that will be used for
accelerated rendering and zero-copy virtio-wayland support.
TEST=cargo test -p gpu_buffer
BUG=chromium:837073
Change-Id: I96d7bcdeaa1eda616a25fdcfedcbb734cd585ae7
Reviewed-on: https://chromium-review.googlesource.com/1029410
Commit-Ready: David Reveman <reveman@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
This adds a very simple RTC device and implements reading the time of
day based on the host's time of day. It currently doesn't support
setting the time or wake up alarms but could do so in the future.
Also instantiate it and add the appropriate nodes to the device-tree
for ARM guests.
BUG=chromium:833825
TEST=manual test on kevin, date is properly set when VM is started
Change-Id: I032ec7df2cba9e9016966eb4160b413fec9a40ba
Reviewed-on: https://chromium-review.googlesource.com/1038801
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
This would have been useful in figuring out recent bugs in the block
sub system.
BUG=chromium:837453
TEST=manual test on kevin with qcow device
Change-Id: I3e3360bb0226e3cd7052e0431ce555cfef5e091b
Reviewed-on: https://chromium-review.googlesource.com/1034013
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
A simple stat collecting. Uses RAII to gather latency on all exit
paths from function/block. The underscore in "let _u = STATS.u(...)" is
to pacify "unused variable" warning. Using "let _ = " makes compiler
optimize out the call.
Rust makes it particularly hard to convert enums from integers, so I had
to add a hack that stores Enum on every invocation of the STATS.u. Looking
at disassembly, it added one move of constant to the field of STATS.entries;
no heap operations or cloning. A clever alternative using macros was
suggested by semenzato@, but I decided saving an instruction was not
worth the complexity.
The output is currently printed on the destruction of crosvm, so tests
print out stats on exit. We probably should find a better place for it
though.
BUG=None
TEST=cargo test --release --features plugin
Change-Id: I78a8920e9896b717af3aaea14f8ed6013be6b94f
Reviewed-on: https://chromium-review.googlesource.com/1036473
Commit-Ready: Slava Malyugin <slavamn@chromium.org>
Tested-by: Slava Malyugin <slavamn@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
These error variants are leftovers from the old initialization path for
virtio-wayland.
TEST=./build_test
BUG=None
Change-Id: I3dd55a10b923c4be300a72dfc36aeeb3bb02570b
Reviewed-on: https://chromium-review.googlesource.com/1033499
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
The u64 offsets could be truncated when running on a 32 bit machine.
Do the math in 64 bit, limit to usize::MAX, then truncate.
BUG=837453
TEST=run crosvm and read/write files
Change-Id: If44ec94cf730ca7c1e580eeddd202e54e2de1081
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1031301
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
It is essential that paste operations on the guest receive a hangup
letting them know that there is no more data to read. This change fixes
that behavior, which was broken by thew new PollContext based logic,
which separates out the readable and hungup code paths.
TEST=finished wayland pastes receive EOF
BUG=chromium:835112
Change-Id: I764124ab2eabb32d8cc25a3a4c0dfbe49b26e799
Reviewed-on: https://chromium-review.googlesource.com/1031292
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Aarch64 seems to use ftruncate64 rather than ftruncate.
BUG=chromium:816692
TEST=run VM on kevin using concierge
Change-Id: I944f52d75fb9f5a3aaf5fe9e85708c48f249bb1a
Reviewed-on: https://chromium-review.googlesource.com/1031175
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
This is fixes the last remaining negative error code returned by a Rust
function.
TEST= cargo test --features plugin
BUG=None
Change-Id: Ideee89b0f0b1effecc9b5880bcf400c82d9b96f9
Reviewed-on: https://chromium-review.googlesource.com/1026938
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Because resize was used to grow a vec, each Arc<Mutex<PerVcpuState>> was
cloned from the original Default, merely increasing the ref count on the
same default data.
This change manually pushes a unique set of data per vcpu.
BUG=chromium:835916
TEST=None
Change-Id: I7116c764effd0f33f706f912bcf4d5d28ba1e08e
Reviewed-on: https://chromium-review.googlesource.com/1024504
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Aleksandr Kartashov <regmka@gmail.com>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
This commit addresses a number of issues with the way in which the
SIGRTMIN() + 0 signal is used to kick VCPU threads. It
1. Moves the registration of the signal handler to the main thread.
There's no need to register the handler once for each VCPU as
there's one handler per process, rather than one per thread.
2. Ensures expect is not called in the VCPU thread before
start_barrier.wait() is called. In the current code,
failure to register the signal handler causes crosvm to hang
rather than to exit as the VCPU thread panics before calling
start_barrier.wait(). The main thread then blocks forever while
waiting on the barrier.
3. Uses the KVM_SET_SIGNAL_MASK ioctl to remove a race condition in
the current code. In the current code, a SIGRTMIN() + 0 signal,
received during a vm exit, would be consumed before the next call
to KVM_RUN, which would execute as normal and not be interrupted.
This could delay the VM from stopping when requested to do so.
Note that the new code doesn't unblock all signals during
the call to KVM_RUN. It only unblocks SIGRTMIN() + 0. This is
important as SIGCHILD is blocked at the start of run_config, and
we probably don't want this unblocked periodically in each of the
VCPU threads.
TEST=run crosvm and stop it in both single and multi-process mode.
BUG=none
Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
Change-Id: Ibda7d6220482aa11b2f5feee410d1d2b67a7e774
Reviewed-on: https://chromium-review.googlesource.com/1019443
Commit-Ready: Mark D Ryan <mark.d.ryan@intel.com>
Tested-by: Mark D Ryan <mark.d.ryan@intel.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
The PollContext::wait returns Error on EINTR, which often happens during
suspend/resume cycles. Because this Error is transient, this should be
handled internally with a retry until a fatal error is encountered.
BUG=chromium:834558
TEST=run crosvm, suspend, resume, observe crosvm still running
Change-Id: I75469e261ddf28f025a3b3b93612538ccf1230b9
Reviewed-on: https://chromium-review.googlesource.com/1018527
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Now that there are no users of that interface, we should remove it.
TEST=./build_test
BUG=chromium:816692
Change-Id: Ifdbde22984f557b945e49559ba47076e99db923b
Reviewed-on: https://chromium-review.googlesource.com/1000103
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
The wl device was the last user of the old Poller.
BUG=chromium:816692
TEST=run wayland under crosvm
Change-Id: I6c1c1db2774a6e783b7bd1109288328d75ad2223
Reviewed-on: https://chromium-review.googlesource.com/1000102
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Making a copy of PollEvents is useful to drop the PollEvents structure
which borrows from a PollContext. Even though immutably borrowing from a
PollContext does not prevent any operations on a PollContext, it does
prevent mutable method calls on any structure that owns PollContext.
TEST=None
BUG=chromium:816692
Change-Id: I9527fd5c122a703933deb973ad549b792226e4c6
Reviewed-on: https://chromium-review.googlesource.com/1000101
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>