Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.

2015-07-07 Thread Frederic Konrad
On 07/07/2015 14:22, Alex Bennée wrote: fred.kon...@greensocs.com writes: From: KONRAD Frederic This protects TBContext with tb_lock to make tb_* thread safe. We can still have issue with tb_flush in case of multithread TCG: An other CPU can be executing code during a flush. This can be

Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.

2015-07-07 Thread Alex Bennée
fred.kon...@greensocs.com writes: > From: KONRAD Frederic > > This protects TBContext with tb_lock to make tb_* thread safe. > > We can still have issue with tb_flush in case of multithread TCG: > An other CPU can be executing code during a flush. > > This can be fixed later by making all othe

Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: > @@ -273,8 +274,9 @@ static TranslationBlock *tb_find_slow(CPUArchState *env, > ptb1 = &tcg_ctx.tb_ctx.tb_phys_hash[h]; > for(;;) { > tb = *ptb1; > -if (!tb) > -goto not_found; > +if (!tb) { > +

Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 17:39, Frederic Konrad wrote: >>> >>> @@ -11567,6 +11570,7 @@ void arm_cpu_dump_state(CPUState *cs, FILE >>> *f, fprintf_function cpu_fprintf, >>> void restore_state_to_opc(CPUARMState *env, TranslationBlock *tb, >>> int pc_pos) >>> { >>> +tb_lock(); >>> if (is_a64(e

Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.

2015-06-26 Thread Frederic Konrad
On 26/06/2015 16:56, Paolo Bonzini wrote: On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: diff --git a/target-arm/translate.c b/target-arm/translate.c index 971b6db..47345aa 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -11162,6 +11162,8 @@ static inline void gen

Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: > > diff --git a/target-arm/translate.c b/target-arm/translate.c > index 971b6db..47345aa 100644 > --- a/target-arm/translate.c > +++ b/target-arm/translate.c > @@ -11162,6 +11162,8 @@ static inline void > gen_intermediate_code_internal(ARM

[Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.

2015-06-26 Thread fred . konrad
From: KONRAD Frederic This protects TBContext with tb_lock to make tb_* thread safe. We can still have issue with tb_flush in case of multithread TCG: An other CPU can be executing code during a flush. This can be fixed later by making all other TCG thread exiting before calling tb_flush().