Re: [Qemu-devel] [PATCH 13/16] translate-all: protect TB jumps with a per-destination-TB lock

2018-03-28 Thread Alex Bennée
Emilio G. Cota writes: > This applies to both user-mode and !user-mode emulation. > > @@ -2124,7 +2148,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr) > /* Adjust the execution state of the next TB. */ > cpu->cflags_next_tb = curr_cflags() | CF_LAST_IO |

Re: [Qemu-devel] [PATCH 13/16] translate-all: protect TB jumps with a per-destination-TB lock

2018-02-27 Thread Paolo Bonzini
On 27/02/2018 12:43, Laurent Desnogues wrote: > On Tue, Feb 27, 2018 at 12:33 PM, Paolo Bonzini wrote: >> On 27/02/2018 06:39, Emilio G. Cota wrote: >>> Using a hash table or a binary tree to keep track of the jumps >>> doesn't really pay off, not only due to the increased

Re: [Qemu-devel] [PATCH 13/16] translate-all: protect TB jumps with a per-destination-TB lock

2018-02-27 Thread Laurent Desnogues
On Tue, Feb 27, 2018 at 12:33 PM, Paolo Bonzini wrote: > On 27/02/2018 06:39, Emilio G. Cota wrote: >> Using a hash table or a binary tree to keep track of the jumps >> doesn't really pay off, not only due to the increased memory usage, >> but also because most TBs have only

Re: [Qemu-devel] [PATCH 13/16] translate-all: protect TB jumps with a per-destination-TB lock

2018-02-27 Thread Paolo Bonzini
On 27/02/2018 06:39, Emilio G. Cota wrote: > Using a hash table or a binary tree to keep track of the jumps > doesn't really pay off, not only due to the increased memory usage, > but also because most TBs have only 0 or 1 jumps to them. The maximum > number of jumps when booting debian-arm that I

[Qemu-devel] [PATCH 13/16] translate-all: protect TB jumps with a per-destination-TB lock

2018-02-26 Thread Emilio G. Cota
This applies to both user-mode and !user-mode emulation. Instead of relying on a global lock, protect the list of incoming jumps with tb->jmp_lock. This lock also protects tb->cflags, so update all tb->cflags readers outside tb->jmp_lock to use atomic reads via tb_cflags(). In order to find the