14c87aefeSPatrick Mooney/* 21fa07ac7SMike Zeller * This file and its contents are supplied under the terms of the 31fa07ac7SMike Zeller * Common Development and Distribution License ("CDDL"), version 1.0. 41fa07ac7SMike Zeller * You may only use this file in accordance with the terms of version 51fa07ac7SMike Zeller * 1.0 of the CDDL. 64c87aefeSPatrick Mooney * 71fa07ac7SMike Zeller * A full copy of the text of the CDDL should have accompanied this 81fa07ac7SMike Zeller * source. A copy of the CDDL is also available via the Internet at 91fa07ac7SMike Zeller * http://www.illumos.org/license/CDDL. 104c87aefeSPatrick Mooney */ 111fa07ac7SMike Zeller/* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */ 121fa07ac7SMike Zeller 131fa07ac7SMike Zeller/* 141fa07ac7SMike Zeller * Copyright 2014 Pluribus Networks Inc. 151fa07ac7SMike Zeller */ 161fa07ac7SMike Zeller 174c87aefeSPatrick Mooney#include <sys/types.h> 184c87aefeSPatrick Mooney#include <sys/param.h> 194c87aefeSPatrick Mooney#include <sys/systm.h> 204c87aefeSPatrick Mooney#include <sys/cpuvar.h> 214c87aefeSPatrick Mooney 224c87aefeSPatrick Mooney#include <machine/vmm.h> 23cf409e3fSDan Cross#include <sys/vmm_vm.h> 244c87aefeSPatrick Mooney 254c87aefeSPatrick Mooney#include "intel/vmx.h" 264c87aefeSPatrick Mooney 274c87aefeSPatrick Mooneyvmxctx 284c87aefeSPatrick Mooney guest_rdi VMXCTX_GUEST_RDI 294c87aefeSPatrick Mooney guest_rsi VMXCTX_GUEST_RSI 304c87aefeSPatrick Mooney guest_rdx VMXCTX_GUEST_RDX 314c87aefeSPatrick Mooney guest_rcx VMXCTX_GUEST_RCX 324c87aefeSPatrick Mooney guest_r8 VMXCTX_GUEST_R8 334c87aefeSPatrick Mooney guest_r9 VMXCTX_GUEST_R9 344c87aefeSPatrick Mooney guest_rax VMXCTX_GUEST_RAX 354c87aefeSPatrick Mooney guest_rbx VMXCTX_GUEST_RBX 364c87aefeSPatrick Mooney guest_rbp VMXCTX_GUEST_RBP 374c87aefeSPatrick Mooney guest_r10 VMXCTX_GUEST_R10 384c87aefeSPatrick Mooney guest_r11 VMXCTX_GUEST_R11 394c87aefeSPatrick Mooney guest_r12 VMXCTX_GUEST_R12 404c87aefeSPatrick Mooney guest_r13 VMXCTX_GUEST_R13 414c87aefeSPatrick Mooney guest_r14 VMXCTX_GUEST_R14 424c87aefeSPatrick Mooney guest_r15 VMXCTX_GUEST_R15 434c87aefeSPatrick Mooney guest_cr2 VMXCTX_GUEST_CR2 444c87aefeSPatrick Mooney inst_fail_status VMXCTX_INST_FAIL_STATUS 454c87aefeSPatrick Mooney 464c87aefeSPatrick Mooney\#define VM_SUCCESS 0 474c87aefeSPatrick Mooney\#define VM_FAIL_INVALID 1 484c87aefeSPatrick Mooney\#define VM_FAIL_VALID 2 494c87aefeSPatrick Mooney 504c87aefeSPatrick Mooney\#define VMX_GUEST_VMEXIT 0 514c87aefeSPatrick Mooney\#define VMX_VMRESUME_ERROR 1 524c87aefeSPatrick Mooney\#define VMX_VMLAUNCH_ERROR 2 534c87aefeSPatrick Mooney\#define VMX_INVEPT_ERROR 3 544c87aefeSPatrick Mooney\#define VMX_VMWRITE_ERROR 4 55