qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-ppc@nongnu.org, agraf@suse.de, qemu-devel@nongnu.org,
	aik@ozlabs.ru, rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH for-2.6] ppc: Fix migration of the XER register
Date: Mon, 18 Apr 2016 11:53:47 +1000	[thread overview]
Message-ID: <20160418015347.GR18218@voom.redhat.com> (raw)
In-Reply-To: <1460710980-9995-1-git-send-email-thuth@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1420 bytes --]

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 <thuth@redhat.com>
> ---
>  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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      parent reply	other threads:[~2016-04-18  4:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15  9:03 [Qemu-devel] [PATCH for-2.6] ppc: Fix migration of the XER register Thomas Huth
2016-04-15 10:17 ` Mark Cave-Ayland
2016-04-15 12:17   ` Thomas Huth
2016-04-18  1:53 ` David Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160418015347.GR18218@voom.redhat.com \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).