vmx_genassym.c revision 268953
1147476Sdumbbell/*- 2147476Sdumbbell * Copyright (c) 2011 NetApp, Inc. 3147476Sdumbbell * All rights reserved. 4147476Sdumbbell * 5147476Sdumbbell * Redistribution and use in source and binary forms, with or without 6147476Sdumbbell * modification, are permitted provided that the following conditions 7147476Sdumbbell * are met: 8147476Sdumbbell * 1. Redistributions of source code must retain the above copyright 9147476Sdumbbell * notice, this list of conditions and the following disclaimer. 10147476Sdumbbell * 2. Redistributions in binary form must reproduce the above copyright 11147476Sdumbbell * notice, this list of conditions and the following disclaimer in the 12147476Sdumbbell * documentation and/or other materials provided with the distribution. 13147476Sdumbbell * 14147476Sdumbbell * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND 15147476Sdumbbell * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16147476Sdumbbell * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17147476Sdumbbell * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE 18147476Sdumbbell * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19147476Sdumbbell * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20147476Sdumbbell * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21147476Sdumbbell * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22147476Sdumbbell * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23147476Sdumbbell * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24147476Sdumbbell * SUCH DAMAGE. 25147476Sdumbbell * 26147476Sdumbbell * $FreeBSD: stable/10/sys/amd64/vmm/intel/vmx_genassym.c 268953 2014-07-21 19:08:02Z jhb $ 27147476Sdumbbell */ 28147476Sdumbbell 29147476Sdumbbell#include <sys/cdefs.h> 30147476Sdumbbell__FBSDID("$FreeBSD: stable/10/sys/amd64/vmm/intel/vmx_genassym.c 268953 2014-07-21 19:08:02Z jhb $"); 31147476Sdumbbell 32147476Sdumbbell#include <sys/param.h> 33147476Sdumbbell#include <sys/systm.h> 34147476Sdumbbell#include <sys/proc.h> 35147476Sdumbbell#include <sys/assym.h> 36147476Sdumbbell 37147476Sdumbbell#include <vm/vm.h> 38147476Sdumbbell#include <vm/pmap.h> 39147476Sdumbbell 40147476Sdumbbell#include <machine/vmm.h> 41147476Sdumbbell#include "vmx_cpufunc.h" 42147476Sdumbbell#include "vmx.h" 43151897Srwatson 44151897SrwatsonASSYM(VMXCTX_GUEST_RDI, offsetof(struct vmxctx, guest_rdi)); 45151897SrwatsonASSYM(VMXCTX_GUEST_RSI, offsetof(struct vmxctx, guest_rsi)); 46147476SdumbbellASSYM(VMXCTX_GUEST_RDX, offsetof(struct vmxctx, guest_rdx)); 47147476SdumbbellASSYM(VMXCTX_GUEST_RCX, offsetof(struct vmxctx, guest_rcx)); 48147476SdumbbellASSYM(VMXCTX_GUEST_R8, offsetof(struct vmxctx, guest_r8)); 49147476SdumbbellASSYM(VMXCTX_GUEST_R9, offsetof(struct vmxctx, guest_r9)); 50147476SdumbbellASSYM(VMXCTX_GUEST_RAX, offsetof(struct vmxctx, guest_rax)); 51147476SdumbbellASSYM(VMXCTX_GUEST_RBX, offsetof(struct vmxctx, guest_rbx)); 52230725SmckusickASSYM(VMXCTX_GUEST_RBP, offsetof(struct vmxctx, guest_rbp)); 53147476SdumbbellASSYM(VMXCTX_GUEST_R10, offsetof(struct vmxctx, guest_r10)); 54147476SdumbbellASSYM(VMXCTX_GUEST_R11, offsetof(struct vmxctx, guest_r11)); 55213664SkibASSYM(VMXCTX_GUEST_R12, offsetof(struct vmxctx, guest_r12)); 56147476SdumbbellASSYM(VMXCTX_GUEST_R13, offsetof(struct vmxctx, guest_r13)); 57147476SdumbbellASSYM(VMXCTX_GUEST_R14, offsetof(struct vmxctx, guest_r14)); 58147476SdumbbellASSYM(VMXCTX_GUEST_R15, offsetof(struct vmxctx, guest_r15)); 59147476SdumbbellASSYM(VMXCTX_GUEST_CR2, offsetof(struct vmxctx, guest_cr2)); 60147476Sdumbbell 61213664SkibASSYM(VMXCTX_HOST_R15, offsetof(struct vmxctx, host_r15)); 62147476SdumbbellASSYM(VMXCTX_HOST_R14, offsetof(struct vmxctx, host_r14)); 63147476SdumbbellASSYM(VMXCTX_HOST_R13, offsetof(struct vmxctx, host_r13)); 64213664SkibASSYM(VMXCTX_HOST_R12, offsetof(struct vmxctx, host_r12)); 65147476SdumbbellASSYM(VMXCTX_HOST_RBP, offsetof(struct vmxctx, host_rbp)); 66147476SdumbbellASSYM(VMXCTX_HOST_RSP, offsetof(struct vmxctx, host_rsp)); 67147476SdumbbellASSYM(VMXCTX_HOST_RBX, offsetof(struct vmxctx, host_rbx)); 68147476Sdumbbell 69147476SdumbbellASSYM(VMXCTX_INST_FAIL_STATUS, offsetof(struct vmxctx, inst_fail_status)); 70147476SdumbbellASSYM(VMXCTX_PMAP, offsetof(struct vmxctx, pmap)); 71147476Sdumbbell 72147476SdumbbellASSYM(VMX_EPTGEN, offsetof(struct vmx, eptgen)); 73147476SdumbbellASSYM(VMX_EPTP, offsetof(struct vmx, eptp)); 74147476Sdumbbell 75191990SattilioASSYM(VM_FAIL_INVALID, VM_FAIL_INVALID); 76147476SdumbbellASSYM(VM_FAIL_VALID, VM_FAIL_VALID); 77147476SdumbbellASSYM(VMX_GUEST_VMEXIT, VMX_GUEST_VMEXIT); 78147476SdumbbellASSYM(VMX_VMRESUME_ERROR, VMX_VMRESUME_ERROR); 79184413StraszASSYM(VMX_VMLAUNCH_ERROR, VMX_VMLAUNCH_ERROR); 80147476SdumbbellASSYM(VMX_INVEPT_ERROR, VMX_INVEPT_ERROR); 81147476Sdumbbell 82147476SdumbbellASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); 83147476Sdumbbell 84147476SdumbbellASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); 85147476SdumbbellASSYM(PM_EPTGEN, offsetof(struct pmap, pm_eptgen)); 86191990Sattilio 87147476SdumbbellASSYM(KERNEL_SS, GSEL(GDATA_SEL, SEL_KPL)); 88191990SattilioASSYM(KERNEL_CS, GSEL(GCODE_SEL, SEL_KPL)); 89147476Sdumbbell