crosvm/kvm
Zach Reizner f7797d15b4 kvm: take a reference to GuestMemory in Vcpu
Logically, each VCPU is using GuestMemory, which holds a ref count to
the underlying memory mappings. This change formalizes this by giving an
actual reference of GuestMemory to each Vcpu struct.

This change is needed because the Vm can go out of scope and clean up
its reference, but the Vcpus may still be running, triggering an EFAULT
and a lot of confused days spent debugging.

TEST=With the unwind panic handler, trigger a panic right after the
     final vcpu thread barrier. If the VCPU threads do not complain
     about EFAULT (errno 14), this change worked.
BUG=None

Change-Id: I6289147de0adde61c81630357701487937b17ade
Reviewed-on: https://chromium-review.googlesource.com/1441355
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2019-01-30 01:25:56 -08:00
..
src kvm: take a reference to GuestMemory in Vcpu 2019-01-30 01:25:56 -08:00
tests memory: Add methods to return error on short writes and reads 2019-01-13 03:23:13 -08:00
Cargo.toml crosvm: use msg_socket in vm_control 2018-11-19 16:28:35 -08:00