diff options
author | David Hildenbrand <dahi@linux.vnet.ibm.com> | 2016-02-02 09:08:58 +0100 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2016-03-01 12:15:28 +0100 |
commit | 5ab0e547bf230a6128caf898ef7706bd226514d4 (patch) | |
tree | b444b99e7d6c81650dddc63f60a6113cbed76c57 | |
parent | 66fb2d5467cc93feecc12d3bbab860d7615b6616 (diff) |
s390x/kvm: sync fprs via kvm_run
We can now also sync the fprs via kvm_run, avoiding one ioctl.
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
-rw-r--r-- | target-s390x/kvm.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 9b21b96da5..67636567e1 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -342,6 +342,12 @@ int kvm_arch_put_registers(CPUState *cs, int level) } cs->kvm_run->s.regs.fpc = env->fpc; cs->kvm_run->kvm_dirty_regs |= KVM_SYNC_VRS; + } else if (can_sync_regs(cs, KVM_SYNC_FPRS)) { + for (i = 0; i < 16; i++) { + cs->kvm_run->s.regs.fprs[i] = get_freg(env, i)->ll; + } + cs->kvm_run->s.regs.fpc = env->fpc; + cs->kvm_run->kvm_dirty_regs |= KVM_SYNC_FPRS; } else { /* Floating point */ for (i = 0; i < 16; i++) { @@ -482,6 +488,11 @@ int kvm_arch_get_registers(CPUState *cs) env->vregs[i][1].ll = cs->kvm_run->s.regs.vrs[i][1]; } env->fpc = cs->kvm_run->s.regs.fpc; + } else if (can_sync_regs(cs, KVM_SYNC_FPRS)) { + for (i = 0; i < 16; i++) { + get_freg(env, i)->ll = cs->kvm_run->s.regs.fprs[i]; + } + env->fpc = cs->kvm_run->s.regs.fpc; } else { r = kvm_vcpu_ioctl(cs, KVM_GET_FPU, &fpu); if (r < 0) { |