qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Cornelia Huck <cornelia.huck@de.ibm.com>, qemu-devel@nongnu.org
Cc: borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com,
	"Jason J. Herne" <jjherne@us.ibm.com>,
	qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.1 1/1] s390x/kvm: synchronize guest floating point registers
Date: Fri, 11 Jul 2014 13:05:49 +0200	[thread overview]
Message-ID: <53BFC50D.3060706@suse.de> (raw)
In-Reply-To: <1405075131-2721-2-git-send-email-cornelia.huck@de.ibm.com>


On 11.07.14 12:38, Cornelia Huck wrote:
> From: "Jason J. Herne" <jjherne@us.ibm.com>
>
> Add code to kvm_arch_get_registers and kvm_arch_put_registers to
> save/restore floating point registers. This missing sync was
> unnoticed until migration of userspace that uses fprs.
>
> Signed-off-by: Jason J. Herne <jjherne@us.ibm.com>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> [Update patch to latest upstream]
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
> ---
>   target-s390x/kvm.c |   23 +++++++++++++++++++++++
>   1 file changed, 23 insertions(+)
>
> diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
> index a6e587b..144189b 100644
> --- a/target-s390x/kvm.c
> +++ b/target-s390x/kvm.c
> @@ -207,6 +207,7 @@ int kvm_arch_put_registers(CPUState *cs, int level)
>       CPUS390XState *env = &cpu->env;
>       struct kvm_sregs sregs;
>       struct kvm_regs regs;
> +    struct kvm_fpu fpu;
>       int r;
>       int i;
>   
> @@ -229,6 +230,17 @@ int kvm_arch_put_registers(CPUState *cs, int level)
>           }
>       }
>   
> +    /* Floating point */
> +    for (i = 0; i < 16; i++) {
> +        fpu.fprs[i] = env->fregs[i].ll;
> +    }
> +    fpu.fpc = env->fpc;
> +
> +    r = kvm_vcpu_ioctl(cs, KVM_SET_FPU, &fpu);
> +    if (r < 0) {
> +        return r;
> +    }
> +
>       /* Do we need to save more than that? */
>       if (level == KVM_PUT_RUNTIME_STATE) {
>           return 0;
> @@ -296,6 +308,7 @@ int kvm_arch_get_registers(CPUState *cs)
>       CPUS390XState *env = &cpu->env;
>       struct kvm_sregs sregs;
>       struct kvm_regs regs;
> +    struct kvm_fpu fpu;
>       int i, r;
>   
>       /* get the PSW */
> @@ -336,6 +349,16 @@ int kvm_arch_get_registers(CPUState *cs)
>           }
>       }
>   
> +    /* Floating point */
> +    r = kvm_vcpu_ioctl(cs, KVM_GET_FPU, &fpu);
> +    if (r < 0) {
> +            return r;
> +        }

Broken indentation.


Alex

> +    for (i = 0; i < 16; i++) {
> +        env->fregs[i].ll = fpu.fprs[i];
> +    }
> +    env->fpc = fpu.fpc;
> +
>       /* The prefix */
>       if (cap_sync_regs && cs->kvm_run->kvm_valid_regs & KVM_SYNC_PREFIX) {
>           env->psa = cs->kvm_run->s.regs.prefix;

      reply	other threads:[~2014-07-11 11:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 10:38 [Qemu-devel] [PATCH for-2.1 0/1] s390x/kvm: bugfix Cornelia Huck
2014-07-11 10:38 ` [Qemu-devel] [PATCH for-2.1 1/1] s390x/kvm: synchronize guest floating point registers Cornelia Huck
2014-07-11 11:05   ` Alexander Graf [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=53BFC50D.3060706@suse.de \
    --to=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=jjherne@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /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).