crosvm: Add MSR handler after setting CPU affinity

For MSR handlers with "from running CPU" configuration, they will open
and store the MSR file descriptior immediately while their creation.

So move their creation after crosvm sets CPU affinity for each vCPU
thread can avoid storing redundant MSR file fds.

BUG=b:225375705
TEST=Set `--userspace-msr=0x1a2,type=r,action=pass,from=cpu0`

Change-Id: Iaa7bf804595ef45eec150e826be87c86ffeeef24
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3641478
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
1 file changed
tree: c541454cf992f2d39d2537080a979bbd73796f55
  1. .cargo/
  2. .devcontainer/
  3. .github/
  4. aarch64/
  5. acpi_tables/
  6. arch/
  7. base/
  8. bin/
  9. bit_field/
  10. ci/
  11. common/
  12. cros_async/
  13. crosvm-fuzz/
  14. crosvm_control/
  15. crosvm_plugin/
  16. devices/
  17. disk/
  18. docs/
  19. fuse/
  20. gpu_display/
  21. hypervisor/
  22. infra/
  23. integration_tests/
  24. io_uring/
  25. kernel_cmdline/
  26. kernel_loader/
  27. kvm/
  28. kvm_sys/
  29. libcras_stub/
  30. linux_input_sys/
  31. logo/
  32. media/
  33. metrics/
  34. net_sys/
  35. net_util/
  36. power_monitor/
  37. protos/
  38. qcow_utils/
  39. resources/
  40. rutabaga_gfx/
  41. seccomp/
  42. serde_keyvalue/
  43. src/
  44. system_api_stub/
  45. tests/
  46. third_party/
  47. tools/
  48. tpm2/
  49. tpm2-sys/
  50. tube_transporter/
  51. usb_sys/
  52. usb_util/
  53. vfio_sys/
  54. vhost/
  55. virtio_sys/
  56. vm_control/
  57. vm_memory/
  58. win_util/
  59. x86_64/
  60. .dockerignore
  61. .gitignore
  62. .gitmodules
  63. .rustfmt.toml
  64. ARCHITECTURE.md
  65. Cargo.toml
  66. CONTRIBUTING.md
  67. LICENSE
  68. navbar.md
  69. OWNERS
  70. README.chromeos.md
  71. README.md
  72. run_tests
  73. rust-toolchain
  74. setup_cros_cargo.sh
  75. test_all
  76. unblocked_terms.txt
README.md

crosvm - The Chrome OS 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 Chrome OS 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 Chrome OS devices.

Logo