Re: [Qemu-devel] [RFC PATCH V6 13/18] cpu: introduce async_run_safe_work_on_cpu.

2015-06-26 Thread Frederic Konrad
On 26/06/2015 18:23, Paolo Bonzini wrote: On 26/06/2015 18:09, Frederic Konrad wrote: +void async_run_safe_work_on_cpu(CPUState *cpu, void (*func)(void *data), +void *data) +{ Do you need a mutex to protect this data structure? I would use one even if not st

Re: [Qemu-devel] [RFC PATCH V6 13/18] cpu: introduce async_run_safe_work_on_cpu.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 18:09, Frederic Konrad wrote: >>> >>> +void async_run_safe_work_on_cpu(CPUState *cpu, void (*func)(void >>> *data), >>> +void *data) >>> +{ >> Do you need a mutex to protect this data structure? I would use one >> even if not strictly necessary, to

Re: [Qemu-devel] [RFC PATCH V6 13/18] cpu: introduce async_run_safe_work_on_cpu.

2015-06-26 Thread Frederic Konrad
On 26/06/2015 17:35, Paolo Bonzini wrote: On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: diff --git a/cpu-exec.c b/cpu-exec.c index de256d6..d6442cd 100644 --- a/cpu-exec.c +++ b/cpu-exec.c Nice solution. However I still have a few questions that need clarification. @@ -382,6 +382,11

Re: [Qemu-devel] [RFC PATCH V6 13/18] cpu: introduce async_run_safe_work_on_cpu.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: > diff --git a/cpu-exec.c b/cpu-exec.c > index de256d6..d6442cd 100644 > --- a/cpu-exec.c > +++ b/cpu-exec.c Nice solution. However I still have a few questions that need clarification. > @@ -382,6 +382,11 @@ int cpu_exec(CPUArchState *env) >

[Qemu-devel] [RFC PATCH V6 13/18] cpu: introduce async_run_safe_work_on_cpu.

2015-06-26 Thread fred . konrad
From: KONRAD Frederic We already had async_run_on_cpu but we need all VCPUs outside their execution loop to execute some tb_flush/invalidate task: async_run_on_cpu_safe schedule a work on a VCPU but the work start when no more VCPUs are executing code. When a safe work is pending cpu_has_work re