summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormlarkin <mlarkin@openbsd.org>2016-03-09 08:06:59 +0000
committermlarkin <mlarkin@openbsd.org>2016-03-09 08:06:59 +0000
commit1180136e7085bcbff0befad547d41eacdf12d4c3 (patch)
tree48194d417145b75ae0786a4a2775dc7ebec14767
parentInduce an exit in a running vcpu if an interrupt is asserted (pending). (diff)
downloadwireguard-openbsd-1180136e7085bcbff0befad547d41eacdf12d4c3.tar.xz
wireguard-openbsd-1180136e7085bcbff0befad547d41eacdf12d4c3.zip
Add a comment to the vcpu state enum to remind people there is a matching
conversion function in vmm.c Increase the size of the pending interrupt field from uint8_t to uint16_t.
-rw-r--r--sys/arch/amd64/include/vmmvar.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/arch/amd64/include/vmmvar.h b/sys/arch/amd64/include/vmmvar.h
index 9baef59bc25..3b863df0580 100644
--- a/sys/arch/amd64/include/vmmvar.h
+++ b/sys/arch/amd64/include/vmmvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmmvar.h,v 1.9 2016/02/20 20:49:08 mlarkin Exp $ */
+/* $OpenBSD: vmmvar.h,v 1.10 2016/03/09 08:06:59 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -100,6 +100,11 @@
#define VM_EXIT_TERMINATED 0xFFFE
#define VM_EXIT_NONE 0xFFFF
+/*
+ * VCPU state values. Note that there is a conversion function in vmm.c
+ * (vcpu_state_decode) that converts these to human readable strings,
+ * so this enum and vcpu_state_decode should be kept in sync.
+ */
enum {
VCPU_STATE_STOPPED,
VCPU_STATE_RUNNING,
@@ -251,7 +256,7 @@ struct vm_intr_params {
/* Input parameters to VMM_IOC_INTR */
uint32_t vip_vm_id;
uint32_t vip_vcpu_id;
- uint8_t vip_intr;
+ uint16_t vip_intr;
};
/* IOCTL definitions */
@@ -376,7 +381,7 @@ struct vcpu {
struct cpu_info *vc_last_pcpu;
union vm_exit vc_exit;
- uint8_t vc_intr;
+ uint16_t vc_intr;
/* VMX only */
uint64_t vc_vmx_basic;