From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNmQ3-00033X-Te for qemu-devel@nongnu.org; Mon, 25 Jan 2016 14:03:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNmPz-0001OG-TB for qemu-devel@nongnu.org; Mon, 25 Jan 2016 14:03:19 -0500 References: <1452104533-8516-1-git-send-email-mark.cave-ayland@ilande.co.uk> <1452104533-8516-4-git-send-email-mark.cave-ayland@ilande.co.uk> <568F1F0C.6050501@ozlabs.ru> From: Alexander Graf Message-ID: <56A67171.7010004@suse.de> Date: Mon, 25 Jan 2016 20:03:13 +0100 MIME-Version: 1.0 In-Reply-To: <568F1F0C.6050501@ozlabs.ru> Content-Type: multipart/alternative; boundary="------------080005010102080701000705" Subject: Re: [Qemu-devel] [PATCH 3/4] target-ppc: add CPU access_type into the migration stream List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , Mark Cave-Ayland , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, quintela@redhat.com, amit.shah@redhat.com This is a multi-part message in MIME format. --------------080005010102080701000705 Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 7bit On 01/08/2016 03:29 AM, Alexey Kardashevskiy wrote: > On 01/07/2016 05:22 AM, Mark Cave-Ayland wrote: >> This is referenced in cpu_ppc_handle_mmu_fault() and so should be >> included >> in the migration stream. >> >> Signed-off-by: Mark Cave-Ayland >> --- >> target-ppc/machine.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/target-ppc/machine.c b/target-ppc/machine.c >> index 322ce84..cb56423 100644 >> --- a/target-ppc/machine.c >> +++ b/target-ppc/machine.c >> @@ -530,7 +530,7 @@ const VMStateDescription vmstate_ppc_cpu = { >> >> /* Internal state */ >> VMSTATE_UINTTL(env.hflags_nmsr, PowerPCCPU), >> - /* FIXME: access_type? */ >> + VMSTATE_INT32(env.access_type, PowerPCCPU), > > > VMSTATE_INT32_V and you need to change access_type's type from "int" > to "int32_t" (or better use "uint8_t" as it is a simple enum with 3 > possible values). I don't think uint8_t is going to be safe, since vmstate works with pointers internally and the cast would only migrate the first *byte* of the value (so the highest byte on BE). Alex --------------080005010102080701000705 Content-Type: text/html; charset=koi8-r Content-Transfer-Encoding: quoted-printable

On 01/08/2016 03:29 AM, Alexey Kardashevskiy wrote:
On 01/07/2016 05:22 AM, Mark Cave-Ayland wrote:
This is referenced in cpu_ppc_handle_mmu_fault() and so should be included
in the migration stream.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
=9A target-ppc/machine.c |=9A=9A=9A 2 +-
=9A 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-ppc/machine.c b/target-ppc/machine.c
index 322ce84..cb56423 100644
--- a/target-ppc/machine.c
+++ b/target-ppc/machine.c
@@ -530,7 +530,7 @@ const VMStateDescription vmstate_ppc_cpu =3D = {

=9A=9A=9A=9A=9A=9A=9A=9A=9A /* Internal state */
=9A=9A=9A=9A=9A=9A=9A=9A=9A VMSTATE_UINTTL(env.hflags_nmsr, Power= PCCPU),
-=9A=9A=9A=9A=9A=9A=9A /* FIXME: access_type? */
+=9A=9A=9A=9A=9A=9A=9A VMSTATE_INT32(env.access_type, PowerPCCPU)= ,


VMSTATE_INT32_V and you need to change access_type's type from "int" to "int32_t" (or better use "uint8_t" as it is a simple enum with 3 possible values).

I don't think uint8_t is going to be safe, since vmstate works with pointers internally and the cast would only migrate the first *byte* of the value (so the highest byte on BE).


Alex
--------------080005010102080701000705--