}
}
- /* Floating point */
- for (i = 0; i < 16; i++) {
- fpu.fprs[i] = get_freg(env, i)->ll;
- }
- fpu.fpc = env->fpc;
+ if (can_sync_regs(cs, KVM_SYNC_VRS)) {
+ for (i = 0; i < 32; i++) {
+ cs->kvm_run->s.regs.vrs[i][0] = env->vregs[i][0].ll;
+ cs->kvm_run->s.regs.vrs[i][1] = env->vregs[i][1].ll;
+ }
+ cs->kvm_run->s.regs.fpc = env->fpc;
+ cs->kvm_run->kvm_dirty_regs |= KVM_SYNC_VRS;
+ } else {
+ /* Floating point */
+ for (i = 0; i < 16; i++) {
+ fpu.fprs[i] = get_freg(env, i)->ll;
+ }
+ fpu.fpc = env->fpc;
- r = kvm_vcpu_ioctl(cs, KVM_SET_FPU, &fpu);
- if (r < 0) {
- return r;
+ r = kvm_vcpu_ioctl(cs, KVM_SET_FPU, &fpu);
+ if (r < 0) {
+ return r;
+ }
}
/* Do we need to save more than that? */
}
}
- /* Floating point */
- r = kvm_vcpu_ioctl(cs, KVM_GET_FPU, &fpu);
- if (r < 0) {
- return r;
- }
- for (i = 0; i < 16; i++) {
- get_freg(env, i)->ll = fpu.fprs[i];
+ /* Floating point and vector registers */
+ if (can_sync_regs(cs, KVM_SYNC_VRS)) {
+ for (i = 0; i < 32; i++) {
+ env->vregs[i][0].ll = cs->kvm_run->s.regs.vrs[i][0];
+ env->vregs[i][1].ll = cs->kvm_run->s.regs.vrs[i][1];
+ }
+ env->fpc = cs->kvm_run->s.regs.fpc;
+ } else {
+ r = kvm_vcpu_ioctl(cs, KVM_GET_FPU, &fpu);
+ if (r < 0) {
+ return r;
+ }
+ for (i = 0; i < 16; i++) {
+ get_freg(env, i)->ll = fpu.fprs[i];
+ }
+ env->fpc = fpu.fpc;
}
- env->fpc = fpu.fpc;
/* The prefix */
if (can_sync_regs(cs, KVM_SYNC_PREFIX)) {
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
- VMSTATE_UINT64(env.fregs[0].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[1].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[2].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[3].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[4].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[5].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[6].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[7].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[8].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[9].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[10].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[11].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[12].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[13].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[14].ll, S390CPU),
- VMSTATE_UINT64(env.fregs[15].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[0][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[1][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[2][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[3][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[4][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[5][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[6][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[7][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[8][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[9][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[10][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[11][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[12][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[13][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[14][0].ll, S390CPU),
+ VMSTATE_UINT64(env.vregs[15][0].ll, S390CPU),
VMSTATE_UINT32(env.fpc, S390CPU),
VMSTATE_END_OF_LIST()
}