From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTfZ6-0006xz-SI for qemu-devel@nongnu.org; Sun, 23 Aug 2015 20:24:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTfZ4-0000ku-Mm for qemu-devel@nongnu.org; Sun, 23 Aug 2015 20:24:44 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:38941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTfZ4-0000km-Jp for qemu-devel@nongnu.org; Sun, 23 Aug 2015 20:24:42 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 648F7209DC for ; Sun, 23 Aug 2015 20:24:42 -0400 (EDT) From: "Emilio G. Cota" Date: Sun, 23 Aug 2015 20:23:54 -0400 Message-Id: <1440375847-17603-26-git-send-email-cota@braap.org> In-Reply-To: <1440375847-17603-1-git-send-email-cota@braap.org> References: <1440375847-17603-1-git-send-email-cota@braap.org> Subject: [Qemu-devel] [RFC 25/38] cpu: add barriers around cpu->tcg_exit_req List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, mttcg@listserver.greensocs.com Cc: mark.burton@greensocs.com, a.rigo@virtualopensystems.com, guillaume.delbergue@greensocs.com, pbonzini@redhat.com, alex.bennee@linaro.org, Frederic Konrad Signed-off-by: Emilio G. Cota --- include/exec/gen-icount.h | 1 + translate-all.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h index 05d89d3..f429821 100644 --- a/include/exec/gen-icount.h +++ b/include/exec/gen-icount.h @@ -16,6 +16,7 @@ static inline void gen_tb_start(TranslationBlock *tb) exitreq_label = gen_new_label(); flag = tcg_temp_new_i32(); + tcg_gen_smp_rmb(); tcg_gen_ld_i32(flag, cpu_env, offsetof(CPUState, tcg_exit_req) - ENV_OFFSET); tcg_gen_brcondi_i32(TCG_COND_NE, flag, 0, exitreq_label); diff --git a/translate-all.c b/translate-all.c index 12eaed7..76a0be8 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1614,6 +1614,7 @@ static void tcg_handle_interrupt(CPUState *cpu, int mask) cpu_abort(cpu, "Raised interrupt while not in I/O function"); } } else { + smp_wmb(); cpu->tcg_exit_req = 1; } } @@ -1791,6 +1792,7 @@ void dump_opcount_info(FILE *f, fprintf_function cpu_fprintf) void cpu_interrupt(CPUState *cpu, int mask) { atomic_or(&cpu->interrupt_request, mask); + smp_wmb(); cpu->tcg_exit_req = 1; } -- 1.9.1