Skip to content

Commit

Permalink
Remove unused code for virtio shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
prp committed Aug 15, 2020
1 parent f48b753 commit f8553fa
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 27 deletions.
18 changes: 2 additions & 16 deletions src/enclave/enclave_event_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ static enc_dev_config_t* _enc_dev_config = NULL;
static bool _event_channel_initialized = false;
static uint8_t _evt_channel_num;

/*
* Function to check whether virtio event channel task should stop or not
*/
static inline uint8_t vio_shutdown_requested(void)
{
return lthread_should_stop();
}

/*
* Function to yield the virtio event channel task
*/
Expand All @@ -46,8 +38,7 @@ static inline void vio_wait_for_host_event(
SGXLKL_ASSERT(lt && lt == lthread_self());

/* Return if the event channel was signaled */
if ((__atomic_load_n(evt_chn, __ATOMIC_SEQ_CST) != val) ||
vio_shutdown_requested())
if ((__atomic_load_n(evt_chn, __ATOMIC_SEQ_CST) != val))
{
return;
}
Expand Down Expand Up @@ -125,12 +116,7 @@ static void vio_enclave_process_host_event(uint8_t* param)
lkl_virtio_deliver_irq(dev_id);
*evt_processed = cur;
}

if (vio_shutdown_requested())
break;
}
lthread_detach2(lthread_self());
lthread_exit(0);
}

/*
Expand Down Expand Up @@ -217,7 +203,7 @@ int vio_enclave_wakeup_event_channel(void)
continue;

int rc = vio_signal_evt_channel(dev_id);
if (rc || vio_shutdown_requested())
if (rc)
lthread_wakeup(vio_tasks[dev_id]);
ret |= rc;
ticket_unlock(evt_chn_lock[dev_id]);
Expand Down
2 changes: 0 additions & 2 deletions src/include/enclave/lthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ extern "C"

void lthread_notify_completion(void);

bool lthread_should_stop(void);

void lthread_run(void);

int lthread_join(struct lthread* lt, void** ptr, uint64_t timeout);
Expand Down
9 changes: 0 additions & 9 deletions src/sched/lthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,6 @@ void lthread_notify_completion(void)
_lthread_should_stop = true;
}

/*
* Returns whether thread should stop. This function is called by enclave task
* to check whether a shutdown has been triggered to do a graceful exit.
*/
bool lthread_should_stop(void)
{
return _lthread_should_stop;
}

void lthread_run(void)
{
const struct lthread_sched* const sched = lthread_get_sched();
Expand Down

0 comments on commit f8553fa

Please sign in to comment.