return 0;
}
+void cpu_inject_restart(S390CPU *cpu)
+{
+ if (kvm_enabled()) {
+ kvm_s390_restart_interrupt(cpu);
+ return;
+ }
+ /* FIXME TCG */
+ g_assert_not_reached();
+}
+
+void cpu_inject_stop(S390CPU *cpu)
+{
+ if (kvm_enabled()) {
+ kvm_s390_stop_interrupt(cpu);
+ return;
+ }
+ /* FIXME TCG */
+ g_assert_not_reached();
+}
+
static void cpu_inject_io(S390CPU *cpu, uint16_t subchannel_id,
uint16_t subchannel_number,
uint32_t io_int_parm, uint32_t io_int_word)
{
S390CPU *cpu = S390_CPU(cs);
SigpInfo *si = arg.host_ptr;
- struct kvm_s390_irq irq = {
- .type = KVM_S390_SIGP_STOP,
- };
if (s390_cpu_get_state(cpu) != CPU_STATE_OPERATING) {
si->cc = SIGP_CC_ORDER_CODE_ACCEPTED;
} else {
/* execute the stop function */
cpu->env.sigp_order = SIGP_STOP;
- kvm_s390_vcpu_interrupt(cpu, &irq);
+ cpu_inject_stop(cpu);
}
si->cc = SIGP_CC_ORDER_CODE_ACCEPTED;
}
{
S390CPU *cpu = S390_CPU(cs);
SigpInfo *si = arg.host_ptr;
- struct kvm_s390_irq irq = {
- .type = KVM_S390_SIGP_STOP,
- };
/* disabled wait - sleeping in user space */
if (s390_cpu_get_state(cpu) == CPU_STATE_OPERATING && cs->halted) {
switch (s390_cpu_get_state(cpu)) {
case CPU_STATE_OPERATING:
cpu->env.sigp_order = SIGP_STOP_STORE_STATUS;
- kvm_s390_vcpu_interrupt(cpu, &irq);
+ cpu_inject_stop(cpu);
/* store will be performed when handling the stop intercept */
break;
case CPU_STATE_STOPPED:
{
S390CPU *cpu = S390_CPU(cs);
SigpInfo *si = arg.host_ptr;
- struct kvm_s390_irq irq = {
- .type = KVM_S390_RESTART,
- };
switch (s390_cpu_get_state(cpu)) {
case CPU_STATE_STOPPED:
s390_cpu_set_state(CPU_STATE_OPERATING, cpu);
break;
case CPU_STATE_OPERATING:
- kvm_s390_vcpu_interrupt(cpu, &irq);
+ cpu_inject_restart(cpu);
break;
}
si->cc = SIGP_CC_ORDER_CODE_ACCEPTED;
kvm_s390_enable_cmma();
}
}
+
+void kvm_s390_restart_interrupt(S390CPU *cpu)
+{
+ struct kvm_s390_irq irq = {
+ .type = KVM_S390_RESTART,
+ };
+
+ kvm_s390_vcpu_interrupt(cpu, &irq);
+}
+
+void kvm_s390_stop_interrupt(S390CPU *cpu)
+{
+ struct kvm_s390_irq irq = {
+ .type = KVM_S390_SIGP_STOP,
+ };
+
+ kvm_s390_vcpu_interrupt(cpu, &irq);
+}