[Pal/Linux-SGX] Increase MAX_DBG_THREADS constant from 64 to 1024

An internal Graphene structure for GDB metadata limits the number of
enclave threads to MAX_DBG_THREADS. Previously, it was set to 64,
which was enough for typical platforms. However, powerful servers
have hundreds of logical cores. Graphene-SGX failed with error on such
servers. This commit increases the limit to 1024.
This commit is contained in:
Dmitrii Kuvaiskii
2019-10-23 12:00:12 -07:00
parent 8e3fe7a86f
commit fe7a603bf3
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
#define MAX_DBG_THREADS 64
#define MAX_DBG_THREADS 1024
/* This address is shared between our GDB and Graphene-SGX and must
* reside in non-enclave memory. Graphene-SGX puts an enclave_dbginfo
+3 -1
View File
@@ -234,9 +234,11 @@ int initialize_enclave (struct pal_enclave * enclave)
sgx_arch_enclave_css_t enclave_sigstruct;
sgx_arch_secs_t enclave_secs;
unsigned long enclave_entry_addr;
void* tcs_addrs[MAX_DBG_THREADS];
unsigned long heap_min = DEFAULT_HEAP_MIN;
/* this array may overflow the stack, so we allocate it in BSS */
static void* tcs_addrs[MAX_DBG_THREADS];
enclave_image = INLINE_SYSCALL(open, 3, ENCLAVE_FILENAME, O_RDONLY, 0);
if (IS_ERR(enclave_image)) {
SGX_DBG(DBG_E, "Cannot find %s\n", ENCLAVE_FILENAME);