From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV1Vz-0006Oz-Ht for qemu-devel@nongnu.org; Wed, 24 Apr 2013 11:21:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UV1Vr-0008KW-N5 for qemu-devel@nongnu.org; Wed, 24 Apr 2013 11:21:47 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47658 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV1Vr-0008JP-2f for qemu-devel@nongnu.org; Wed, 24 Apr 2013 11:21:39 -0400 Message-ID: <5177F87B.2030801@suse.de> Date: Wed, 24 Apr 2013 17:21:31 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1366705795-24732-1-git-send-email-imammedo@redhat.com> <1366705795-24732-4-git-send-email-imammedo@redhat.com> In-Reply-To: <1366705795-24732-4-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 03/21] introduce cpu_resume(), for single CPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com, ehabkost@redhat.com, gleb@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, quintela@redhat.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, aderumier@odiso.com, lcapitulino@redhat.com, blauwirbel@gmail.com, anthony.perard@citrix.com, alex.williamson@redhat.com, kraxel@redhat.com, yang.z.zhang@intel.com, pbonzini@redhat.com, stefano.stabellini@eu.citrix.com, armbru@redhat.com, rth@twiddle.net Am 23.04.2013 10:29, schrieb Igor Mammedov: > also add stub for it, to make possible to use it in qom/cpu.c, > which is shared with user emulators. >=20 > Signed-off-by: Igor Mammedov > --- > v2: > * rename resume_vcpu() to cpu_resume() > * remove comment about neccessity to call cpu_synchronize_post_init() > which is applicable only to CPU creation. But not to generic CPU > resume. Thanks, applied to qom-cpu (with a minor change below): https://github.com/afaerber/qemu-cpu/commits/qom-cpu >=20 > Note: > it will be re-used from qom/cpu.c by hotpluged CPU > --- > cpus.c | 11 ++++++++--- > include/qom/cpu.h | 7 +++++++ > stubs/Makefile.objs | 1 + > stubs/cpus.c | 5 +++++ > 4 files changed, 21 insertions(+), 3 deletions(-) > create mode 100644 stubs/cpus.c >=20 > diff --git a/cpus.c b/cpus.c > index 5a98a37..1d88761 100644 > --- a/cpus.c > +++ b/cpus.c > @@ -993,6 +993,13 @@ void pause_all_vcpus(void) > } > } > =20 > +void cpu_resume(CPUState *cpu) > +{ > + cpu->stop =3D false; > + cpu->stopped =3D false; > + qemu_cpu_kick(cpu); > +} > + > void resume_all_vcpus(void) > { > CPUArchState *penv =3D first_cpu; > @@ -1000,9 +1007,7 @@ void resume_all_vcpus(void) > qemu_clock_enable(vm_clock, true); > while (penv) { > CPUState *pcpu =3D ENV_GET_CPU(penv); > - pcpu->stop =3D false; > - pcpu->stopped =3D false; > - qemu_cpu_kick(pcpu); > + cpu_resume(pcpu); > penv =3D penv->next_cpu; > } > } > diff --git a/include/qom/cpu.h b/include/qom/cpu.h > index 3664a1b..d6a0e80 100644 > --- a/include/qom/cpu.h > +++ b/include/qom/cpu.h > @@ -256,5 +256,12 @@ void cpu_interrupt(CPUState *cpu, int mask); > */ > void cpu_reset_interrupt(CPUState *cpu, int mask); > =20 > +/** > + * cpu_resume: > + * @cpu: The CPU to resume. > + * > + * Resumes CPU, i.e. puts CPU into runable state. "runnable" > + */ > +void cpu_resume(CPUState *cpu); > =20 > #endif I note that you're dropping a white line, but okay. > diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs > index 9c55b34..03dff20 100644 > --- a/stubs/Makefile.objs > +++ b/stubs/Makefile.objs > @@ -23,3 +23,4 @@ stub-obj-y +=3D sysbus.o > stub-obj-y +=3D vm-stop.o > stub-obj-y +=3D vmstate.o > stub-obj-$(CONFIG_WIN32) +=3D fd-register.o > +stub-obj-y +=3D cpus.o > diff --git a/stubs/cpus.c b/stubs/cpus.c > new file mode 100644 > index 0000000..37000dd > --- /dev/null > +++ b/stubs/cpus.c > @@ -0,0 +1,5 @@ > +#include "qom/cpu.h" > + > +void cpu_resume(CPUState *cpu) > +{ > +} Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg