unbreak i386 build, thanks to pd@ for noticing. Same diff as I committed
authormlarkin <mlarkin@openbsd.org>
Thu, 12 Jul 2018 15:48:02 +0000 (15:48 +0000)
committermlarkin <mlarkin@openbsd.org>
Thu, 12 Jul 2018 15:48:02 +0000 (15:48 +0000)
earlier for amd64

sys/arch/i386/i386/vmm.c
sys/arch/i386/include/vmmvar.h

index e271cb4..6552d7e 100644 (file)
@@ -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;
index d47e991..8ffbd2e 100644 (file)
@@ -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;