Re: [Qemu-devel] [RFC v1 07/12] cpus: introduce async_safe_run_on_cpu.

2016-06-06 Thread Sergey Fedorov
On 06/06/16 11:50, Alex Bennée wrote: > Sergey Fedorov writes: > >> On 15/04/16 17:23, Alex Bennée wrote: >>> diff --git a/cpus.c b/cpus.c >>> index 9177161..860e2a9 100644 >>> --- a/cpus.c >>> +++ b/cpus.c >>> @@ -928,6 +928,19 @@ static QemuCond qemu_cpu_cond; >>> static QemuCond qemu_pause_con

Re: [Qemu-devel] [RFC v1 07/12] cpus: introduce async_safe_run_on_cpu.

2016-06-06 Thread Alex Bennée
Sergey Fedorov writes: > On 15/04/16 17:23, Alex Bennée wrote: >> diff --git a/cpu-exec-common.c b/cpu-exec-common.c >> index 3d7eaa3..c2f7c29 100644 >> --- a/cpu-exec-common.c >> +++ b/cpu-exec-common.c >> @@ -79,3 +79,4 @@ void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc) >> cpu->cu

Re: [Qemu-devel] [RFC v1 07/12] cpus: introduce async_safe_run_on_cpu.

2016-06-05 Thread Sergey Fedorov
On 15/04/16 17:23, Alex Bennée wrote: > +/* > + * Safe work interface > + * > + * Safe work is defined as work that requires the system to be > + * quiescent before making changes. > + */ > + > +void async_safe_run_on_cpu(CPUState *cpu, run_on_cpu_func func, void *data) > +{ > +CPUState *iter;

Re: [Qemu-devel] [RFC v1 07/12] cpus: introduce async_safe_run_on_cpu.

2016-06-05 Thread Sergey Fedorov
On 15/04/16 17:23, Alex Bennée wrote: > diff --git a/cpu-exec-common.c b/cpu-exec-common.c > index 3d7eaa3..c2f7c29 100644 > --- a/cpu-exec-common.c > +++ b/cpu-exec-common.c > @@ -79,3 +79,4 @@ void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc) > cpu->current_tb = NULL; > siglongjmp

[Qemu-devel] [RFC v1 07/12] cpus: introduce async_safe_run_on_cpu.

2016-04-15 Thread Alex Bennée
From: KONRAD Frederic We already had async_run_on_cpu but for some tasks we need to ensure all vCPUs have stopped running before updating shared structures. We call this safe work as it is safe to make the modifications. Work is scheduled with async_safe_run_on_cpu() which is passed the CPUState