vmm_instruction_emul.h (284899) | vmm_instruction_emul.h (284900) |
---|---|
1/*- 2 * Copyright (c) 2012 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) 2012 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: stable/10/sys/amd64/include/vmm_instruction_emul.h 284899 2015-06-28 01:21:55Z neel $ | 26 * $FreeBSD: stable/10/sys/amd64/include/vmm_instruction_emul.h 284900 2015-06-28 03:22:26Z neel $ |
27 */ 28 29#ifndef _VMM_INSTRUCTION_EMUL_H_ 30#define _VMM_INSTRUCTION_EMUL_H_ 31 32#include <sys/mman.h> 33 34/* --- 41 unchanged lines hidden (view full) --- 76#ifdef _KERNEL 77/* 78 * APIs to fetch and decode the instruction from nested page fault handler. 79 * 80 * 'vie' must be initialized before calling 'vmm_fetch_instruction()' 81 */ 82int vmm_fetch_instruction(struct vm *vm, int cpuid, 83 struct vm_guest_paging *guest_paging, | 27 */ 28 29#ifndef _VMM_INSTRUCTION_EMUL_H_ 30#define _VMM_INSTRUCTION_EMUL_H_ 31 32#include <sys/mman.h> 33 34/* --- 41 unchanged lines hidden (view full) --- 76#ifdef _KERNEL 77/* 78 * APIs to fetch and decode the instruction from nested page fault handler. 79 * 80 * 'vie' must be initialized before calling 'vmm_fetch_instruction()' 81 */ 82int vmm_fetch_instruction(struct vm *vm, int cpuid, 83 struct vm_guest_paging *guest_paging, |
84 uint64_t rip, int inst_length, struct vie *vie); | 84 uint64_t rip, int inst_length, struct vie *vie, 85 int *is_fault); |
85 86/* 87 * Translate the guest linear address 'gla' to a guest physical address. 88 * | 86 87/* 88 * Translate the guest linear address 'gla' to a guest physical address. 89 * |
89 * Returns 0 on success and '*gpa' contains the result of the translation. 90 * Returns 1 if an exception was injected into the guest. 91 * Returns -1 otherwise. | 90 * retval is_fault Interpretation 91 * 0 0 'gpa' contains result of the translation 92 * 0 1 An exception was injected into the guest 93 * EFAULT N/A An unrecoverable hypervisor error occurred |
92 */ 93int vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, | 94 */ 95int vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, |
94 uint64_t gla, int prot, uint64_t *gpa); | 96 uint64_t gla, int prot, uint64_t *gpa, int *is_fault); |
95 96void vie_init(struct vie *vie, const char *inst_bytes, int inst_length); 97 98/* 99 * Decode the instruction fetched into 'vie' so it can be emulated. 100 * 101 * 'gla' is the guest linear address provided by the hardware assist 102 * that caused the nested page table fault. It is used to verify that --- 12 unchanged lines hidden --- | 97 98void vie_init(struct vie *vie, const char *inst_bytes, int inst_length); 99 100/* 101 * Decode the instruction fetched into 'vie' so it can be emulated. 102 * 103 * 'gla' is the guest linear address provided by the hardware assist 104 * that caused the nested page table fault. It is used to verify that --- 12 unchanged lines hidden --- |