github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/cpvmm/vmm/vmexit/vmexit_vmx.c (about) 1 /* 2 * Copyright (c) 2013 Intel Corporation 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * Unless required by applicable law or agreed to in writing, software 9 * distributed under the License is distributed on an "AS IS" BASIS, 10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 * See the License for the specific language governing permissions and 12 * limitations under the License. 13 */ 14 15 #include "vmm_defs.h" 16 #include "isr.h" 17 #include "guest_cpu.h" 18 #include "guest_cpu_vmenter_event.h" 19 #include "file_codes.h" 20 #define VMM_DEADLOOP() VMM_DEADLOOP_LOG(VMEXIT_VMX_C) 21 #define VMM_ASSERT(__condition) VMM_ASSERT_LOG(VMEXIT_VMX_C, __condition) 22 #ifdef JLMDEBUG 23 #include "jlmdebug.h" 24 #endif 25 26 extern BOOLEAN gcpu_inject_invalid_opcode_exception(GUEST_CPU_HANDLE gcpu); 27 28 #pragma warning( push ) 29 #pragma warning (disable : 4100) // Supress warnings about unreferenced formal parameter 30 31 VMEXIT_HANDLING_STATUS vmexit_vmxon_instruction(GUEST_CPU_HANDLE gcpu) 32 { 33 VMM_LOG(mask_uvmm, level_trace,"%s\n", __FUNCTION__); 34 #ifdef DEBUG 35 VMM_DEADLOOP(); 36 #else 37 gcpu_inject_invalid_opcode_exception(gcpu); 38 #endif 39 return VMEXIT_HANDLED; 40 } 41 42 43 VMEXIT_HANDLING_STATUS vmexit_vmxoff_instruction(GUEST_CPU_HANDLE gcpu) 44 { 45 VMM_LOG(mask_uvmm, level_trace,"%s\n", __FUNCTION__); 46 #ifdef DEBUG 47 VMM_DEADLOOP(); 48 #else 49 gcpu_inject_invalid_opcode_exception(gcpu); 50 #endif 51 return VMEXIT_HANDLED; 52 } 53 54 55 VMEXIT_HANDLING_STATUS vmexit_vmread_instruction(GUEST_CPU_HANDLE gcpu) 56 { 57 VMM_LOG(mask_uvmm, level_trace,"%s\n", __FUNCTION__); 58 #ifdef DEBUG 59 VMM_DEADLOOP(); 60 #else 61 gcpu_inject_invalid_opcode_exception(gcpu); 62 #endif 63 return VMEXIT_HANDLED; 64 } 65 66 VMEXIT_HANDLING_STATUS vmexit_vmwrite_instruction(GUEST_CPU_HANDLE gcpu) 67 { 68 VMM_LOG(mask_uvmm, level_trace,"%s\n", __FUNCTION__); 69 #ifdef DEBUG 70 VMM_DEADLOOP(); 71 #else 72 gcpu_inject_invalid_opcode_exception(gcpu); 73 #endif 74 return VMEXIT_HANDLED; 75 } 76 77 VMEXIT_HANDLING_STATUS vmexit_vmptrld_instruction(GUEST_CPU_HANDLE gcpu) 78 { 79 VMM_LOG(mask_uvmm, level_trace,"%s\n", __FUNCTION__); 80 #ifdef DEBUG 81 VMM_DEADLOOP(); 82 #else 83 gcpu_inject_invalid_opcode_exception(gcpu); 84 #endif 85 return VMEXIT_HANDLED; 86 } 87 88 VMEXIT_HANDLING_STATUS vmexit_vmptrst_instruction(GUEST_CPU_HANDLE gcpu) 89 { 90 VMM_LOG(mask_uvmm, level_trace,"%s\n", __FUNCTION__); 91 #ifdef DEBUG 92 VMM_DEADLOOP(); 93 #else 94 gcpu_inject_invalid_opcode_exception(gcpu); 95 #endif 96 return VMEXIT_HANDLED; 97 } 98 99 100 101 VMEXIT_HANDLING_STATUS vmexit_vmlaunch_instruction(GUEST_CPU_HANDLE gcpu) 102 { 103 VMM_LOG(mask_uvmm, level_trace,"%s\n", __FUNCTION__); 104 #ifdef DEBUG 105 VMM_DEADLOOP(); 106 #else 107 gcpu_inject_invalid_opcode_exception(gcpu); 108 #endif 109 return VMEXIT_HANDLED; 110 } 111 112 VMEXIT_HANDLING_STATUS vmexit_vmresume_instruction(GUEST_CPU_HANDLE gcpu) 113 { 114 VMM_LOG(mask_uvmm, level_trace,"%s\n", __FUNCTION__); 115 #ifdef DEBUG 116 VMM_DEADLOOP(); 117 #else 118 gcpu_inject_invalid_opcode_exception(gcpu); 119 #endif 120 return VMEXIT_HANDLED; 121 } 122 123 124 VMEXIT_HANDLING_STATUS vmexit_vmclear_instruction(GUEST_CPU_HANDLE gcpu) 125 { 126 VMM_LOG(mask_uvmm, level_trace,"%s\n", __FUNCTION__); 127 #ifdef DEBUG 128 VMM_DEADLOOP(); 129 #else 130 gcpu_inject_invalid_opcode_exception(gcpu); 131 #endif 132 return VMEXIT_HANDLED; 133 } 134 135 #pragma warning( pop ) 136 137