[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 15/39] qom/cpu: atomically clear the tb_jmp_cache
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 15/39] qom/cpu: atomically clear the tb_jmp_cache |
Date: |
Fri, 7 Oct 2016 18:57:39 +0200 |
From: Alex Bennée <address@hidden>
The ThreadSanitizer rightly complains that something initialised with a
normal access is later updated and read atomically.
Signed-off-by: Alex Bennée <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
qom/cpu.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/qom/cpu.c b/qom/cpu.c
index 484c493..ef905da 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -253,6 +253,7 @@ void cpu_reset(CPUState *cpu)
static void cpu_common_reset(CPUState *cpu)
{
CPUClass *cc = CPU_GET_CLASS(cpu);
+ int i;
if (qemu_loglevel_mask(CPU_LOG_RESET)) {
qemu_log("CPU Reset (CPU %d)\n", cpu->cpu_index);
@@ -268,7 +269,10 @@ static void cpu_common_reset(CPUState *cpu)
cpu->can_do_io = 1;
cpu->exception_index = -1;
cpu->crash_occurred = false;
- memset(cpu->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof(void *));
+
+ for (i = 0; i < TB_JMP_CACHE_SIZE; ++i) {
+ atomic_set(&cpu->tb_jmp_cache[i], NULL);
+ }
}
static bool cpu_common_has_work(CPUState *cs)
--
2.7.4
- [Qemu-devel] [PULL 05/39] intc/i8259: implement InterruptStatsProvider interface, (continued)
- [Qemu-devel] [PULL 05/39] intc/i8259: implement InterruptStatsProvider interface, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 06/39] intc/slavio_intctl: implement InterruptStatsProvider interface, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 07/39] intc/lm32_pic: implement InterruptStatsProvider interface, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 08/39] intc: make HMP 'info irq' and 'info pic' commands use InterruptStatsProvider interface, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 09/39] intc: make HMP 'info irq' and 'info pic' commands available on all targets, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 10/39] atomic.h: fix __SANITIZE_THREAD__ build, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 11/39] atomic.h: comment on use of atomic_read/set, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 12/39] tcg/optimize: move default return out of if statement, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 13/39] seqlock: use atomic writes for the sequence, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 14/39] qom/object: update class cache atomically, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 15/39] qom/cpu: atomically clear the tb_jmp_cache,
Paolo Bonzini <=
- [Qemu-devel] [PULL 16/39] cpu: atomically modify cpu->exit_request, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 17/39] util/qht: atomically set b->hashes, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 18/39] linux-user/syscall: extend lock around cpu-list, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 19/39] qga/command: use QEMU atomic primitives, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 20/39] .travis.yml: add gcc sanitizer build, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 22/39] char: use a fixed idx for child muxed chr, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 21/39] i8259: give ISA device when registering ISA ioports, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 23/39] char: update read handler in all cases, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 25/39] qemu_kill_report: Report PID name too, Paolo Bonzini, 2016/10/07
- [Qemu-devel] [PULL 24/39] util: Introduce qemu_get_pid_name, Paolo Bonzini, 2016/10/07