summaryrefslogtreecommitdiffstats
path: root/sys/amd64/vmm/intel/vmx.c
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2014-07-26 02:53:51 +0000
committerneel <neel@FreeBSD.org>2014-07-26 02:53:51 +0000
commit20e3e8762f23482453fd0cfba9aae28ab8287d23 (patch)
tree5210df9d99ccf6d6e69f126ce422e52cca1fc6e4 /sys/amd64/vmm/intel/vmx.c
parent62d591cec94c248df911d92a4fe25355d10f687f (diff)
downloadFreeBSD-src-20e3e8762f23482453fd0cfba9aae28ab8287d23.zip
FreeBSD-src-20e3e8762f23482453fd0cfba9aae28ab8287d23.tar.gz
If a vcpu has issued a HLT instruction with interrupts disabled then it sleeps
forever in vm_handle_hlt(). This is usually not an issue as long as one of the other vcpus properly resets or powers off the virtual machine. However, if the bhyve(8) process is killed with a signal the halted vcpu cannot be woken up because it's sleep cannot be interrupted. Fix this by waking up periodically and returning from vm_handle_hlt() if TDF_ASTPENDING is set. Reported by: Leon Dang Sponsored by: Nahanni Systems
Diffstat (limited to 'sys/amd64/vmm/intel/vmx.c')
-rw-r--r--sys/amd64/vmm/intel/vmx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index 4f82ea6..54b2998 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -2559,7 +2559,7 @@ vmx_run(void *arg, int vcpu, register_t startrip, pmap_t pmap,
break;
}
- if (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)) {
+ if (vcpu_should_yield(vm, vcpu)) {
enable_intr();
vm_exit_astpending(vmx->vm, vcpu, vmcs_guest_rip());
vmx_astpending_trace(vmx, vcpu, vmexit->rip);
OpenPOWER on IntegriCloud