diff --git a/LibOS/shim/src/shim_init.c b/LibOS/shim/src/shim_init.c index 7aedcd9d5c..a83b4c01fb 100644 --- a/LibOS/shim/src/shim_init.c +++ b/LibOS/shim/src/shim_init.c @@ -594,7 +594,7 @@ DEFINE_PROFILE_INTERVAL(init_signal, init); extern PAL_HANDLE thread_start_event; -int shim_init (int argc, void * args, void ** return_stack) +int shim_init (int argc, void * args) { debug_handle = PAL_CB(debug_stream); cur_process.vmid = (IDTYPE) PAL_CB(process_id); @@ -730,7 +730,6 @@ int shim_init (int argc, void * args, void ** return_stack) execute_elf_object(cur_thread->exec, argc, argp, nauxv, auxp); - *return_stack = initial_stack; return 0; } diff --git a/LibOS/shim/src/start.S b/LibOS/shim/src/start.S index 539f8a171d..c09a37ebb0 100644 --- a/LibOS/shim/src/start.S +++ b/LibOS/shim/src/start.S @@ -37,7 +37,6 @@ shim_start: The arguments are passed via registers and on the stack: argc: %rdi argv: %rsi - stack: %rdx */ /* Align the stack to a 16 byte boundary to follow the ABI. */ @@ -47,16 +46,10 @@ shim_start: movq 0(%rbp), %rdi /* Pop the argument count. */ leaq 8(%rbp), %rsi /* argv starts just at the current stack top. */ -/* Provide the highest stack address to the user code (for stacks - which grow downwards). */ - - pushq %rbp - movq %rsp, %rdx + pushq %rdx movq shim_init@GOTPCREL(%rip), %r11 call *%r11 - popq %rbp - leaveq retq .cfi_endproc diff --git a/LibOS/shim/test/native/manifest.template b/LibOS/shim/test/native/manifest.template index 5efdf70774..f9312de9d4 100644 --- a/LibOS/shim/test/native/manifest.template +++ b/LibOS/shim/test/native/manifest.template @@ -19,4 +19,4 @@ net.rules.1 = 127.0.0.1:8000:0.0.0.0:0-65535 # allow to connect to port 8000 net.rules.2 = 0.0.0.0:0-65535:127.0.0.1:8000 -# sys.ask_for_checkpoint = 1 +sys.ask_for_checkpoint = 1 diff --git a/Pal/src/db_main.c b/Pal/src/db_main.c index 04b66a8cce..799d134543 100644 --- a/Pal/src/db_main.c +++ b/Pal/src/db_main.c @@ -239,12 +239,6 @@ void pal_main (PAL_NUM pal_token, void * pal_addr, init_slab_mgr(pal_state.alloc_align); - if (is_parent && !exec_handle && !manifest_handle) { - printf("USAGE: %s [executable|manifest] args ...\n", pal_name); - _DkProcessExit(0); - return; - } - char * exec = NULL, * manifest = NULL; if (exec_handle) { @@ -265,15 +259,17 @@ void pal_main (PAL_NUM pal_token, void * pal_addr, unsigned long before_find_manifest = _DkSystemTimeQuery(); #endif do { - assert(!!exec); - /* try open ".manifest" */ - manifest = __alloca(URI_MAX); - snprintf(manifest, URI_MAX, "%s.manifest", exec); - ret = _DkStreamOpen(&manifest_handle, - manifest, - PAL_ACCESS_RDONLY, 0, 0, 0); - if (!ret) - break; + if (exec_handle) { + assert(!!exec); + /* try open ".manifest" */ + manifest = __alloca(URI_MAX); + snprintf(manifest, URI_MAX, "%s.manifest", exec); + ret = _DkStreamOpen(&manifest_handle, + manifest, + PAL_ACCESS_RDONLY, 0, 0, 0); + if (!ret) + break; + } /* try open "file:manifest" */ manifest = "file:manifest"; @@ -353,6 +349,12 @@ void pal_main (PAL_NUM pal_token, void * pal_addr, } } + if (is_parent && !exec_handle && !manifest_handle) { + printf("USAGE: %s [executable|manifest] args ...\n", pal_name); + _DkProcessExit(0); + return; + } + pal_state.manifest = manifest; pal_state.manifest_handle = manifest_handle; pal_state.exec = exec; @@ -362,7 +364,7 @@ void pal_main (PAL_NUM pal_token, void * pal_addr, argc--; argv++; - if (is_parent && exec) { + if (is_parent && exec_handle) { first_argv = exec; if (pal_state.root_config) { char cfgbuf[CONFIG_MAX];