All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH pic32 2/7] Stop simulation when processor is suspended forever by WAIT instruction with interrupts disabled.
@ 2015-06-30  5:02 Serge Vakulenko
  2015-06-30 14:10 ` Leon Alrae
  0 siblings, 1 reply; 8+ messages in thread
From: Serge Vakulenko @ 2015-06-30  5:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Leon Alrae, Aurelien Jarno

Signed-off-by: Serge Vakulenko <serge@vak.ru>
---
 target-mips/op_helper.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index 2a9ddff..1b7caeb 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -22,6 +22,7 @@
 #include "exec/helper-proto.h"
 #include "exec/cpu_ldst.h"
 #include "sysemu/kvm.h"
+#include "sysemu/sysemu.h"

 #ifndef CONFIG_USER_ONLY
 static inline void cpu_mips_tlb_flush (CPUMIPSState *env, int flush_global);
@@ -2235,6 +2236,12 @@ void helper_wait(CPUMIPSState *env)
 {
     CPUState *cs = CPU(mips_env_get_cpu(env));

+#ifndef CONFIG_USER_ONLY
+    if (!(env->CP0_Status & (1 << CP0St_IE))) {
+        /* WAIT instruction with interrupts disabled - halt the simulation. */
+        qemu_system_shutdown_request();
+    }
+#endif
     cs->halted = 1;
     cpu_reset_interrupt(cs, CPU_INTERRUPT_WAKE);
     helper_raise_exception(env, EXCP_HLT);
--
1.9.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-07-11  5:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-30  5:02 [Qemu-devel] [PATCH pic32 2/7] Stop simulation when processor is suspended forever by WAIT instruction with interrupts disabled Serge Vakulenko
2015-06-30 14:10 ` Leon Alrae
2015-06-30 18:08   ` Peter Crosthwaite
2015-07-01  1:57     ` Serge Vakulenko
2015-07-01  2:21       ` Peter Crosthwaite
2015-07-01 20:30         ` Serge Vakulenko
2015-07-09 16:29       ` Christopher Covington
2015-07-11  5:35         ` Serge Vakulenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.