qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH for-2.6] ppc: Fix migration of the XER register


From: David Gibson
Subject: Re: [Qemu-ppc] [PATCH for-2.6] ppc: Fix migration of the XER register
Date: Mon, 18 Apr 2016 11:53:47 +1000
User-agent: Mutt/1.5.24 (2015-08-30)

On Fri, Apr 15, 2016 at 11:03:00AM +0200, Thomas Huth wrote:
> 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 <address@hidden>
> ---
>  In case somebody wants to test this, this problem can easily be
>  seen with my SPRs kvm-unit-test on KVM running on a P8 machine:
>  https://patchwork.ozlabs.org/patch/607981/
> 
>  target-ppc/machine.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to ppc-for-2.6, thanks.

> 
> diff --git a/target-ppc/machine.c b/target-ppc/machine.c
> index 692121e..46684fb 100644
> --- a/target-ppc/machine.c
> +++ b/target-ppc/machine.c
> @@ -136,7 +136,7 @@ static void cpu_pre_save(void *opaque)
>  
>      env->spr[SPR_LR] = env->lr;
>      env->spr[SPR_CTR] = env->ctr;
> -    env->spr[SPR_XER] = env->xer;
> +    env->spr[SPR_XER] = cpu_read_xer(env);
>  #if defined(TARGET_PPC64)
>      env->spr[SPR_CFAR] = env->cfar;
>  #endif

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]