From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO7zd-0005PD-AU for qemu-devel@nongnu.org; Wed, 18 Feb 2015 12:01:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YO7zZ-000386-3X for qemu-devel@nongnu.org; Wed, 18 Feb 2015 12:00:57 -0500 Received: from cantor2.suse.de ([195.135.220.15]:45744 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YO7zY-00037N-Tx for qemu-devel@nongnu.org; Wed, 18 Feb 2015 12:00:53 -0500 Message-ID: <54E4C4E7.9060405@suse.de> Date: Wed, 18 Feb 2015 17:59:19 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1424271115-7885-1-git-send-email-leon.alrae@imgtec.com> <1424271115-7885-2-git-send-email-leon.alrae@imgtec.com> In-Reply-To: <1424271115-7885-2-git-send-email-leon.alrae@imgtec.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/2] target-mips: replace cpu_save/cpu_load with VMStateDescription List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leon Alrae , qemu-devel@nongnu.org Cc: amit.shah@redhat.com, macro@linux-mips.org, aurelien@aurel32.net, quintela@redhat.com Hi Leon, Am 18.02.2015 um 15:51 schrieb Leon Alrae: > Create VMStateDescription for MIPS CPU. The new structure contains exac= tly the > same fields as before, therefore leaving existing version_id. >=20 > Signed-off-by: Leon Alrae > --- > target-mips/cpu-qom.h | 4 + > target-mips/cpu.c | 1 + > target-mips/cpu.h | 2 - > target-mips/machine.c | 567 ++++++++++++++++++++++--------------------= -------- > 4 files changed, 257 insertions(+), 317 deletions(-) [...] > diff --git a/target-mips/cpu.c b/target-mips/cpu.c > index 98dc94e..cbdc463 100644 > --- a/target-mips/cpu.c > +++ b/target-mips/cpu.c > @@ -148,6 +148,7 @@ static void mips_cpu_class_init(ObjectClass *c, voi= d *data) > cc->do_unassigned_access =3D mips_cpu_unassigned_access; > cc->do_unaligned_access =3D mips_cpu_do_unaligned_access; > cc->get_phys_page_debug =3D mips_cpu_get_phys_page_debug; > + dc->vmsd =3D &vmstate_mips_cpu; This looks wrong. There's two ways to do a CPU VMSD, 1) via dc->vmsd, and 2) via cc->vmsd. When going for the new dc->vmsd, the common CPU state would need to be referenced from vmstate_mips_cpu below. Doing so would break backwards compatibility, so you probably want cc->vmsd, causing a separate VMSD for the common parts to be registered. Regards, Andreas > #endif > =20 > cc->gdb_num_core_regs =3D 73; [...] > diff --git a/target-mips/machine.c b/target-mips/machine.c > index 6c76dfb..8d75962 100644 > --- a/target-mips/machine.c > +++ b/target-mips/machine.c > @@ -1,341 +1,278 @@ [...] > +const VMStateDescription vmstate_mips_cpu =3D { > + .name =3D "cpu", > + .version_id =3D 5, > + .minimum_version_id =3D 5, > + .fields =3D (VMStateField[]) { > + /* active TC */ > + VMSTATE_STRUCT(env.active_tc, MIPSCPU, 1, vmstate_tc, TCState)= , > + [snip] --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton; HRB 21284 (AG N=FCrnberg)