occlum/test
Tate, Hongliang Tian c096e7d0b9 Inform Intel SGX SDK about Occlum-defined stacks
There are two types of stacks: the kernel ones and the user ones. The kernel
stacks are used by Occlum and managed by Intel SGX SDK itself, while the user
stacks are used by the threads created and managed by Occlum. These user stacks
are transparent to Intel SGX SDK so far.

The problem is that Intel SGX SDK needs to be aware of the user stacks.
SGX exception handlers will check whether the rsp value---when the exception
happened---is within the stack of the current SGX thread. If the check fails,
the registered exception handler will not be triggered. But when exceptions are
triggered by the threads running upon Occlum, the rsp value points to the user
stacks, which Intel SGX SDK are completely unware of. So the check always
fails.

Therefore, we extend Intel SGX SDK with two new APIs:

  int sgx_enable_user_stack(size_t stack_base, size_t stack_limit);
  void sgx_disable_user_stack(void);

And this commit uses the two APIs to inform Intel SGX SDK about the
Occlum-managed stacks. And the rsp checks in SGX exception handlers will
check whether rsp is within the user stacks.
2019-07-18 07:16:17 +00:00
..
argv load program bin from SEFS 2019-03-29 14:20:25 +08:00
client implement SocketFile. pass socket test 2019-04-07 11:47:54 +08:00
cout Add c++ examples 2019-06-01 11:22:04 +08:00
cpuid Inform Intel SGX SDK about Occlum-defined stacks 2019-07-18 07:16:17 +00:00
dev_null Add pipe throughput benchmark 2019-02-16 16:24:08 +08:00
empty Support argc and argv for child process after spawn 2019-02-16 16:24:08 +08:00
file add test for pread, pwrite 2019-03-29 14:20:25 +08:00
getpid Support argc and argv for child process after spawn 2019-02-16 16:24:08 +08:00
hello_world Support argc and argv for child process after spawn 2019-02-16 16:24:08 +08:00
link add test for link, unlink, rename 2019-03-29 14:20:25 +08:00
malloc Support argc and argv for child process after spawn 2019-02-16 16:24:08 +08:00
mkdir fix split_path. add test for getcwd, mkdir, rmdir, chdir. 2019-03-29 14:20:25 +08:00
mmap Refactor mmap implementation 2019-07-01 11:56:04 +08:00
pipe load program bin from SEFS 2019-03-29 14:20:25 +08:00
pipe_throughput load program bin from SEFS 2019-03-29 14:20:25 +08:00
pthread Use mutex in Pthread test 2019-04-06 22:55:16 +08:00
rdtsc Handle cpuid and rdtsc instruction 2019-07-18 13:51:50 +08:00
readdir fix process cwd. fix open path 2019-03-29 14:20:25 +08:00
rlimit Add prlimit64, getrlimit, and setrlimit 2019-04-10 09:03:41 +08:00
server add test for simple socket syscalls 2019-04-07 11:28:43 +08:00
server_epoll add simple epoll test. fix epoll_wait, accept4 2019-04-12 15:14:11 +08:00
spawn load program bin from SEFS 2019-03-29 14:20:25 +08:00
spawn_and_exit_latency load program bin from SEFS 2019-03-29 14:20:25 +08:00
time Support argc and argv for child process after spawn 2019-02-16 16:24:08 +08:00
tls Enable Thread Local Storage (TLS) 2019-04-06 22:55:16 +08:00
truncate Add access and faccessat 2019-04-10 09:03:41 +08:00
uname Add uname 2019-04-10 09:03:41 +08:00
unix_socket fix unix socket bench 2019-04-24 15:28:05 +08:00
unix_socket_throughput fix unix socket bench 2019-04-24 15:28:05 +08:00
Makefile Handle cpuid and rdtsc instruction 2019-07-18 13:51:50 +08:00
test_common.mk Add c++ examples 2019-06-01 11:22:04 +08:00