Deleted Added
full compact
vmm.h (268889) vmm.h (269008)
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 268889 2014-07-19 20:59:08Z neel $
26 * $FreeBSD: head/sys/amd64/include/vmm.h 269008 2014-07-23 04:28:51Z neel $
27 */
28
29#ifndef _VMM_H_
30#define _VMM_H_
31
32enum vm_suspend_how {
33 VM_SUSPEND_NONE,
34 VM_SUSPEND_RESET,

--- 74 unchanged lines hidden (view full) ---

109struct seg_desc;
110struct vm_exit;
111struct vm_run;
112struct vhpet;
113struct vioapic;
114struct vlapic;
115struct vmspace;
116struct vm_object;
27 */
28
29#ifndef _VMM_H_
30#define _VMM_H_
31
32enum vm_suspend_how {
33 VM_SUSPEND_NONE,
34 VM_SUSPEND_RESET,

--- 74 unchanged lines hidden (view full) ---

109struct seg_desc;
110struct vm_exit;
111struct vm_run;
112struct vhpet;
113struct vioapic;
114struct vlapic;
115struct vmspace;
116struct vm_object;
117struct vm_guest_paging;
117struct pmap;
118
119typedef int (*vmm_init_func_t)(int ipinum);
120typedef int (*vmm_cleanup_func_t)(void);
121typedef void (*vmm_resume_func_t)(void);
122typedef void * (*vmi_init_func_t)(struct vm *vm, struct pmap *pmap);
123typedef int (*vmi_run_func_t)(void *vmi, int vcpu, register_t rip,
124 struct pmap *pmap, void *rendezvous_cookie,

--- 187 unchanged lines hidden (view full) ---

312 * and non-zero otherwise.
313 */
314int vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *info);
315
316int vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2);
317
318void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */
319void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */
118struct pmap;
119
120typedef int (*vmm_init_func_t)(int ipinum);
121typedef int (*vmm_cleanup_func_t)(void);
122typedef void (*vmm_resume_func_t)(void);
123typedef void * (*vmi_init_func_t)(struct vm *vm, struct pmap *pmap);
124typedef int (*vmi_run_func_t)(void *vmi, int vcpu, register_t rip,
125 struct pmap *pmap, void *rendezvous_cookie,

--- 187 unchanged lines hidden (view full) ---

313 * and non-zero otherwise.
314 */
315int vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *info);
316
317int vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2);
318
319void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */
320void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */
321void vm_inject_ac(struct vm *vm, int vcpuid, int errcode); /* #AC */
322void vm_inject_ss(struct vm *vm, int vcpuid, int errcode); /* #SS */
320void vm_inject_pf(struct vm *vm, int vcpuid, int error_code, uint64_t cr2);
321
322enum vm_reg_name vm_segment_name(int seg_encoding);
323
323void vm_inject_pf(struct vm *vm, int vcpuid, int error_code, uint64_t cr2);
324
325enum vm_reg_name vm_segment_name(int seg_encoding);
326
327struct vm_copyinfo {
328 uint64_t gpa;
329 size_t len;
330 void *hva;
331 void *cookie;
332};
333
334/*
335 * Set up 'copyinfo[]' to copy to/from guest linear address space starting
336 * at 'gla' and 'len' bytes long. The 'prot' should be set to PROT_READ for
337 * a copyin or PROT_WRITE for a copyout.
338 *
339 * Returns 0 on success.
340 * Returns 1 if an exception was injected into the guest.
341 * Returns -1 otherwise.
342 *
343 * The 'copyinfo[]' can be passed to 'vm_copyin()' or 'vm_copyout()' only if
344 * the return value is 0. The 'copyinfo[]' resources should be freed by calling
345 * 'vm_copy_teardown()' after the copy is done.
346 */
347int vm_copy_setup(struct vm *vm, int vcpuid, struct vm_guest_paging *paging,
348 uint64_t gla, size_t len, int prot, struct vm_copyinfo *copyinfo,
349 int num_copyinfo);
350void vm_copy_teardown(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo,
351 int num_copyinfo);
352void vm_copyin(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo,
353 void *kaddr, size_t len);
354void vm_copyout(struct vm *vm, int vcpuid, const void *kaddr,
355 struct vm_copyinfo *copyinfo, size_t len);
324#endif /* KERNEL */
325
326#define VM_MAXCPU 16 /* maximum virtual cpus */
327
328/*
329 * Identifiers for optional vmm capabilities
330 */
331enum vm_cap_type {

--- 219 unchanged lines hidden ---
356#endif /* KERNEL */
357
358#define VM_MAXCPU 16 /* maximum virtual cpus */
359
360/*
361 * Identifiers for optional vmm capabilities
362 */
363enum vm_cap_type {

--- 219 unchanged lines hidden ---