Reported by: bz
PR: 267468
Details
Details
- Reviewers
markj jhb bz - Group Reviewers
bhyve - Commits
- rG4d447b30f7be: vmm: do not leak halted_cpus bit after suspension
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/amd64/vmm/vmm.c | ||
---|---|---|
1408 | If there are two vcpus, and one is already halted, then we may suspend the VM here. Then the halted vcpu thread can wake up and handle a signal, so the VM will be suspended but halted_cpus != active_cpus. Hmm, but vmx_run() and svm_run() will return VM_EXITCODE_SUSPENDED once the vcpu tries to continue executing the (suspended) guest, so this seems ok. |
sys/amd64/vmm/vmm.c | ||
---|---|---|
1408 | When adding this patch, I wondered if clearing of the bit in halted_cpus should be done under vcpu spin lock. But it seems that vm_resume_cpu() does not care, so I did not do locked the spin lock in the error path as well. I suspect that vm_suspend() in fact needs more synchronization there, regardless of my fix. |