Commit Graph
536 Commits
Author SHA1 Message Date
Don Porter f003fb2500 Do not merge. Just a CI test 2019-10-02 10:14:28 -04:00
Michał Kowalczyk a0a996904d [LibOS] Fix a typo in large_dir_read test 2019-10-02 03:23:33 +02:00
Michał Kowalczyk 44e186c503 Clean up asserts
- Make assert() a no-op in non-debug builds.
- Use static_assert for compile-time asserts.
- Fix assert() implementation (previous version didn't work for
  expressions with types larger than long, it also always printed
  `(value:0)`).
- Clean up calls to asserts.
2019-10-02 03:22:52 +02:00
Michał Kowalczyk a6e1524e6e Clean up handle_ops and PAL_HANDLE usage 2019-10-02 03:22:28 +02:00
Dmitrii Kuvaiskii da21b2e000 [LibOS] test/apps: Move benchmark-http.sh to common_tools
This commit concerns web-server examples: Apache, Nginx, and Lighttpd.
Previously, benchmark-http.sh bash script was located under lighttpd
directory, and Apache and Nginx had symbolic links to it. This is
unintuitive. This commit moves benchmark-http.sh to a newly created
common_tools directory, and all web-server examples have symbolic links
to this new dir.
2019-10-01 19:28:20 -07:00
Thomas Knauth c6a0151baf [LibOS] Fix and add a test case for resource leak on file close 2019-10-01 16:18:38 +02:00
Dmitrii Kuvaiskii b81c808589 [LibOS] test/apps: Rewrite Nginx example 2019-09-30 21:53:48 -07:00
Isaku Yamahata 55e0bb1c6a [LibOS] Force variable update on tcb.test_range.has_fault in test_user_memory()
In test_user_memory(), a memory range is tested via probing of each page
in the range. If the memory page was not allocated, it leads to a
segfault which is captured by the LibOS memfault_upcall() and reported
in the variable tcb.test_range.has_fault. However, the compiler may
optimize away accesses to this variable in test_user_memory(), believing
it is never updated anywhere else. This commit introduces a memory
barrier to prevent this compiler optimization (same for test_user_string()).
2019-09-30 20:56:18 -07:00
Michał Kowalczyk 6e67342ba8 [LibOS] Fix incorrectly git-ignored glibc-patches dir 2019-10-01 00:48:00 +02:00
Michał Kowalczyk 6ba48bdf59 [LibOS] shim_profile: Simplify no-op macros 2019-10-01 00:48:00 +02:00
Michał Kowalczyk 62cbf79603 Fix a bunch of typos 2019-10-01 00:48:00 +02:00
borysp 323be6717d [LibOS] Change minimal file descriptor number to be 0
Previously, set_new_fd_handle() started searching for the first free fd
from 1 not 0. This commit fixes this, plus refactors this function.
2019-09-30 15:49:32 -07:00
Dmitrii Kuvaiskii 0b6809fc19 [LibOS] Do not get/put handles when adding/removing from epoll
Previously, Graphene explicitly incremented refcount of a handle added
to/removed from epoll, in epoll_ctl(EPOLL_CTL_ADD/EPOLL_CTL_DEL).
However, according to epoll(7), closing a file descriptor causes the
FD (handle) to be removed from all epoll sets. In other words,
adding/removing a handle to/from epoll must not count towards refcount
of the handle. Otherwise the handle remains dangling in the epoll set
even if it was close()'d (this particular case led to Nginx segfault).
This commit removes get/put of handle during epoll add/remove.
2019-09-28 15:31:41 +02:00
Dmitrii Kuvaiskii 1645e3435f [LibOS] Allow repeated listen() on the same socket
Typically, listen() is called only once by the application, to mark the
socket as passive for listening for client connections. Thus, LibOS had
a state machine that forbade performing repeated listen() syscalls on
the same socket. However, at least Nginx issues repeated listen's to
adjust the backlog parameter. This commit allows such corner cases.
2019-09-28 15:31:41 +02:00
Simon Gaiser 2d29f7aaeb [Makefile] Drop SGX_RUN
For detection of SGX/non-SGX (for example in regression tests) always
use the SGX environment variable. To generate launch/EINIT tokens use
the new 'sgx-tokens' Make target.
2019-09-27 12:38:14 +02:00
Simon Gaiser 13cac1df92 [Makefile] Fix missing cleans 2019-09-27 03:45:21 +02:00
Simon Gaiser 7ce7278121 [Pal/Linux-SGX] Add memory gap around 'exec' area
For this also add the user_address_hole memory range to pal_control.
This is needed to communicate (in a not SGX specific way) the reserved
memory range for the memory gaps around the exec area which can be
inside of the user_address range.
2019-09-26 02:39:03 +02:00
Chia-Che Tsai ee3619df4f [LibOS] test/apps: Rewrite Apache example 2019-09-25 15:03:34 -07:00
borysp 9cd6b34747 [Pal] Change the way argv[0] is handled
Before argv[0] was treated specially and was changed to a value
from manifest file. Now this happens only if binary was run as
a manifest i.e. `./pal_loader path_to_manifest_file`.
2019-09-25 19:16:48 +02:00
Isaku Yamahata 6e3c45c8e3 [Pal/Linux-SGX] pal-sgx-get-token, pal-sgx-sign: move to Python3 and cleanup
This commit rewrites pal-sgx-get-token and pal-sgx-sign in Python3 and
performs a comprehensive cleanup of the code:
- Outputs are sent to separate files (otherwise they were intermixed
  during parallel build)
