diff options
author | Jens Freimann <jfrei@linux.vnet.ibm.com> | 2013-01-07 05:27:14 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-01-18 19:07:47 +0100 |
commit | 70bada03047f723424c4d08d93719c1a83a43cd2 (patch) | |
tree | 0f20d1386edaa19eee8ec79ec2e2a4779b0775bb /target-s390x/kvm.c | |
parent | a158986d85bf75aa078ce3fb53e60a7fa3c6c6ee (diff) |
s390: Add CPU reset handler
Add a CPU reset handler to have all CPUs in a PoP compliant
state.
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
[agraf: move hw/hw.h into existing ifdef]
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-s390x/kvm.c')
-rw-r--r-- | target-s390x/kvm.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 5785f7d870..8bd308020c 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -89,7 +89,14 @@ int kvm_arch_init_vcpu(CPUState *cpu) void kvm_arch_reset_vcpu(CPUState *cpu) { - /* FIXME: add code to reset vcpu. */ + /* The initial reset call is needed here to reset in-kernel + * vcpu data that we can't access directly from QEMU + * (i.e. with older kernels which don't support sync_regs/ONE_REG). + * Before this ioctl cpu_synchronize_state() is called in common kvm + * code (kvm-all) */ + if (kvm_vcpu_ioctl(cpu, KVM_S390_INITIAL_RESET, NULL)) { + perror("Can't reset vcpu\n"); + } } int kvm_arch_put_registers(CPUState *cs, int level) |