From f7ff493b267e1377052999cf9ca3903ec9e1a23a Mon Sep 17 00:00:00 2001 From: mlarkin Date: Thu, 12 Jul 2018 15:48:02 +0000 Subject: [PATCH] unbreak i386 build, thanks to pd@ for noticing. Same diff as I committed earlier for amd64 --- sys/arch/i386/i386/vmm.c | 6 +++--- sys/arch/i386/include/vmmvar.h | 22 ++++++++++++++++------ 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 * @@ -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; -- 2.20.1