From 95d14671170a714570d5fc956511867631acfabe Mon Sep 17 00:00:00 2001 From: "Sean T. Allen" Date: Thu, 24 Sep 2020 13:49:23 +0000 Subject: [PATCH] Remove unneeded init_clock_res Closes #816 --- sgx-lkl-musl | 2 +- src/enclave/enclave_init.c | 6 ++---- user/enter.c | 2 -- user/userargs.h | 3 --- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/sgx-lkl-musl b/sgx-lkl-musl index cd8ba32e1..fce48dab7 160000 --- a/sgx-lkl-musl +++ b/sgx-lkl-musl @@ -1 +1 @@ -Subproject commit cd8ba32e13cb1c75945e972fcf417463949e79bd +Subproject commit fce48dab72992e801747cbd1566a792f471fad76 diff --git a/src/enclave/enclave_init.c b/src/enclave/enclave_init.c index 4c1df4805..c1efe1fd8 100644 --- a/src/enclave/enclave_init.c +++ b/src/enclave/enclave_init.c @@ -131,7 +131,6 @@ static void _enter_user_space( args.num_ethreads = num_ethreads; args.sw_debug_mode = sgxlkl_in_sw_debug_mode(); args.__gdb_load_debug_symbols_alive_ptr = &__gdb_load_debug_symbols_alive; - memcpy(args.clock_res, clock_res, sizeof(args.clock_res)); (*proc)(&args, sizeof(args)); } @@ -245,14 +244,13 @@ int __libc_init_enclave(int argc, char** argv) tmp[i].tv_sec = hex_to_int(cfg->clock_res[i].resolution, 8); tmp[i].tv_nsec = hex_to_int(cfg->clock_res[i].resolution + 8, 8); } - init_clock_res(tmp); size_t max_lthreads = cfg->max_user_threads * sizeof(*__scheduler_queue.buffer); max_lthreads = next_power_of_2(max_lthreads); newmpmcq(&__scheduler_queue, max_lthreads, 0); - + init_ethread_tp(); size_t espins = cfg->espins; @@ -262,7 +260,7 @@ int __libc_init_enclave(int argc, char** argv) SGXLKL_VERBOSE("calling _lthread_sched_init()\n"); _lthread_sched_init(cfg->stacksize); - + /* Run startmain() in a new lthread */ { static startmain_args_t args; diff --git a/user/enter.c b/user/enter.c index 8ab196045..62f4966a4 100644 --- a/user/enter.c +++ b/user/enter.c @@ -72,8 +72,6 @@ void sgxlkl_user_enter(sgxlkl_userargs_t* args, size_t args_size) init_sysconf(args->num_ethreads, args->num_ethreads); - init_clock_res((struct timespec*)args->clock_res); - __init_libc(args->argv + args->argc + 1, args->argv[0]); __libc_start_init(); _barrier(); diff --git a/user/userargs.h b/user/userargs.h index 818aa8122..ed42a07d0 100644 --- a/user/userargs.h +++ b/user/userargs.h @@ -36,9 +36,6 @@ typedef struct sgxlkl_userargs const void* elf64_hdr; size_t num_ethreads; - /* to be passed to init_clock_res() */ - struct sgxlkl_user_timespec clock_res[8]; - /* where in debug mode or not */ bool sw_debug_mode;