aboutsummaryrefslogtreecommitdiff
path: root/target-s390x/kvm.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-03-20 13:11:56 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2014-05-13 13:12:40 +0200
commit50a2c6e55fa2ce5a2916a2c206bad2c6b0e06df1 (patch)
tree0ad5c6445202d419c26a8e18e9aced87bd51665b /target-s390x/kvm.c
parent7848c8d19f8556666df25044bbd5d8b29439c368 (diff)
kvm: reset state from the CPU's reset method
Now that we have a CPU object with a reset method, it is better to keep the KVM reset close to the CPU reset. Using qemu_register_reset as we do now keeps them far apart. With this patch, PPC no longer calls the kvm_arch_ function, so it can get removed there. Other arches call it from their CPU reset handler, and the function gets an ARMCPU/X86CPU/S390CPU. Note that ARM- and s390-specific functions are called kvm_arm_* and kvm_s390_*, while x86-specific functions are called kvm_arch_*. That follows the convention used by the different architectures. Changing that is the topic of a separate patch. Reviewed-by: Gleb Natapov <gnatapov@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target-s390x/kvm.c')
-rw-r--r--target-s390x/kvm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index ba2dffe3dd..56179afece 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -117,14 +117,16 @@ int kvm_arch_init_vcpu(CPUState *cpu)
return 0;
}
-void kvm_arch_reset_vcpu(CPUState *cpu)
+void kvm_s390_reset_vcpu(S390CPU *cpu)
{
+ CPUState *cs = CPU(cpu);
+
/* 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)) {
+ if (kvm_vcpu_ioctl(cs, KVM_S390_INITIAL_RESET, NULL)) {
perror("Can't reset vcpu\n");
}
}