Browse Source

[SGX] Switch from requiring AVX by default to turning it off by default.

Don Porter 4 years ago
parent
commit
485accd996

+ 2 - 2
Pal/regression/AvxDisable.manifest.template

@@ -1,3 +1,3 @@
-sgx.enable_avx = 0
-sgx.enable_avx512 = 0
+sgx.require_avx = 0
+sgx.require_avx512 = 0
 sgx.allowed_files.res = file:avxRes

+ 6 - 0
Pal/src/host/Linux-SGX/sgx_framework.c

@@ -153,6 +153,12 @@ int create_enclave(sgx_arch_secs_t * secs,
     secs->miscselect = token->miscselect_mask;
     memcpy(&secs->attributes, &token->attributes,
            sizeof(sgx_arch_attributes_t));
+
+    // Enable AVX and AVX512
+    // [2019-09-18] TODO(dep): This alone is not enough to get the fully optional behavior we will want.
+    // Leave this here for future work in another PR
+    // secs->attributes.xfrm |= SGX_XFRM_AVX;
+
     /* Do not initialize secs->mrsigner and secs->mrenclave here as they are
      * not used by ECREATE to populate the internal SECS. SECS's mrenclave is
      * computed dynamically and SECS's mrsigner is populated based on the

+ 2 - 3
Pal/src/host/Linux-SGX/signer/pal-sgx-sign

@@ -151,7 +151,6 @@ def get_enclave_attributes(manifest):
     default_attributes = {
         'FLAG_DEBUG',
         'XFRM_LEGACY',
-        'XFRM_AVX',
     }
 
     if ARCHITECTURE == 'amd64':
@@ -159,8 +158,8 @@ def get_enclave_attributes(manifest):
 
     manifest_options = {
         'debug'          : 'FLAG_DEBUG',
-        'enable_avx'     : 'XFRM_AVX',
-        'enable_avx512'  : 'XFRM_AVX512',
+        'require_avx'    : 'XFRM_AVX',
+        'require_avx512' : 'XFRM_AVX512',
         'enable_mpx'     : 'XFRM_MPX',
         'support_exinfo' : 'MISC_EXINFO',
     }