- aesm_pb2.py is re-generated to Python3
- Numeric constants are replaced with symbolic ones
- Using argparse instead of home-grown argument parsing
- Replacing home-grown helper funcs int_to_bytes(), bytes_to_int(), etc.
  with standard functions
2019-09-24 00:24:26 -07:00
Dmitrii Kuvaiskii 57d9e3347d [LibOS] Fix typo in handle_copy() which led to failed sendfile() 2019-09-18 17:14:12 -07:00
Dmitrii Kuvaiskii 07f0e25ff2 [LibOS] shim_parser.c: Additionally specify string as "const char*"
The parser logic checks the arguments of syscalls and prints strings in
debug output. Previously, our code base only contained "const char *" as
strings. Recently, we started migration to "const char*" (no-space) style.
This broke the parser logic, so this commit adds an additional check on
what it means for a C type to be a string.
2019-09-18 15:36:11 -07:00
Isaku Yamahata 4e1d892891 [LibOS] Add missing memory barrier in regression/mmap-file.c
Previously, the test could fail if the compiler changed the order of
variable assignments (`message` vs `a[4096]`).
2019-09-18 21:55:42 +02:00
Dmitrii Kuvaiskii 5602cec15b [LibOS] fs/proc/fs.c: Remove gotos and redundant vars in proc_match_name() 2019-09-18 04:41:09 +02:00
Dmitrii Kuvaiskii 05fa2ba8c0 [LibOS] fs/proc/fs.c: Use proc_dir.size instead of proc_dir.name == NULL
Previously, there was a bug in proc_match_name(): iteration over a
proc_dir array relied on proc_dir.name == proc_dir.nm_ops == NULL.
However, there is no sentinel NULL item in actual arrays, which led to
undefined behavior. This commit changes the for-loop condition to
check proc_dir.size and not rely on the NULL item.
2019-09-18 04:41:09 +02:00
Michał Kowalczyk e98be31b00 [LibOS] test/apps: Add work-in-progress disclaimers to unfinished integrations 2019-09-11 17:15:20 +02:00
Dmitrii Kuvaiskii 17a2fbc770 [LibOS] test/apps: Add top-level README.md 2019-09-10 23:33:59 -07:00
Dmitrii Kuvaiskii 77de90aedd [LibOS] test/apps: Add Redis example 2019-09-10 17:33:20 -07:00
borysp df2f8d2de7 [LibOS] test/apps: Rewrite BusyBox example 2019-09-10 10:28:30 -07:00
Michał Kowalczyk de42ebabe1 Reformat repository to our clang-format rules 2019-09-09 22:11:23 +02:00
Michał Kowalczyk 6356559e39 Fix header dependencies 2019-09-09 22:11:23 +02:00
borysp 62ecb4bc79 [Makefile] Prevent gcc from generating trampolines 2019-09-04 03:10:33 +02:00
borysp 52b3525bab [LibOS] Fix nested function callbacks segfaulting 2019-09-04 03:10:33 +02:00
Chia-Che Tsai 34384c6bb2 [LibOS] test/apps: Rewrite R example 2019-09-04 01:51:48 +02:00
borysp 289ac3af4d [LibOS] Fix get_new_dentry reference count semantics
If `get_new_dentry` returns successfully, it increases returned dentry's
reference counter by one, which matches other similar functions' behavior.
2019-09-03 21:52:55 +02:00
borysp e23684bc3d [LibOS] Rewrite rename* syscalls
Present implementation is utterly broken, does not work even
in simplest cases.
2019-09-03 21:52:55 +02:00
Isaku Yamahata e83a5ec6fe [LibOS] Simplify shim/test/Makefile 2019-09-03 20:06:59 +02:00
Isaku Yamahata 3d19670374 [lighttpd] Add missing dependencies required by .manifest.sgx 2019-08-27 13:18:09 +02:00
Chia-Che Tsai d875e2eba7 [LibOS] Disable the warning when GIPC is not supported 2019-08-26 23:10:09 +02:00
Thomas Knauth 9af670d99f [LibOS] test/apps: Add TensorFlow Lite label_image example 2019-08-26 21:04:25 +02:00
Isaku Yamahata 1089dd015e [LibOS] Use implicit pattern rule in benchmark/Makefile
Static pattern rule isn't needed in benchmark/Makefile.
2019-08-26 00:17:10 +02:00
Isaku Yamahata aef0f4ab64 [LibOS] Use implicit pattern rule in native/Makefile
Static pattern rule isn't needed in native/Makefile.
2019-08-26 00:16:59 +02:00
Isaku Yamahata e277a05585 [LibOS] Rename {CFLAGS, CXXFLAGS, LDFLAGS}-debug to *-libos-debug
For clarity, rename {CFLAGS, CXXFLAGS, LDFLAGS}-debug to
{CFLAGS, CXXFLAGS, LDFLAGS}-libos-debug.
Also related clean up of LibOS/shim/test/inline/Makefile.
2019-08-25 11:38:02 -07:00
Isaku Yamahata 7696fc327b [LibOS] Remove CFLAGS-libos from LibOS/shim/test/benchmark/Makefile
It's already defined in LibOS/shim/test/Makefile.Test.
2019-08-25 11:38:02 -07:00
Isaku Yamahata dabaad826d [LibOS] Make test/inline build 2019-08-25 11:38:02 -07:00
Isaku Yamahata 53cb9d3e71 [LibOS] Eliminate level variable from makefiles 2019-08-25 11:38:02 -07:00
Isaku Yamahata 2ea23a298b [LibOS] Remove the reference of level variable from Makefile.Test
Remove the reference of level variable from Makefile.Test.
After this patch, level variable in Makefile's of tests can be removed.
2019-08-25 11:38:02 -07:00
Isaku Yamahata 0513886e56 [LibOS] Remove subdirs from Makefile.Test
It isn't used by Makefile in tests.
2019-08-25 11:38:02 -07:00
Isaku Yamahata 353f1f609f [LibOS/shim/test] Copy Makefile to Makefile.Test and use it
LibOS/shim/test/Makefile has confusion. It's makefile for test/ directory
and common functions for each test directory.
As a first step to untangle the confusion, copy Makefile.Test for
common functions and have test directories to use it.
Later once grapene-tests is updated, LibOS/shim/test/Makefile
will have only submake rules.
2019-08-25 11:38:02 -07:00
Isaku Yamahata 94d2197720 [LibOS] Use Makefile.rules to simplify Makefile
Simplify shim/test/{regression, native, benchmark, inline}/Makefile.
2019-08-24 01:50:58 +02:00