summaryrefslogtreecommitdiffstats
path: root/sys/amd64/vmm/intel/vmx.c
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2014-04-28 22:06:40 +0000
committerneel <neel@FreeBSD.org>2014-04-28 22:06:40 +0000
commitb616a9a2e4a5c8e20ca308fb6e309583803cb19c (patch)
tree2a5755c72feac26b7524cca10dc7e5475e332ee8 /sys/amd64/vmm/intel/vmx.c
parent8820383a981da45b9f3593b94de0c67e3856d71c (diff)
downloadFreeBSD-src-b616a9a2e4a5c8e20ca308fb6e309583803cb19c.zip
FreeBSD-src-b616a9a2e4a5c8e20ca308fb6e309583803cb19c.tar.gz
Allow a virtual machine to be forcibly reset or powered off. This is done
by adding an argument to the VM_SUSPEND ioctl that specifies how the virtual machine should be suspended, viz. VM_SUSPEND_RESET or VM_SUSPEND_POWEROFF. The disposition of VM_SUSPEND is also made available to the exit handler via the 'u.suspended' member of 'struct vm_exit'. This capability is exposed via the '--force-reset' and '--force-poweroff' arguments to /usr/sbin/bhyvectl. Discussed with: grehan@
Diffstat (limited to 'sys/amd64/vmm/intel/vmx.c')
-rw-r--r--sys/amd64/vmm/intel/vmx.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index 286eba9..4df127f 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -2045,16 +2045,6 @@ vmx_exit_rendezvous(struct vmx *vmx, int vcpu, struct vm_exit *vmexit)
}
static __inline int
-vmx_exit_suspended(struct vmx *vmx, int vcpu, struct vm_exit *vmexit)
-{
-
- vmexit->rip = vmcs_guest_rip();
- vmexit->inst_length = 0;
- vmexit->exitcode = VM_EXITCODE_SUSPENDED;
- return (UNHANDLED);
-}
-
-static __inline int
vmx_exit_inst_error(struct vmxctx *vmxctx, int rc, struct vm_exit *vmexit)
{
@@ -2173,7 +2163,8 @@ vmx_run(void *arg, int vcpu, register_t startrip, pmap_t pmap,
disable_intr();
if (vcpu_suspended(suspend_cookie)) {
enable_intr();
- handled = vmx_exit_suspended(vmx, vcpu, vmexit);
+ vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip());
+ handled = UNHANDLED;
break;
}
OpenPOWER on IntegriCloud