github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/cpvmm/vmm/include/host_cpu.h (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 #ifndef _HOST_CPU_H_ 16 #define _HOST_CPU_H_ 17 18 #include "vmm_defs.h" 19 #include "vmm_objects.h" 20 #include "vmx_vmcs.h" 21 22 // Host CPU model for VMCS 23 24 // Init 25 void host_cpu_manager_init( UINT16 max_host_cpus ); 26 27 // Initialize current host cpu 28 void host_cpu_init( void ); 29 30 // Init VMCS state host part for the specified host cpu 31 // Note: this function does not reguire to be called on the target_host_cpu 32 void host_cpu_vmcs_init( GUEST_CPU_HANDLE gcpu); 33 34 // Set/Get VMXON Region pointer for the current CPU 35 void host_cpu_set_vmxon_region( HVA hva, HPA hpa, CPU_ID my_cpu_id ); 36 HVA host_cpu_get_vmxon_region( HPA* hpa ); 37 38 // Set/Get VMX state is active 39 void host_cpu_set_vmx_state( BOOLEAN value ); 40 BOOLEAN host_cpu_get_vmx_state( void ); 41 42 // Enable usage of XMM registers 43 void host_cpu_enable_usage_of_xmm_regs( void ); 44 void host_cpu_add_msr_to_level0_autoswap(CPU_ID cpu, UINT32 msr_index); 45 void host_cpu_delete_msr_from_level0_autoswap(CPU_ID cpu, UINT32 msr_index); 46 void host_cpu_init_vmexit_store_and_vmenter_load_msr_lists_according_to_vmexit_load_list(GUEST_CPU_HANDLE gcpu); 47 48 49 // Debug support 50 void host_cpu_store_vmexit_gcpu(CPU_ID cpu_id, GUEST_CPU_HANDLE gcpu); 51 GUEST_CPU_HANDLE host_cpu_get_vmexit_gcpu(CPU_ID cpu_id); 52 53 void host_cpu_save_dr7(CPU_ID cpu_id); 54 void host_cpu_restore_dr7(CPU_ID cpu_id); 55 56 #endif // _HOST_CPU_H_