summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2018-07-12 15:48:03 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2018-07-12 15:48:03 +0000
commitc8cda0bcdafeb63fb42c49d4f44ea15810a42c5b (patch)
tree4f07f1dcb5d2858de4aa2ee2af3a5129c9b122dc /sys/arch
parent86f5e277de08b8dbb2f9a672f7762c274f43b09f (diff)
unbreak i386 build, thanks to pd@ for noticing. Same diff as I committed
earlier for amd64
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/i386/vmm.c6
-rw-r--r--sys/arch/i386/include/vmmvar.h22
2 files changed, 19 insertions, 9 deletions
diff --git a/sys/arch/i386/i386/vmm.c b/sys/arch/i386/i386/vmm.c
index e271cb424c3..6552d7e3043 100644
--- a/sys/arch/i386/i386/vmm.c
+++ b/sys/arch/i386/i386/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.40 2018/07/11 18:04:18 nayden Exp $ */
+/* $OpenBSD: vmm.c,v 1.41 2018/07/12 15:48:02 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -3267,7 +3267,7 @@ vm_run(struct vm_run_params *vrp)
*/
if (vrp->vrp_continue) {
if (copyin(vrp->vrp_exit, &vcpu->vc_exit,
- sizeof(union vm_exit)) == EFAULT) {
+ sizeof(struct vm_exit)) == EFAULT) {
return (EFAULT);
}
}
@@ -3300,7 +3300,7 @@ vm_run(struct vm_run_params *vrp)
vcpu->vc_state = VCPU_STATE_STOPPED;
if (copyout(&vcpu->vc_exit, vrp->vrp_exit,
- sizeof(union vm_exit)) == EFAULT) {
+ sizeof(struct vm_exit)) == EFAULT) {
ret = EFAULT;
} else
ret = 0;
diff --git a/sys/arch/i386/include/vmmvar.h b/sys/arch/i386/include/vmmvar.h
index d47e9918b3b..8ffbd2ee4c3 100644
--- a/sys/arch/i386/include/vmmvar.h
+++ b/sys/arch/i386/include/vmmvar.h
@@ -295,10 +295,6 @@ struct vm_exit_inout {
uint32_t vei_data; /* data (for IN insns) */
};
-union vm_exit {
- struct vm_exit_inout vei; /* IN/OUT exit */
-};
-
/*
* struct vcpu_segment_info describes a segment + selector set, used
* in constructing the initial vcpu register content
@@ -361,6 +357,20 @@ struct vm_mem_range {
size_t vmr_size;
};
+/*
+ * struct vm_exit
+ *
+ * Contains VM exit information communicated to vmd(8). This information is
+ * gathered by vmm(4) from the CPU on each exit that requires help from vmd.
+ */
+struct vm_exit {
+ union {
+ struct vm_exit_inout vei; /* IN/OUT exit */
+ };
+
+ struct vcpu_reg_state vrs;
+};
+
struct vm_create_params {
/* Input parameters to VMM_IOC_CREATE */
size_t vcp_nmemranges;
@@ -386,7 +396,7 @@ struct vm_run_params {
uint16_t vrp_irq; /* IRQ to inject */
/* Input/output parameter to VMM_IOC_RUN */
- union vm_exit *vrp_exit; /* updated exit data */
+ struct vm_exit *vrp_exit; /* updated exit data */
/* Output parameter from VMM_IOC_RUN */
uint16_t vrp_exit_reason; /* exit reason */
@@ -722,7 +732,7 @@ struct vcpu {
uint8_t vc_virt_mode;
struct cpu_info *vc_last_pcpu;
- union vm_exit vc_exit;
+ struct vm_exit vc_exit;
uint16_t vc_intr;
uint8_t vc_irqready;