summaryrefslogtreecommitdiff
path: root/target-s390x
diff options
context:
space:
mode:
Diffstat (limited to 'target-s390x')
-rw-r--r--target-s390x/cpu.c4
-rw-r--r--target-s390x/cpu.h5
-rw-r--r--target-s390x/kvm.c6
3 files changed, 13 insertions, 2 deletions
diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c
index dfd83e8aef..c3082b73c5 100644
--- a/target-s390x/cpu.c
+++ b/target-s390x/cpu.c
@@ -152,6 +152,10 @@ static void s390_cpu_full_reset(CPUState *s)
* after incrementing the cpu counter */
#if !defined(CONFIG_USER_ONLY)
s->halted = 1;
+
+ if (kvm_enabled()) {
+ kvm_s390_reset_vcpu(cpu);
+ }
#endif
tlb_flush(s, 1);
}
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index aad277af49..06454d6da5 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -359,11 +359,16 @@ void s390x_cpu_timer(void *opaque);
int s390_virtio_hypercall(CPUS390XState *env);
#ifdef CONFIG_KVM
+void kvm_s390_reset_vcpu(S390CPU *cpu);
void kvm_s390_interrupt(S390CPU *cpu, int type, uint32_t code);
void kvm_s390_virtio_irq(S390CPU *cpu, int config_change, uint64_t token);
void kvm_s390_interrupt_internal(S390CPU *cpu, int type, uint32_t parm,
uint64_t parm64, int vm);
#else
+static inline void kvm_s390_reset_vcpu(S390CPU *cpu)
+{
+}
+
static inline void kvm_s390_interrupt(S390CPU *cpu, int type, uint32_t code)
{
}
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");
}
}