vmm.h (259782) | vmm.h (259863) |
---|---|
1/*- 2 * Copyright (c) 2011 NetApp, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2011 NetApp, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/amd64/include/vmm.h 259782 2013-12-23 19:48:22Z jhb $ | 26 * $FreeBSD: head/sys/amd64/include/vmm.h 259863 2013-12-25 06:46:31Z neel $ |
27 */ 28 29#ifndef _VMM_H_ 30#define _VMM_H_ 31 32#ifdef _KERNEL 33 34#define VM_MAX_NAMELEN 32 --- 29 unchanged lines hidden (view full) --- 64 struct seg_desc *desc); 65typedef int (*vmi_inject_event_t)(void *vmi, int vcpu, 66 int type, int vector, 67 uint32_t code, int code_valid); 68typedef int (*vmi_get_cap_t)(void *vmi, int vcpu, int num, int *retval); 69typedef int (*vmi_set_cap_t)(void *vmi, int vcpu, int num, int val); 70typedef struct vmspace * (*vmi_vmspace_alloc)(vm_offset_t min, vm_offset_t max); 71typedef void (*vmi_vmspace_free)(struct vmspace *vmspace); | 27 */ 28 29#ifndef _VMM_H_ 30#define _VMM_H_ 31 32#ifdef _KERNEL 33 34#define VM_MAX_NAMELEN 32 --- 29 unchanged lines hidden (view full) --- 64 struct seg_desc *desc); 65typedef int (*vmi_inject_event_t)(void *vmi, int vcpu, 66 int type, int vector, 67 uint32_t code, int code_valid); 68typedef int (*vmi_get_cap_t)(void *vmi, int vcpu, int num, int *retval); 69typedef int (*vmi_set_cap_t)(void *vmi, int vcpu, int num, int val); 70typedef struct vmspace * (*vmi_vmspace_alloc)(vm_offset_t min, vm_offset_t max); 71typedef void (*vmi_vmspace_free)(struct vmspace *vmspace); |
72typedef struct vlapic * (*vmi_vlapic_init)(void *vmi, int vcpu); 73typedef void (*vmi_vlapic_cleanup)(void *vmi, struct vlapic *vlapic); |
|
72 73struct vmm_ops { 74 vmm_init_func_t init; /* module wide initialization */ 75 vmm_cleanup_func_t cleanup; 76 vmm_resume_func_t resume; 77 78 vmi_init_func_t vminit; /* vm-specific initialization */ 79 vmi_run_func_t vmrun; 80 vmi_cleanup_func_t vmcleanup; 81 vmi_get_register_t vmgetreg; 82 vmi_set_register_t vmsetreg; 83 vmi_get_desc_t vmgetdesc; 84 vmi_set_desc_t vmsetdesc; 85 vmi_inject_event_t vminject; 86 vmi_get_cap_t vmgetcap; 87 vmi_set_cap_t vmsetcap; 88 vmi_vmspace_alloc vmspace_alloc; 89 vmi_vmspace_free vmspace_free; | 74 75struct vmm_ops { 76 vmm_init_func_t init; /* module wide initialization */ 77 vmm_cleanup_func_t cleanup; 78 vmm_resume_func_t resume; 79 80 vmi_init_func_t vminit; /* vm-specific initialization */ 81 vmi_run_func_t vmrun; 82 vmi_cleanup_func_t vmcleanup; 83 vmi_get_register_t vmgetreg; 84 vmi_set_register_t vmsetreg; 85 vmi_get_desc_t vmgetdesc; 86 vmi_set_desc_t vmsetdesc; 87 vmi_inject_event_t vminject; 88 vmi_get_cap_t vmgetcap; 89 vmi_set_cap_t vmsetcap; 90 vmi_vmspace_alloc vmspace_alloc; 91 vmi_vmspace_free vmspace_free; |
92 vmi_vlapic_init vlapic_init; 93 vmi_vlapic_cleanup vlapic_cleanup; |
|
90}; 91 92extern struct vmm_ops vmm_ops_intel; 93extern struct vmm_ops vmm_ops_amd; 94 95int vm_create(const char *name, struct vm **retvm); 96void vm_destroy(struct vm *vm); 97const char *vm_name(struct vm *vm); --- 56 unchanged lines hidden (view full) --- 154 155static int __inline 156vcpu_is_running(struct vm *vm, int vcpu, int *hostcpu) 157{ 158 return (vcpu_get_state(vm, vcpu, hostcpu) == VCPU_RUNNING); 159} 160 161void *vcpu_stats(struct vm *vm, int vcpu); | 94}; 95 96extern struct vmm_ops vmm_ops_intel; 97extern struct vmm_ops vmm_ops_amd; 98 99int vm_create(const char *name, struct vm **retvm); 100void vm_destroy(struct vm *vm); 101const char *vm_name(struct vm *vm); --- 56 unchanged lines hidden (view full) --- 158 159static int __inline 160vcpu_is_running(struct vm *vm, int vcpu, int *hostcpu) 161{ 162 return (vcpu_get_state(vm, vcpu, hostcpu) == VCPU_RUNNING); 163} 164 165void *vcpu_stats(struct vm *vm, int vcpu); |
162void vcpu_notify_event(struct vm *vm, int vcpuid); | 166void vcpu_notify_event(struct vm *vm, int vcpuid, bool lapic_intr); |
163struct vmspace *vm_get_vmspace(struct vm *vm); 164int vm_assign_pptdev(struct vm *vm, int bus, int slot, int func); 165int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func); 166#endif /* KERNEL */ 167 168#include <machine/vmm_instruction_emul.h> 169 170#define VM_MAXCPU 16 /* maximum virtual cpus */ --- 150 unchanged lines hidden --- | 167struct vmspace *vm_get_vmspace(struct vm *vm); 168int vm_assign_pptdev(struct vm *vm, int bus, int slot, int func); 169int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func); 170#endif /* KERNEL */ 171 172#include <machine/vmm_instruction_emul.h> 173 174#define VM_MAXCPU 16 /* maximum virtual cpus */ --- 150 unchanged lines hidden --- |