@@ -398,7 +398,7 @@ TEST_F_TIMEOUT(enclave, unclobbered_vdso_oversubscribed_remove, 900)
* Create enclave with additional heap that is as big as all
* available physical SGX memory.
*/
- total_mem = get_total_epc_mem();
+ total_mem = get_total_epc_mem()/16;
ASSERT_NE(total_mem, 0);
TH_LOG("Creating an enclave with %lu bytes heap may take a while ...",
total_mem);
If the the test compiled with above snippet is renamed as "test_sgx_small"
and the original renamed as "test_sgx_large" the two concurrent loops are
run as follows:
(for i in $(seq 1 999); do echo "Iteration $i"; sudo ./test_sgx_large; done ) > log.large 2>&1
(for i in $(seq 1 9999); do echo "Iteration $i"; sudo ./test_sgx_small; done ) > log.small 2>&1
If the SGX driver is modified to always WARN when ENCLS[ELDU] encounters a #GP
(see below) then the WARN appears after a few iterations of "test_sgx_large"
and shows up throughout the testing.
@@ -18,7 +18,7 @@
#define ENCLS_WARN(r, name) { \
do { \
int _r = (r); \
- WARN_ONCE(_r, "%s returned %d (0x%x)\n", (name), _r, _r); \
+ WARN(_r, "%s returned %d (0x%x)\n", (name), _r, _r); \
} while (0); \
}