From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ar2h3-0002mE-VX for qemu-devel@nongnu.org; Fri, 15 Apr 2016 08:17:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ar2gz-00052r-58 for qemu-devel@nongnu.org; Fri, 15 Apr 2016 08:17:49 -0400 References: <1460710980-9995-1-git-send-email-thuth@redhat.com> <5710BF9C.6070603@ilande.co.uk> From: Thomas Huth Message-ID: <5710DBE3.8000808@redhat.com> Date: Fri, 15 Apr 2016 14:17:39 +0200 MIME-Version: 1.0 In-Reply-To: <5710BF9C.6070603@ilande.co.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-2.6] ppc: Fix migration of the XER register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland , qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Cc: aik@ozlabs.ru, rth@twiddle.net, agraf@suse.de, qemu-devel@nongnu.org On 15.04.2016 12:17, Mark Cave-Ayland wrote: > On 15/04/16 10:03, Thomas Huth wrote: >=20 >> env->xer only holds the lower bits of the XER register nowadays, the >> SO, OV and CA bits are stored in separate variables (see the function >> cpu_write_xer() for details). Since the migration code currently only >> reads the "xer" variable, the upper bits are lost during migration. >> Fix it by using cpu_read_xer() instead. >> >> Signed-off-by: Thomas Huth >=20 > This looks like the pre_save counterpart to the post_load patch I sent > in January (see 6a9620e60cc1b16dba9ee9d9d8cb374e4303c072) so I'm fairly > sure this is right. Ah, ok, that's why the load part was already right :-) Looks like the cpu_read/write_xer() functions have originally been introduced in da91a00f ("Split out SO, OV, CA fields from XER"), and this patch also used it for the load and save functions in machine.c. However, a little bit later, the functions had been changed to use VMState instead (see a90db158 - "Convert ppc cpu savevm to VMStateDescription"), and the cpu_read/write_xer() calls accidentally got dropped in this patch. So introducing them again now is really the right thing to do. > Reviewed-by: Mark Cave-Ayland Thanks! Thomas