mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-07-04 02:48:15 +00:00
qom/cpu: atomically clear the tb_jmp_cache
The ThreadSanitizer rightly complains that something initialised with a normal access is later updated and read atomically. Backports commit ce7cf6a973f4b614162b9518954d441fa5e32fc6 from qemu
This commit is contained in:
parent
12d7e946a1
commit
e1cf9ca84a
|
@ -155,6 +155,7 @@ void cpu_reset(CPUState *cpu)
|
||||||
static void cpu_common_reset(CPUState *cpu)
|
static void cpu_common_reset(CPUState *cpu)
|
||||||
{
|
{
|
||||||
CPUClass *cc = CPU_GET_CLASS(cpu->uc, cpu);
|
CPUClass *cc = CPU_GET_CLASS(cpu->uc, cpu);
|
||||||
|
int i;
|
||||||
|
|
||||||
if (qemu_loglevel_mask(CPU_LOG_RESET)) {
|
if (qemu_loglevel_mask(CPU_LOG_RESET)) {
|
||||||
qemu_log("CPU Reset (CPU %d)\n", cpu->cpu_index);
|
qemu_log("CPU Reset (CPU %d)\n", cpu->cpu_index);
|
||||||
|
@ -170,7 +171,10 @@ static void cpu_common_reset(CPUState *cpu)
|
||||||
cpu->can_do_io = 0;
|
cpu->can_do_io = 0;
|
||||||
cpu->exception_index = -1;
|
cpu->exception_index = -1;
|
||||||
cpu->crash_occurred = false;
|
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)
|
static bool cpu_common_has_work(CPUState *cs)
|
||||||
|
|
Loading…
Reference in a new issue