github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/cpvmm/vmm/startup/addons.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_bootstrap_utils.h"
    16  #include "policy_manager.h"
    17  #include "vmm_addons.h"
    18  #include "vmm_dbg.h"
    19  #ifdef TMSL_HANDLER_DEFINED
    20  #include <tmsl_handler_external.h>
    21  #endif
    22  #include "file_codes.h"
    23  
    24  #define VMM_DEADLOOP()          VMM_DEADLOOP_LOG(ADDONS_C)
    25  #define VMM_ASSERT(__condition) VMM_ASSERT_LOG(ADDONS_C, __condition)
    26  
    27  extern void xuvmm_initialize(UINT32 num_of_threads);
    28  
    29  extern BOOLEAN legacy_scheduling_enabled;
    30  
    31  void start_addons( UINT32 num_of_cpus,
    32                     const VMM_STARTUP_STRUCT* startup_struct,
    33                     const VMM_APPLICATION_PARAMS_STRUCT* application_params_struct)
    34  {
    35    (void)startup_struct;
    36    (void)application_params_struct;
    37      VMM_LOG(mask_anonymous, level_trace,"start addons\r\n");
    38  #ifdef VTLB_IS_SUPPORTED
    39      if (global_policy_uses_vtlb()) {
    40          init_vtlb_addon( num_of_cpus );
    41      } 
    42  	else
    43  #endif
    44      if (global_policy_uses_ept()) {
    45          init_ept_addon( num_of_cpus );
    46      }
    47      else {
    48          VMM_LOG(mask_anonymous, level_error,"No supported addons\r\n");
    49          // BEFORE_VMLAUNCH. CRITICAL check that should not fail.
    50          VMM_DEADLOOP();
    51      }
    52  
    53      // gdb_stub_addon_initialize(num_of_cpus, &startup_struct->debug_params.aux_port);
    54  
    55      // init_guest_create_addon();
    56  
    57  #ifdef XUVMM_DEFINED
    58      xuvmm_initialize(num_of_cpus);
    59      legacy_scheduling_enabled = FALSE;
    60  #endif
    61  #ifdef TMSL_HANDLER_DEFINED
    62      tmsl_handler_initialize(num_of_cpus);
    63  #endif
    64  }
    65