cloud-hypervisor/hypervisor/src
Rob Bradford 7be69edf51 hypervisor: kvm: Introduce Mutex around VcpuFd
This is required as the VcpuFd::run and VcpuFd::set_immediate_exit
methods now take a &mut self. I explored alternative solutions:

1. Using RefCell for runtime interior mutability - the Vcpu trait is
   Sync and it's not possible to use RefCell with types that are Sync.
2. Using UnsafeCell - the mutable reference nature of ::run and and
   ::set_kvm_immediate_exit was added for a reason so it unwise to
   bypass this.
3. Adjusting the trait interface to expose the &mut self - this requires
   an Arc<Mutex<>> around the hypervisor::vcpu::Vcpu object and was very
   intrusive.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2024-04-25 20:53:53 +00:00
..
arch build: add REUSE Compliance Check 2024-04-19 17:35:45 +00:00
kvm hypervisor: kvm: Introduce Mutex around VcpuFd 2024-04-25 20:53:53 +00:00
mshv hypervisor: rework VP state components 2024-04-24 16:02:54 +00:00
cpu.rs hypervisor: Remove unused VmExit enum members 2024-04-25 20:53:53 +00:00
device.rs
hypervisor.rs hypervisor: Remove empty doc comment 2024-03-19 18:36:22 +00:00
lib.rs hypervisor: Don't restrict logger crate to just x86 2024-03-21 08:34:20 +00:00
vm.rs