From ce132b7bcc8931a2332167761a36d7fee213ee82 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Sat, 20 Nov 2021 13:26:47 -0500 Subject: [PATCH] fix: Remove extra memory barriers --- runtime/include/sandbox_set_as_running_sys.h | 4 +--- runtime/include/sandbox_set_as_running_user.h | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/runtime/include/sandbox_set_as_running_sys.h b/runtime/include/sandbox_set_as_running_sys.h index 24c2b97..5fa0a25 100644 --- a/runtime/include/sandbox_set_as_running_sys.h +++ b/runtime/include/sandbox_set_as_running_sys.h @@ -15,11 +15,9 @@ sandbox_set_as_running_sys(struct sandbox *sandbox, sandbox_state_t last_state) { assert(sandbox); - /* WARNING: All code before this barrier is preemptable if transitioning from RUNNING_USER */ - barrier(); + /* WARNING: All code before this assignment is preemptable if transitioning from RUNNING_USER */ sandbox->state = SANDBOX_RUNNING_SYS; barrier(); - /* WARNING: All code after this barrier is non-preemptable */ uint64_t now = __getcycles(); diff --git a/runtime/include/sandbox_set_as_running_user.h b/runtime/include/sandbox_set_as_running_user.h index f594c53..ac0e043 100644 --- a/runtime/include/sandbox_set_as_running_user.h +++ b/runtime/include/sandbox_set_as_running_user.h @@ -42,11 +42,9 @@ sandbox_set_as_running_user(struct sandbox *sandbox, sandbox_state_t last_state) runtime_sandbox_total_increment(SANDBOX_RUNNING_USER); runtime_sandbox_total_decrement(last_state); - /* WARNING: All code before this barrier is non-preemptable */ barrier(); sandbox->state = SANDBOX_RUNNING_USER; - barrier(); - /* WARNING: All code after this barrier is preemptable */ + /* WARNING: All code after this assignment is preemptable */ /* Now that we are preemptable, we can replay deferred sigalrms */ software_interrupt_deferred_sigalrm_replay();