Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
fixup! [LibOS] Rework signal handling and syscall emulation
Browse files Browse the repository at this point in the history
  • Loading branch information
boryspoplawski committed Feb 4, 2021
1 parent db8b340 commit d647f77
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions LibOS/shim/src/bookkeep/shim_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ static bool is_rt_sq_empty(struct shim_rt_signal_queue* queue) {
return queue->get_idx == queue->put_idx;
}

static bool has_standard_signal(struct shim_signal* queue) {
return queue->siginfo.si_signo != 0;
static bool has_standard_signal(struct shim_signal* signal_slot) {
return signal_slot->siginfo.si_signo != 0;
}

static void recalc_pending_mask(struct shim_signal_queue* queue, int sig) {
Expand Down
2 changes: 1 addition & 1 deletion LibOS/shim/src/bookkeep/shim_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static int init_main_thread(void) {
}

/* TODO: I believe there is some Pal allocated initial stack which could be reused by the first
* thread. */
* thread. Tracked: https://github.com/oscarlab/graphene/issues/2140 */
int ret = alloc_thread_libos_stack(cur_thread);
if (ret < 0) {
put_thread(cur_thread);
Expand Down
3 changes: 2 additions & 1 deletion LibOS/shim/src/shim_context-x86_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ void prepare_sigframe(PAL_CONTEXT* context, siginfo_t* siginfo, void* handler, v
* these flags are not strictly needed, but we do store SS in ucontext so let's just set them. */
sigframe->uc.uc_flags = UC_SIGCONTEXT_SS | UC_STRICT_RESTORE_SS;
sigframe->uc.uc_link = NULL;
/* TODO: add support for SA_AUTODISARM */
/* TODO: add support for SA_AUTODISARM
* Tracked: https://github.com/oscarlab/graphene/issues/2140 */
sigframe->uc.uc_stack = current->signal_altstack;

pal_context_to_ucontext(&sigframe->uc, context);
Expand Down
4 changes: 2 additions & 2 deletions Pal/src/host/Linux-SGX/db_exception.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ void _DkRaiseFailure(int error) {
}

/* TODO: shouldn't this function ignore sync events???
* actually what is the point of this function? */
* actually what is the point of this function?
* Tracked: https://github.com/oscarlab/graphene/issues/2140 */
noreturn void _DkHandleExternalEvent(PAL_NUM event, sgx_cpu_context_t* uc,
PAL_XREGS_STATE* xregs_state) {
assert(event > 0 && event < PAL_EVENT_NUM_BOUND);
Expand All @@ -297,7 +298,6 @@ noreturn void _DkHandleExternalEvent(PAL_NUM event, sgx_cpu_context_t* uc,
(*upcall)(ADDR_IN_PAL(uc->rip), /*addr=*/0, &ctx);
}

// TODO: restore_pal_context(uc, &ctx);
/* modification to PAL_CONTEXT is discarded; it is assumed that LibOS won't change context
* (GPRs, FP registers) if RIP is in PAL.
*
Expand Down
3 changes: 2 additions & 1 deletion Pal/src/host/Linux/pal_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ typedef struct pal_handle {

#define HANDLE_TYPE(handle) ((handle)->hdr.type)

// TODO: remove these
/* TODO: remove these
* Tracked: https://github.com/oscarlab/graphene/issues/2140 */
#define LEAVE_PAL_CALL() \
do { \
} while (0)
Expand Down

0 comments on commit d647f77

Please sign in to comment.