[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 25/38] cpu: add barriers around cpu->tcg_exit_req
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [RFC 25/38] cpu: add barriers around cpu->tcg_exit_req |
Date: |
Sun, 23 Aug 2015 20:23:54 -0400 |
Signed-off-by: Emilio G. Cota <address@hidden>
---
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
- [Qemu-devel] [RFC 14/38] softmmu: add helpers to get ld/st physical addresses, (continued)
- [Qemu-devel] [RFC 14/38] softmmu: add helpers to get ld/st physical addresses, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 17/38] aie: add target helpers, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 15/38] radix-tree: add generic lockless radix tree module, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 16/38] aie: add module for Atomic Instruction Emulation, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 20/38] tcg/i386: implement fences, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 29/38] tcg: export have_tb_lock, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 25/38] cpu: add barriers around cpu->tcg_exit_req,
Emilio G. Cota <=
- [Qemu-devel] [RFC 23/38] cpu-exec: grab iothread lock during interrupt handling, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 24/38] cpu-exec: reset mmap_lock after exiting the CPU loop, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 09/38] rcu: fix comment with s/rcu_gp_lock/rcu_registry_lock/, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 30/38] translate-all: add tb_lock assertions, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 26/38] cpu: protect tb_jmp_cache with seqlock, Emilio G. Cota, 2015/08/23