commit | f8dcf7528d27c6f5b4c1eb6c3f80b28471d3e28f | [log] [tgz] |
---|---|---|
author | Shintaro Kawamura <kawasin@google.com> | Fri Mar 31 15:50:50 2023 +0900 |
committer | crosvm LUCI <crosvm-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Apr 03 06:03:18 2023 +0000 |
tree | 3ec6be0d664633e7ed50eb684c715b64f0a1f230 | |
parent | 275a320702c057fd4d39f9f726e8df6465f3d447 [diff] |
swap: fix deadlock on the vmm-swap enable operation The deadlock could happen on this scenario: 1. User enables vmm-swap. The main process sends Command::Enable to the monitor process. 2. User request the current status at the same time. The main process sends Command::Status to the monitor process and wait for the response from the monitor process. 3. The monitor process start enabling vmm-swap. Sends VmSwapCommand::Suspend to the main process and wait for VmSwapResponse::SuspendCompleted. 4. The main process is blocked by the step 2 and the request from step 3 is never consumed. The root issue issue is that Command::Status can be inserted between Command::Enable and VmSwapCommand::Suspend. This CL simplifies the communication between the main and monitor processes on enabling vmm-swap and resolve the deadlock. VmSwapCommand and corresponding Tube was added by https://crrev.com/c/4293656, but is now removed by this CL. BUG=b:275671628 TEST=manual test Change-Id: Ia838b1feddb4a3f41bd729e9147adc5e2df866aa Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4387662 Reviewed-by: David Stevens <stevensd@chromium.org> Commit-Queue: Shin Kawamura <kawasin@google.com>
crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the ChromeOS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.
crosvm is currently used to run Linux/Android guests on ChromeOS devices.