pub unsafe extern "C" fn sgx_qv_set_enclave_load_policy(
    policy: sgx_ql_request_policy_t
) -> quote3_error_t
Expand description

When the Quoting Verification Library is linked to a process, it needs to know the proper enclave loading policy. The library may be linked with a long lived process, such as a service, where it can load the enclaves and leave them loaded (persistent). This better ensures that the enclaves will be available upon quote requests and not subject to EPC limitations if loaded on demand. However, if the QVL is linked with an application process, there may be many applications with the QVL and a better utilization of EPC is to load and unloaded the quote verification enclaves on demand (ephemeral). The library will be shipped with a default policy of loading enclaves and leaving them loaded until the library is unloaded (PERSISTENT). If the policy is set to EPHEMERAL, then the QvE will be loaded and unloaded on-demand. Supported policies: SGX_QL_EPHEMERAL - Default policy. QvE is initialized and terminated on every quote verification function call. SGX_QL_PERSISTENT - All the threads will share single QvE instance, and QvE is initialized on first use and reused until process ends. SGX_QL_EPHEMERAL_QVE_MULTI_THREAD - QvE is loaded per thread and be unloaded before function exit. SGX_QL_PERSISTENT_QVE_MULTI_THREAD - QvE is loaded per thread and only be unloaded before thread exit.

NOTE: QvE load policy should be only set once in one process, otherwise, this function will return error SGX_QL_UNSUPPORTED_LOADING_POLICY.

@param policy Sets the requested enclave loading policy to either SGX_QL_PERSISTENT, SGX_QL_EPHEMERAL or SGX_QL_DEFAULT.

@return SGX_QL_SUCCESS Successfully set the enclave loading policy for the quoting library’s enclaves. @return SGX_QL_UNSUPPORTED_LOADING_POLICY The selected policy is not supported or it has been set once.