From: Christian Borntraeger <borntrae...@de.ibm.com> We also need to sync guest breaking event address and program parameter register for migration support.
Signed-off-by: Christian Borntraeger <borntrae...@de.ibm.com> Reviewed-by: Jason J. Herne <jjhe...@us.ibm.com> Reviewed-by: Thomas Huth <th...@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.h...@de.ibm.com> --- target-s390x/cpu.h | 3 +++ target-s390x/kvm.c | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h index 53391fd..55ef6d3 100644 --- a/target-s390x/cpu.h +++ b/target-s390x/cpu.h @@ -126,6 +126,9 @@ typedef struct CPUS390XState { uint64_t pfault_compare; uint64_t pfault_select; + uint64_t gbea; + uint64_t pp; + CPU_COMMON /* reset does memset(0) up to here */ diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index ec1ce2f..03d61d3 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -204,6 +204,18 @@ int kvm_arch_put_registers(CPUState *cs, int level) } } + reg.id = KVM_REG_S390_GBEA; + reg.addr = (__u64) &env->gbea; + if (kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, ®)) { + trace_kvm_failed_reg_set(reg.id, strerror(errno)); + } + + reg.id = KVM_REG_S390_PP; + reg.addr = (__u64) &env->pp; + if (kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, ®)) { + trace_kvm_failed_reg_set(reg.id, strerror(errno)); + } + if (cap_sync_regs && cs->kvm_run->kvm_valid_regs & KVM_SYNC_ACRS && cs->kvm_run->kvm_valid_regs & KVM_SYNC_CRS) { @@ -305,6 +317,18 @@ int kvm_arch_get_registers(CPUState *cs) trace_kvm_failed_reg_get(reg.id, strerror(errno)); } + reg.id = KVM_REG_S390_GBEA; + reg.addr = (__u64) &env->gbea; + if (kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, ®)) { + trace_kvm_failed_reg_get(reg.id, strerror(errno)); + } + + reg.id = KVM_REG_S390_PP; + reg.addr = (__u64) &env->pp; + if (kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, ®)) { + trace_kvm_failed_reg_get(reg.id, strerror(errno)); + } + if (cap_async_pf) { reg.id = KVM_REG_S390_PFTOKEN; reg.addr = (__u64)&(env->pfault_token); -- 1.7.9.5