qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/5] target/s390x: Move program_interrupt() & tr


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 1/5] target/s390x: Move program_interrupt() & trigger_pgm_exception() to interrupt.c
Date: Wed, 19 Jul 2017 08:05:26 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/19/2017 02:54 AM, Thomas Huth wrote:
+void program_interrupt(CPUS390XState *env, uint32_t code, int ilen)
+{
+    S390CPU *cpu = s390_env_get_cpu(env);
+
+    qemu_log_mask(CPU_LOG_INT, "program interrupt at %#" PRIx64 "\n",
+                  env->psw.addr);
+
+    if (kvm_enabled()) {
+#ifdef CONFIG_KVM
+        struct kvm_s390_irq irq = {
+            .type = KVM_S390_PROGRAM_INT,
+            .u.pgm.code = code,
+        };
+
+        kvm_s390_vcpu_interrupt(cpu, &irq);
+#endif
+    } else {
+        trigger_pgm_exception(env, code, ilen);
+#ifdef CONFIG_TCG
+        cpu_loop_exit(CPU(cpu));
+#endif
+    }
+}

I would like to take the opportunity to split the kvm and tcg versions apart. Primarily because the tcg half is noreturn, and I keep having to add g_assert_not_reached after calling it to avoid other Werrors.

That might also help with the ifdeffing a little so you can write

  if (kvm_enabled()) {
    kvm_program_interrupt(...);
  } else if (tcg_enabled()) {
    tcg_program_interrupt(...);
  } else {
    g_assert_not_reached();
  }


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]