Path: blob/main/sys/amd64/vmm/intel/vmx_genassym.c
39536 views
/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2011 NetApp, Inc.4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE19* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL20* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS21* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)22* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT23* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY24* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF25* SUCH DAMAGE.26*/2728#include <sys/param.h>29#include <sys/systm.h>30#include <sys/proc.h>31#include <sys/assym.h>3233#include <vm/vm.h>34#include <vm/pmap.h>35#include <vm/vm_param.h>3637#include <machine/vmm.h>38#include "vmx_cpufunc.h"39#include "vmx.h"4041ASSYM(VMXCTX_GUEST_RDI, offsetof(struct vmxctx, guest_rdi));42ASSYM(VMXCTX_GUEST_RSI, offsetof(struct vmxctx, guest_rsi));43ASSYM(VMXCTX_GUEST_RDX, offsetof(struct vmxctx, guest_rdx));44ASSYM(VMXCTX_GUEST_RCX, offsetof(struct vmxctx, guest_rcx));45ASSYM(VMXCTX_GUEST_R8, offsetof(struct vmxctx, guest_r8));46ASSYM(VMXCTX_GUEST_R9, offsetof(struct vmxctx, guest_r9));47ASSYM(VMXCTX_GUEST_RAX, offsetof(struct vmxctx, guest_rax));48ASSYM(VMXCTX_GUEST_RBX, offsetof(struct vmxctx, guest_rbx));49ASSYM(VMXCTX_GUEST_RBP, offsetof(struct vmxctx, guest_rbp));50ASSYM(VMXCTX_GUEST_R10, offsetof(struct vmxctx, guest_r10));51ASSYM(VMXCTX_GUEST_R11, offsetof(struct vmxctx, guest_r11));52ASSYM(VMXCTX_GUEST_R12, offsetof(struct vmxctx, guest_r12));53ASSYM(VMXCTX_GUEST_R13, offsetof(struct vmxctx, guest_r13));54ASSYM(VMXCTX_GUEST_R14, offsetof(struct vmxctx, guest_r14));55ASSYM(VMXCTX_GUEST_R15, offsetof(struct vmxctx, guest_r15));56ASSYM(VMXCTX_GUEST_CR2, offsetof(struct vmxctx, guest_cr2));5758ASSYM(VMXCTX_HOST_R15, offsetof(struct vmxctx, host_r15));59ASSYM(VMXCTX_HOST_R14, offsetof(struct vmxctx, host_r14));60ASSYM(VMXCTX_HOST_R13, offsetof(struct vmxctx, host_r13));61ASSYM(VMXCTX_HOST_R12, offsetof(struct vmxctx, host_r12));62ASSYM(VMXCTX_HOST_RBP, offsetof(struct vmxctx, host_rbp));63ASSYM(VMXCTX_HOST_RSP, offsetof(struct vmxctx, host_rsp));64ASSYM(VMXCTX_HOST_RBX, offsetof(struct vmxctx, host_rbx));6566ASSYM(VMXCTX_INST_FAIL_STATUS, offsetof(struct vmxctx, inst_fail_status));6768ASSYM(VM_FAIL_INVALID, VM_FAIL_INVALID);69ASSYM(VM_FAIL_VALID, VM_FAIL_VALID);70ASSYM(VMX_GUEST_VMEXIT, VMX_GUEST_VMEXIT);71ASSYM(VMX_VMRESUME_ERROR, VMX_VMRESUME_ERROR);72ASSYM(VMX_VMLAUNCH_ERROR, VMX_VMLAUNCH_ERROR);7374ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));7576ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));77ASSYM(PM_EPTGEN, offsetof(struct pmap, pm_eptgen));7879ASSYM(KERNEL_SS, GSEL(GDATA_SEL, SEL_KPL));80ASSYM(KERNEL_CS, GSEL(GCODE_SEL, SEL_KPL));8182ASSYM(PAGE_SIZE, PAGE_SIZE);83ASSYM(KERNBASE, KERNBASE);848586