devices: virtio-gpu: gracefully handle activation errors

Previously, the GPU device's activate() function would panic if sending
the GpuActivationResources to the worker thread failed; this has been
observed in some crash reports, possibly due to activate() running
concurrently with a VM shutdown where the worker thread is already torn
down.

Instead of using expect() to panic if this send() fails, try to handle
the failure by putting the GpuActivationReosurces back into the device's
worker_snapshot field and bubbling up an Err result.

BUG=None
TEST=tools/dev_container tools/presubmit

Change-Id: Ie52e2ecee353e13ff1105c418722a1a8facf997b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5634184
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
1 file changed
tree: 7511be4f82b69441a96c0f93b35eb1c77a4b5a6a
  1. .cargo/
  2. .config/
  3. .devcontainer/
  4. .github/
  5. .vscode/
  6. aarch64/
  7. acpi_tables/
  8. android_audio/
  9. arch/
  10. argh_helpers/
  11. audio_streams_conformance_test/
  12. audio_util/
  13. base/
  14. base_tokio/
  15. bit_field/
  16. broker_ipc/
  17. common/
  18. cros_async/
  19. cros_fdt/
  20. cros_tracing/
  21. cros_tracing_types/
  22. crosvm_cli/
  23. crosvm_control/
  24. crosvm_plugin/
  25. devices/
  26. disk/
  27. docs/
  28. e2e_tests/
  29. ext2/
  30. fuse/
  31. fuzz/
  32. gpu_display/
  33. hypervisor/
  34. infra/
  35. io_uring/
  36. jail/
  37. kernel_cmdline/
  38. kernel_loader/
  39. kvm/
  40. kvm_sys/
  41. libcras_stub/
  42. linux_input_sys/
  43. logo/
  44. media/
  45. metrics/
  46. metrics_events/
  47. net_sys/
  48. net_util/
  49. perfetto/
  50. power_monitor/
  51. prebuilts/
  52. proto_build_tools/
  53. protos/
  54. resources/
  55. riscv64/
  56. rutabaga_gfx/
  57. sandbox/
  58. serde_keyvalue/
  59. src/
  60. swap/
  61. system_api/
  62. tests/
  63. third_party/
  64. tools/
  65. tube_transporter/
  66. usb_sys/
  67. usb_util/
  68. vendor/
  69. vfio_sys/
  70. vhost/
  71. virtio_sys/
  72. vm_control/
  73. vm_memory/
  74. win_audio/
  75. win_util/
  76. x86_64/
  77. .dockerignore
  78. .envrc
  79. .gitattributes
  80. .gitignore
  81. .gitmodules
  82. .rustfmt.toml
  83. ARCHITECTURE.md
  84. Cargo.lock
  85. Cargo.toml
  86. CONTRIBUTING.md
  87. DIR_METADATA
  88. LICENSE
  89. mypy.ini
  90. OWNERS
  91. OWNERS_COUNCIL
  92. PRESUBMIT.cfg
  93. pyproject.toml
  94. README.chromeos.md
  95. README.md
  96. rust-toolchain
README.md

crosvm - The ChromeOS Virtual Machine Monitor

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.

Logo