vmmapi.h (280929) | vmmapi.h (282558) |
---|---|
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/lib/libvmmapi/vmmapi.h 280929 2015-04-01 00:15:31Z tychon $ | 26 * $FreeBSD: head/lib/libvmmapi/vmmapi.h 282558 2015-05-06 16:25:20Z neel $ |
27 */ 28 29#ifndef _VMMAPI_H_ 30#define _VMMAPI_H_ 31 32#include <sys/param.h> 33#include <sys/cpuset.h> 34 --- 24 unchanged lines hidden (view full) --- 59void vm_destroy(struct vmctx *ctx); 60int vm_parse_memsize(const char *optarg, size_t *memsize); 61int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len, 62 int *wired); 63int vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s); 64void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len); 65int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num); 66int vm_gla2gpa(struct vmctx *, int vcpuid, struct vm_guest_paging *paging, | 27 */ 28 29#ifndef _VMMAPI_H_ 30#define _VMMAPI_H_ 31 32#include <sys/param.h> 33#include <sys/cpuset.h> 34 --- 24 unchanged lines hidden (view full) --- 59void vm_destroy(struct vmctx *ctx); 60int vm_parse_memsize(const char *optarg, size_t *memsize); 61int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len, 62 int *wired); 63int vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s); 64void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len); 65int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num); 66int vm_gla2gpa(struct vmctx *, int vcpuid, struct vm_guest_paging *paging, |
67 uint64_t gla, int prot, uint64_t *gpa); | 67 uint64_t gla, int prot, uint64_t *gpa, int *fault); |
68uint32_t vm_get_lowmem_limit(struct vmctx *ctx); 69void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit); 70void vm_set_memflags(struct vmctx *ctx, int flags); 71size_t vm_get_lowmem_size(struct vmctx *ctx); 72size_t vm_get_highmem_size(struct vmctx *ctx); 73int vm_set_desc(struct vmctx *ctx, int vcpu, int reg, 74 uint64_t base, uint32_t limit, uint32_t access); 75int vm_get_desc(struct vmctx *ctx, int vcpu, int reg, --- 50 unchanged lines hidden (view full) --- 126int vm_get_x2apic_state(struct vmctx *ctx, int vcpu, enum x2apic_state *s); 127int vm_set_x2apic_state(struct vmctx *ctx, int vcpu, enum x2apic_state s); 128 129int vm_get_hpet_capabilities(struct vmctx *ctx, uint32_t *capabilities); 130 131/* 132 * Translate the GLA range [gla,gla+len) into GPA segments in 'iov'. 133 * The 'iovcnt' should be big enough to accomodate all GPA segments. | 68uint32_t vm_get_lowmem_limit(struct vmctx *ctx); 69void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit); 70void vm_set_memflags(struct vmctx *ctx, int flags); 71size_t vm_get_lowmem_size(struct vmctx *ctx); 72size_t vm_get_highmem_size(struct vmctx *ctx); 73int vm_set_desc(struct vmctx *ctx, int vcpu, int reg, 74 uint64_t base, uint32_t limit, uint32_t access); 75int vm_get_desc(struct vmctx *ctx, int vcpu, int reg, --- 50 unchanged lines hidden (view full) --- 126int vm_get_x2apic_state(struct vmctx *ctx, int vcpu, enum x2apic_state *s); 127int vm_set_x2apic_state(struct vmctx *ctx, int vcpu, enum x2apic_state s); 128 129int vm_get_hpet_capabilities(struct vmctx *ctx, uint32_t *capabilities); 130 131/* 132 * Translate the GLA range [gla,gla+len) into GPA segments in 'iov'. 133 * The 'iovcnt' should be big enough to accomodate all GPA segments. |
134 * Returns 0 on success, 1 on a guest fault condition and -1 otherwise. | 134 * 135 * retval fault Interpretation 136 * 0 0 Success 137 * 0 1 An exception was injected into the guest 138 * EFAULT N/A Error |
135 */ 136int vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *pg, | 139 */ 140int vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *pg, |
137 uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt); | 141 uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt, 142 int *fault); |
138void vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *guest_iov, 139 void *host_dst, size_t len); 140void vm_copyout(struct vmctx *ctx, int vcpu, const void *host_src, 141 struct iovec *guest_iov, size_t len); 142void vm_copy_teardown(struct vmctx *ctx, int vcpu, struct iovec *iov, 143 int iovcnt); 144 145/* RTC */ --- 23 unchanged lines hidden --- | 143void vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *guest_iov, 144 void *host_dst, size_t len); 145void vm_copyout(struct vmctx *ctx, int vcpu, const void *host_src, 146 struct iovec *guest_iov, size_t len); 147void vm_copy_teardown(struct vmctx *ctx, int vcpu, struct iovec *iov, 148 int iovcnt); 149 150/* RTC */ --- 23 unchanged lines hidden --- |