-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This implements two new LKL hooks. The first one to create an lthread with a specific initial register state (to capture the returns-twice behaviour of clone, along with the caller's ability to define the stack and TLS addresses). The new thread is immediately associated with the Linux task structure (normally, lthreads are associated with Linux tasks lazily when they perform a system call). The second hook destroys a thread. This is done in response to an exit system call. This is somewhat complicated, because LKL never returns to this thread and the thread's stack may be deallocated by the time we exit it. The lthread scheduler does not have an easy way of adding a mechanism to kill a thread without that thread running. We can add one eventually, but for now create a temporary stack that lthreads can use during teardown and make them run the teardown from there. Disable access02 test. It is spuriously passing and this makes it fail. See #277 for more information. Fixes #155
- Loading branch information
1 parent
60d2249
commit 24b7865
Showing
9 changed files
with
358 additions
and
16 deletions.
There are no files selected for viewing
Submodule lkl
updated
8 files
+1 −0 | arch/lkl/Kconfig | |
+2 −0 | arch/lkl/include/asm/sched.h | |
+0 −1 | arch/lkl/include/asm/syscalls.h | |
+7 −0 | arch/lkl/include/asm/thread_info.h | |
+12 −0 | arch/lkl/include/uapi/asm/host_ops.h | |
+2 −0 | arch/lkl/include/uapi/asm/unistd.h | |
+39 −1 | arch/lkl/kernel/syscalls.c | |
+38 −4 | arch/lkl/kernel/threads.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM alpine:3.6 AS builder | ||
|
||
RUN apk add --no-cache gcc musl-dev | ||
|
||
ADD *.c / | ||
RUN gcc -fPIE -pie -o clone clone.c -g | ||
|
||
FROM alpine:3.6 | ||
|
||
COPY --from=builder clone . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
include ../../common.mk | ||
|
||
PROG=clone | ||
PROG_SRC=$(PROG).c | ||
IMAGE_SIZE=5M | ||
|
||
EXECUTION_TIMEOUT=60 | ||
|
||
SGXLKL_ENV=SGXLKL_ETHREADS=8 SGXLKL_VERBOSE=1 SGXLKL_KERNEL_VERBOSE=1 | ||
SGXLKL_HW_PARAMS=--hw-debug | ||
SGXLKL_SW_PARAMS=--sw-debug | ||
|
||
SGXLKL_ROOTFS=sgx-lkl-rootfs.img | ||
|
||
.DELETE_ON_ERROR: | ||
.PHONY: all clean | ||
|
||
$(SGXLKL_ROOTFS): $(PROG_SRC) | ||
${SGXLKL_DISK_TOOL} create --size=${IMAGE_SIZE} --docker=./Dockerfile ${SGXLKL_ROOTFS} | ||
|
||
gettimeout: | ||
@echo ${EXECUTION_TIMEOUT} | ||
|
||
run: run-hw run-sw | ||
|
||
run-gdb: run-hw-gdb | ||
|
||
run-hw: ${SGXLKL_ROOTFS} | ||
$(SGXLKL_ENV) $(SGXLKL_STARTER) $(SGXLKL_HW_PARAMS) $(SGXLKL_ROOTFS) $(PROG) | ||
|
||
run-sw: ${SGXLKL_ROOTFS} | ||
$(SGXLKL_ENV) $(SGXLKL_STARTER) $(SGXLKL_SW_PARAMS) $(SGXLKL_ROOTFS) $(PROG) | ||
|
||
run-hw-gdb: ${SGXLKL_ROOTFS} | ||
$(SGXLKL_ENV) $(SGXLKL_GDB) --args $(SGXLKL_STARTER) $(SGXLKL_HW_PARAMS) $(SGXLKL_ROOTFS) $(PROG) | ||
|
||
run-sw-gdb: ${SGXLKL_ROOTFS} | ||
$(SGXLKL_ENV) $(SGXLKL_GDB) --args $(SGXLKL_STARTER) $(SGXLKL_SW_PARAMS) $(SGXLKL_ROOTFS) $(PROG) | ||
|
||
clean: | ||
rm -f $(SGXLKL_ROOTFS) $(PROG) |
Oops, something went wrong.