vmx_genassym.c revision 262352
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 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE 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/vmm/intel/vmx_genassym.c 262352 2014-02-23 01:34:40Z jhb $ 27 */ 28 29#include <sys/cdefs.h> 30__FBSDID("$FreeBSD: stable/10/sys/amd64/vmm/intel/vmx_genassym.c 262352 2014-02-23 01:34:40Z jhb $"); 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/malloc.h> 35#include <sys/proc.h> 36#include <sys/assym.h> 37 38#include <vm/vm.h> 39#include <vm/pmap.h> 40 41#include <machine/vmm.h> 42#include "vmx_cpufunc.h" 43#include "vmx.h" 44 45ASSYM(VMXCTX_TMPSTKTOP, offsetof(struct vmxctx, tmpstktop)); 46ASSYM(VMXCTX_GUEST_RDI, offsetof(struct vmxctx, guest_rdi)); 47ASSYM(VMXCTX_GUEST_RSI, offsetof(struct vmxctx, guest_rsi)); 48ASSYM(VMXCTX_GUEST_RDX, offsetof(struct vmxctx, guest_rdx)); 49ASSYM(VMXCTX_GUEST_RCX, offsetof(struct vmxctx, guest_rcx)); 50ASSYM(VMXCTX_GUEST_R8, offsetof(struct vmxctx, guest_r8)); 51ASSYM(VMXCTX_GUEST_R9, offsetof(struct vmxctx, guest_r9)); 52ASSYM(VMXCTX_GUEST_RAX, offsetof(struct vmxctx, guest_rax)); 53ASSYM(VMXCTX_GUEST_RBX, offsetof(struct vmxctx, guest_rbx)); 54ASSYM(VMXCTX_GUEST_RBP, offsetof(struct vmxctx, guest_rbp)); 55ASSYM(VMXCTX_GUEST_R10, offsetof(struct vmxctx, guest_r10)); 56ASSYM(VMXCTX_GUEST_R11, offsetof(struct vmxctx, guest_r11)); 57ASSYM(VMXCTX_GUEST_R12, offsetof(struct vmxctx, guest_r12)); 58ASSYM(VMXCTX_GUEST_R13, offsetof(struct vmxctx, guest_r13)); 59ASSYM(VMXCTX_GUEST_R14, offsetof(struct vmxctx, guest_r14)); 60ASSYM(VMXCTX_GUEST_R15, offsetof(struct vmxctx, guest_r15)); 61ASSYM(VMXCTX_GUEST_CR2, offsetof(struct vmxctx, guest_cr2)); 62 63ASSYM(VMXCTX_HOST_R15, offsetof(struct vmxctx, host_r15)); 64ASSYM(VMXCTX_HOST_R14, offsetof(struct vmxctx, host_r14)); 65ASSYM(VMXCTX_HOST_R13, offsetof(struct vmxctx, host_r13)); 66ASSYM(VMXCTX_HOST_R12, offsetof(struct vmxctx, host_r12)); 67ASSYM(VMXCTX_HOST_RBP, offsetof(struct vmxctx, host_rbp)); 68ASSYM(VMXCTX_HOST_RSP, offsetof(struct vmxctx, host_rsp)); 69ASSYM(VMXCTX_HOST_RBX, offsetof(struct vmxctx, host_rbx)); 70ASSYM(VMXCTX_HOST_RIP, offsetof(struct vmxctx, host_rip)); 71 72ASSYM(VMXCTX_LAUNCH_ERROR, offsetof(struct vmxctx, launch_error)); 73ASSYM(VMXCTX_EPTGEN, offsetof(struct vmxctx, eptgen)); 74 75ASSYM(VMXCTX_PMAP, offsetof(struct vmxctx, pmap)); 76ASSYM(VMXCTX_EPTP, offsetof(struct vmxctx, eptp)); 77 78ASSYM(VM_SUCCESS, VM_SUCCESS); 79ASSYM(VM_FAIL_INVALID, VM_FAIL_INVALID); 80ASSYM(VM_FAIL_VALID, VM_FAIL_VALID); 81 82ASSYM(VMX_RETURN_DIRECT, VMX_RETURN_DIRECT); 83ASSYM(VMX_RETURN_LONGJMP, VMX_RETURN_LONGJMP); 84ASSYM(VMX_RETURN_VMRESUME, VMX_RETURN_VMRESUME); 85ASSYM(VMX_RETURN_VMLAUNCH, VMX_RETURN_VMLAUNCH); 86ASSYM(VMX_RETURN_AST, VMX_RETURN_AST); 87ASSYM(VMX_RETURN_INVEPT, VMX_RETURN_INVEPT); 88 89ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); 90ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); 91ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); 92ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread)); 93ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); 94 95ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); 96ASSYM(PM_EPTGEN, offsetof(struct pmap, pm_eptgen)); 97