-/* $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>
*
*/
if (vrp->vrp_continue) {
if (copyin(vrp->vrp_exit, &vcpu->vc_exit,
- sizeof(union vm_exit)) == EFAULT) {
+ sizeof(struct vm_exit)) == EFAULT) {
return (EFAULT);
}
}
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;
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
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;
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 */
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;