fix: correct bugs

main
Sean McBride 4 years ago
parent b979809c12
commit 47672b4c93

@ -93,7 +93,7 @@ arch_context_switch(struct arch_context *current, struct arch_context *next)
* Check if the variant of the context we're trying to switch to is SLOW (mcontext-based)
* If it is, jump to label 1 to restore the preempted sandbox
*/
"cmpq $2, (%%rcx)\n\t" /* if (next->variant == ARCH_CONTEXT_SLOW); */
"cmpq $2, (%%rdx)\n\t" /* if (next->variant == ARCH_CONTEXT_SLOW); */
"je 1f\n\t" /* goto 1; restore the existing sandbox using mcontext */
/*

@ -11,7 +11,6 @@
*/
void __attribute__((noinline)) __attribute__((noreturn)) arch_context_mcontext_restore(void)
{
debuglog("Sending SIGUSR1");
pthread_kill(pthread_self(), SIGUSR1);
assert(false);
}

@ -125,8 +125,8 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void
/* Extra checks to verify that preemption properly set context state */
assert(current_sandbox->ctxt.variant == ARCH_CONTEXT_SLOW);
assert(current_sandbox->ctxt.regs[UREG_RSP] != 0);
assert(current_sandbox->ctxt.regs[UREG_RIP] != 0);
assert(current_sandbox->ctxt.regs[UREG_RSP] == 0);
assert(current_sandbox->ctxt.regs[UREG_RIP] == 0);
software_interrupt_SIGUSR_count++;
debuglog("usr1:%d\n", software_interrupt_SIGUSR_count);

Loading…
Cancel
Save