summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include/vmmvar.h
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2016-01-04 01:35:57 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2016-01-04 01:35:57 +0000
commit8104085d9ac1f416e15d464c603b8ac7ea435857 (patch)
treeb70f720fae9fd14af4a7a89d4674a8de09cef1e4 /sys/arch/amd64/include/vmmvar.h
parent04e4c2dda730ddc5a66b0eb6e341f5544d6c1117 (diff)
Do proper termination of VMs by doing proper VCPU run state management.
This should fix some of the odd termination errors people have been seeing (vmctl status showing running VMs after they have exited/crashed, and invalid instruction panics on vmptrld during certain races) This diff also implements dropping the biglock when running a VCPU, and reacquiring the lock as needed based on the type of exit (normal vs. external interrupt) diff supplied by Stefan Kempf <sn.kempf at t-online.de>, many thanks!
Diffstat (limited to 'sys/arch/amd64/include/vmmvar.h')
-rw-r--r--sys/arch/amd64/include/vmmvar.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/arch/amd64/include/vmmvar.h b/sys/arch/amd64/include/vmmvar.h
index cf52ea6940f..2a56036c393 100644
--- a/sys/arch/amd64/include/vmmvar.h
+++ b/sys/arch/amd64/include/vmmvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmmvar.h,v 1.6 2015/12/17 09:29:28 mlarkin Exp $ */
+/* $OpenBSD: vmmvar.h,v 1.7 2016/01/04 01:35:56 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -103,8 +103,9 @@
enum {
VCPU_STATE_STOPPED,
VCPU_STATE_RUNNING,
- VCPU_STATE_REQSTOP,
- VCPU_STATE_UNKNOWN
+ VCPU_STATE_REQTERM,
+ VCPU_STATE_TERMINATED,
+ VCPU_STATE_UNKNOWN,
};
enum {
@@ -357,11 +358,11 @@ struct vcpu {
struct vm *vc_parent;
uint32_t vc_id;
+ u_int vc_state;
SLIST_ENTRY(vcpu) vc_vcpu_link;
vaddr_t vc_hsa_stack_va;
uint8_t vc_virt_mode;
- uint8_t vc_state;
struct cpu_info *vc_last_pcpu;
union vm_exit vc_exit;