github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/cpvmm/vmm/include/vmm_bootstrap_utils.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 _VMM_BOOTSTRAP_UTILS_H_ 16 #define _VMM_BOOTSTRAP_UTILS_H_ 17 18 #include "vmm_startup.h" 19 20 // 21 // Copy and destroy input structures 22 // 23 const VMM_STARTUP_STRUCT* 24 vmm_create_startup_struct_copy( 25 const VMM_STARTUP_STRUCT* startup_struct_stack); 26 27 void vmm_destroy_startup_struct(const VMM_STARTUP_STRUCT* startup_struct); 28 29 const VMM_APPLICATION_PARAMS_STRUCT* 30 vmm_create_application_params_struct_copy( 31 const VMM_APPLICATION_PARAMS_STRUCT* application_params_stack); 32 33 void vmm_destroy_application_params_struct( 34 const VMM_APPLICATION_PARAMS_STRUCT* application_params_struct); 35 36 // 37 // Read input data structure and create all guests 38 // 39 40 41 // Perform initialization of guests and guest CPUs, excluding host cpu parts 42 // Should be called on BSP only while all APs are stopped 43 // Return TRUE for success 44 // 45 BOOLEAN initialize_all_guests( UINT32 number_of_host_processors, 46 const VMM_MEMORY_LAYOUT* vmm_memory_layout, 47 const VMM_GUEST_STARTUP* primary_guest_startup_state, 48 UINT32 number_of_secondary_guests, 49 const VMM_GUEST_STARTUP* secondary_guests_startup_state_array, 50 const VMM_APPLICATION_PARAMS_STRUCT* application_params); 51 52 // Run init routins of all addons 53 // Should be called on BSP only while all APs are stopped 54 void start_addons( UINT32 num_of_cpus, const VMM_STARTUP_STRUCT* startup_struct, 55 const VMM_APPLICATION_PARAMS_STRUCT* application_params_struct); 56 57 // Perform initialization of host cpu parts of all guest CPUs that run on specified 58 // host CPU. 59 // Should be called on the target host CPU 60 void initialize_host_vmcs_regions( CPU_ID current_cpu_id ); 61 62 // Debug print input structures 63 void print_startup_struct(const VMM_STARTUP_STRUCT* startup_struct); 64 65 #endif // _VMM_BOOTSTRAP_UTILS_H_ 66