You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you decide to work on this meta-issue, please create a separate issue with its own PR for each syscall you test or implement and then link that separate issue with your PR.
Integration test overview
An integration test for a syscall runs a minimal binary in the Keep and checks the results. Writing an integration test involves creating the binary itself (at least one per each syscall to test) and updating the test harness to run this binary in the Keep during cargo test. Some syscalls have more than one binary for different variations of parameters, ex. exit or write each have several varieties to test different exit codes or to test writing to different file descriptors.
Each syscall test is implemented in C inline assembly in our libc.h file. The corresponding C binary file for each syscall then refers to this implementation by including our libc.h and calling the correct function. The test harness is written in Rust and actually runs the binary in a Keep. See the run_test() function for more on how to pass inputs and receive outputs from the test.
Example: syscall test for write()
Create a C inline assembly implementation for write in libc.h
Add a Rust test to run this binary in a Keep and check that the outputs and return status code are expected
Syscalls to test
Choose a syscall that is not checked off to test. Edit this list to indicate you are working on it so that someone else does not duplicate the work, ex. by writing "current WIP" next to the syscall on the list.
read(),
readv(),
write(),
writev(),
exit(),
getuid(),
arch_prctl(),
exit_group(),
set_tid_address(),
brk(),
uname(),
mprotect(),
mmap(),
munmap(),
rt_sigaction(),
rt_sigprocmask(),
sigaltstack(),
getrandom(),
clock_gettime(),
madvise(),
close()
pipe
fcntl with F_GETFD, F_SETFD, F_GETFL, F_SETFL
ioctl with FIONBIO
getsockname
sendto
setsockopt
epoll_create1
epoll_ctl
epoll_wait
getpid
Extra info about syscall implementations
Syscalls are implemented internally here (these are handled in the Keep or if necessary are proxied out to the host). Each architecture can also override these definitions in its own handler: see the handlers for SGX and SEV. In SGX, syscalls are passed to the handler from the event file. In SEV, syscalls are passed to the handler from here.
Here is a master list of syscalls required by wasmtime, for reference. Which of these syscalls we will implement from this list is TBD.
The text was updated successfully, but these errors were encountered:
If you decide to work on this meta-issue, please create a separate issue with its own PR for each syscall you test or implement and then link that separate issue with your PR.
Integration test overview
An integration test for a syscall runs a minimal binary in the Keep and checks the results. Writing an integration test involves creating the binary itself (at least one per each syscall to test) and updating the test harness to run this binary in the Keep during
cargo test
. Some syscalls have more than one binary for different variations of parameters, ex.exit
orwrite
each have several varieties to test different exit codes or to test writing to different file descriptors.Each syscall test is implemented in C inline assembly in our
libc.h
file. The corresponding C binary file for each syscall then refers to this implementation by including ourlibc.h
and calling the correct function. The test harness is written in Rust and actually runs the binary in a Keep. See therun_test()
function for more on how to pass inputs and receive outputs from the test.Example: syscall test for write()
libc.h
Syscalls to test
Choose a syscall that is not checked off to test. Edit this list to indicate you are working on it so that someone else does not duplicate the work, ex. by writing "current WIP" next to the syscall on the list.
Extra info about syscall implementations
Syscalls are implemented internally here (these are handled in the Keep or if necessary are proxied out to the host). Each architecture can also override these definitions in its own handler: see the handlers for SGX and SEV. In SGX, syscalls are passed to the handler from the event file. In SEV, syscalls are passed to the handler from here.
Here is a master list of syscalls required by wasmtime, for reference. Which of these syscalls we will implement from this list is TBD.
The text was updated successfully, but these errors were encountered: