Commit Graph

180 Commits

Author SHA1 Message Date
Tate, Hongliang Tian
a2169e63e8 Upgrade Dockerfile for dynamic-linking support 2019-08-01 12:23:37 +00:00
Tate, Hongliang Tian
e11c30c5c5 Run dynamically-linked hello world 2019-07-20 03:34:00 +00:00
Tate, Hongliang Tian
33739cc00b Program loader loads ld.so now 2019-07-20 03:34:00 +00:00
Tate, Hongliang Tian
13974315ad Fix all compiler warnings for tests 2019-07-20 03:34:00 +00:00
Tate, Hongliang Tian
a579f84e90 Enable new system call mechanism via Auxiliary Vector
The old system call mechanism works by relocating the symbol __occlum_syscall
provided by libocclum_stub.so to the real entry point of the LibOS. This symbol
relocation is done by the program loader. Now, the new system call mechanism is
based on passing the entry point via the auxiliary vector. This new mechanism
is simpler and is more compatible with the upcoming support for ld.so.

Changes:
1. Fix a bug in serializing auxiliary vector in the stack of a user program;
2. Passing syscall entry via auxiliary vector;
3. Remove relocating for the __occlum_syscall symbol;
4. Remove the dependency on libocclum_stub.so in tests.
2019-07-20 03:34:00 +00:00
geding.lq
9c226c9a9f Fix a bug in cpuid, which mistakenly use %rax where %eax is actually needed 2019-07-20 03:23:50 +00:00
Tate, Hongliang Tian
8686322afb Add /dev/zero, /dev/random, /dev/urandom, and /dev/arandom 2019-07-19 12:30:15 +00:00
Tate, Hongliang Tian
8cda63ab3a Use SEFS at /, HostFS at /host, and RamFS at /tmp 2019-07-19 10:25:33 +00:00
Wang Runji
7f229cef50 add simple HostFS, mount it at /host 2019-07-19 03:51:38 +00:00
Wang Runji
29278db8f4 support multiple fs
- use RamFS as rootfs, mount SEFS at /test
- for testing convenience, set default cwd to /test
- fix spawn path and change_cwd
2019-07-19 03:49:18 +00:00
Tate, Hongliang Tian
30265261cf Remove a deprecated submodule sgx_protect_file 2019-07-18 11:02:01 +00:00
Tate, Hongliang Tian
e1e46c9935 Add clock_gettimeofday 2019-07-18 10:51:12 +00:00
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
散樗
2553298b1d Handle cpuid and rdtsc instruction
Init support for cpuid and rdtsc instruction handling in occlum.

This patch includes:
1. cpuid exception handler for all information leaves;
2. rdtsc exception handler;
3. handler registration;
4. cpuid test;
5. rdtsc test.

Signed-off-by: 散樗 <kailun.qkl@antfin.com>
2019-07-18 13:51:50 +08:00
Tate, Hongliang Tian
56c69b5f3c Refactor mmap implementation
1. Add a full test suite for mmap
2. Implement file-backed memory mapping
3. Implement fixed, anonymous memory mapping
4. Implement hinted, anonymous memory mapping
5. Implement munmap that covers partial/multiple memory mappings
2019-07-01 11:56:04 +08:00
Youren
3a38f68c69 Add c++ examples 2019-06-01 11:22:04 +08:00
Tate Tian
06924c0e47
Add C++ support in the Occlum Docker image 2019-06-01 11:18:52 +08:00
Tate Tian
5aaf6de989
Update README 2019-05-27 22:11:14 +08:00
WangRunji
2fdc7d3b17 sefs: fix Rust SGX SDK version and Rust nightly version 2019-05-27 22:07:15 +08:00
Tate Tian
b189e996ab
Fix typos in README 2019-05-27 21:15:11 +08:00
Tate, Hongliang Tian
94acbb1c57 Add Dockerfile 2019-05-27 19:28:38 +08:00
Tate, Hongliang Tian
3465477cc1 Fix two bugs that prevents compilation and tests working 2019-04-29 00:01:17 +08:00
Tate Tian
4b804703b9
Merge pull request #70 for networking system calls 2019-04-28 23:40:48 +08:00
WangRunji
413586f729 add integrity_only_opt and sgx_file_cache feature 2019-04-26 22:48:00 +08:00
WangRunji
6e871f7948 reformat code using cargo fmt 2019-04-26 21:26:30 +08:00
WangRunji
dd3de96b8e hack unix socket for php 2019-04-24 19:25:09 +08:00
WangRunji
3850c31235 fix unix socket bench 2019-04-24 15:28:05 +08:00
WangRunji
cccc1cfb58 add unix socket bench 2019-04-24 13:41:01 +08:00
WangRunji
9797a64f06 enable unix socket and add test for it 2019-04-24 13:28:35 +08:00
WangRunji
9106bd46f2 fix for php. include incomplete code for UnixSocket 2019-04-23 22:00:38 +08:00
WangRunji
f846ba11f2 fix wait4 not removing child 2019-04-23 14:00:44 +08:00
WangRunji
0437e81f36 fix impl File for Stdin/Stdout 2019-04-23 12:58:28 +08:00
WangRunji
26189dddaa implement fcntl & ioctl for socket. fix lighttpd performance 2019-04-23 01:43:41 +08:00
WangRunji
1326924dbb fix errno = 0 and introduce macro 'try_libc' 2019-04-23 00:49:37 +08:00
WangRunji
141094e95e fix return value from libc::ocall 2019-04-22 21:55:57 +08:00
WangRunji
76f9ff380b add timing for syscall 2019-04-22 17:42:20 +08:00
WangRunji
9c9d1eed3a implement /dev/null 2019-04-22 16:32:40 +08:00
WangRunji
54243c543a use errno! macro for all error 2019-04-22 15:54:39 +08:00
WangRunji
b99344d7f5 implement sys_sendfile 2019-04-22 15:37:19 +08:00
WangRunji
f4dacdc01d add cache for SgxFile 2019-04-21 18:04:48 +08:00
WangRunji
ad98a1698e add timing
by shenyouren
2019-04-21 17:28:06 +08:00
WangRunji
5d9b8e4fa3 implement missing IO function for SocketFile 2019-04-21 17:26:17 +08:00
WangRunji
58ff7b88b5 fix SgxFile seek after the end 2019-04-14 20:31:19 +08:00
WangRunji
4811044c14 fix SgxFile read/write empty buffer 2019-04-13 21:03:10 +08:00
WangRunji
d19676032d implement add_open in posix_spawn 2019-04-13 12:05:50 +08:00
WangRunji
58a7f7c126 simplify epoll_ctl 2019-04-12 18:02:40 +08:00
WangRunji
82f4169618 enlarge preallocated space. sync file system on exit. 2019-04-12 16:54:49 +08:00
WangRunji
b2d75f386c support readlink "/proc/self/exe". impl dummy fcntl.getfl 2019-04-12 15:17:27 +08:00
WangRunji
a8060f0b24 add simple epoll test. fix epoll_wait, accept4 2019-04-12 15:14:11 +08:00
WangRunji
80a73eaa0d fix close_on_spawn and file_actions 2019-04-12 14:27:48 +08:00