[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] tcg: reworking tb_invalidated_flag
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] tcg: reworking tb_invalidated_flag |
Date: |
Thu, 31 Mar 2016 21:56:50 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 31/03/2016 21:03, Sergey Fedorov wrote:
> Looks like we have to ensure all vCPUs are out of translated code when
> doing TB patching either doing tb_add_jump() or tb_phys_invalidate().
> Did I missed something?
Almost all TCG targets have naturally aligned instructions, so that's
not a problem; we can assume that 32-bit writes are atomic, though
perhaps we can change them to atomic_set just to be safe.
Only s390 and x86 can have unaligned instructions. For x86 I suppose
you can use 1 to 3 byte nops so that the first byte of the jump ends up
at ip%4=3. For s390 you can do the same, I don't know the encoding of
the canonical nop but an "or 0,0" instruction can do and is 16 bits wide
(in this case instructions are 16-bit aligned so you'd want ip%4=2).
Paolo
Re: [Qemu-devel] tcg: reworking tb_invalidated_flag, Richard Henderson, 2016/03/30
Re: [Qemu-devel] tcg: reworking tb_invalidated_flag, Alex Bennée, 2016/03/31