tcg: access cpu->icount_decr.u16.high with atomics

Consistently access u16.high with atomics to avoid
undefined behaviour in MTTCG.

Note that icount_decr.u16.low is only used in icount mode,
so regular accesses to it are OK.

Backports part of commit fff42f183ea4c3967405d4c1dce6d97dae4d64c8 from
qemu
This commit is contained in:
Emilio G. Cota 2018-10-23 14:36:36 -04:00 committed by Lioncash
parent e01deeb9ba
commit 9ce38c20b9
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -145,7 +145,7 @@ static void cpu_common_reset(CPUState *cpu)
cpu->mem_io_pc = 0;
cpu->mem_io_vaddr = 0;
cpu->icount_extra = 0;
cpu->icount_decr.u32 = 0;
atomic_set(&cpu->icount_decr.u32, 0);
cpu->can_do_io = 0;
cpu->exception_index = -1;
cpu->crash_occurred = false;