|
@@ -148,17 +148,18 @@ def get_enclave_attributes(manifest):
|
|
|
'MISC_EXINFO' : struct.pack("<L", SGX_MISCSELECT_EXINFO),
|
|
|
}
|
|
|
|
|
|
- default_attributes = [
|
|
|
+ default_attributes = {
|
|
|
'FLAG_DEBUG',
|
|
|
'XFRM_LEGACY',
|
|
|
'XFRM_AVX',
|
|
|
- ]
|
|
|
+ }
|
|
|
|
|
|
if ARCHITECTURE == 'amd64':
|
|
|
- default_attributes.append('FLAG_MODE64BIT')
|
|
|
+ default_attributes.add('FLAG_MODE64BIT')
|
|
|
|
|
|
manifest_options = {
|
|
|
'debug' : 'FLAG_DEBUG',
|
|
|
+ 'enable_avx' : 'XFRM_AVX',
|
|
|
'enable_avx512' : 'XFRM_AVX512',
|
|
|
'enable_mpx' : 'XFRM_MPX',
|
|
|
'support_exinfo' : 'MISC_EXINFO',
|
|
@@ -170,13 +171,9 @@ def get_enclave_attributes(manifest):
|
|
|
key = 'sgx.' + opt
|
|
|
if key in manifest:
|
|
|
if manifest[key] == '1':
|
|
|
- attributes.append(manifest_options[opt])
|
|
|
+ attributes.add(manifest_options[opt])
|
|
|
else:
|
|
|
- if manifest_options[opt] in attributes:
|
|
|
- attributes.pop(manifest_options[opt])
|
|
|
-
|
|
|
- if manifest.get('sgx.disable_avx') == '1':
|
|
|
- attributes.remove('XFRM_AVX')
|
|
|
+ attributes.discard(manifest_options[opt])
|
|
|
|
|
|
flags_raw = struct.pack("<Q", 0)
|
|
|
xfrms_raw = struct.pack("<Q", 0)
|