qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RESENT][PATCH 1/2] Log reset events


From: Jan Kiszka
Subject: [Qemu-devel] [RESENT][PATCH 1/2] Log reset events
Date: Mon, 23 Jun 2008 17:15:30 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

Original idea&code by Kevin Wolf, now split-up in two patches. This one
introduces a flag to log CPU resets. Useful for tracing unexpected
resets (such as those triggered by triple faults).

Signed-off-by: Jan Kiszka <address@hidden>
---
 cpu-all.h            |    1 +
 exec.c               |    2 ++
 target-i386/helper.c |    5 +++++
 3 files changed, 8 insertions(+)

Index: b/exec.c
===================================================================
--- a/exec.c
+++ b/exec.c
@@ -1417,6 +1417,8 @@ CPULogItem cpu_log_items[] = {
 #ifdef TARGET_I386
     { CPU_LOG_PCALL, "pcall",
       "show protected mode far calls/returns/exceptions" },
+    { CPU_LOG_RESET, "cpu_reset",
+      "show CPU state before CPU resets" },
 #endif
 #ifdef DEBUG_IOPORT
     { CPU_LOG_IOPORT, "ioport",
Index: b/target-i386/helper.c
===================================================================
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -383,6 +383,11 @@ void cpu_reset(CPUX86State *env)
 
     memset(env, 0, offsetof(CPUX86State, breakpoints));
 
+    if (loglevel & CPU_LOG_RESET) {
+        fprintf(logfile, "CPU Reset (CPU %d)\n", env->cpu_index);
+        cpu_dump_state(env, logfile, fprintf, X86_DUMP_FPU | X86_DUMP_CCOP);
+    }
+
     tlb_flush(env, 1);
 
     env->old_exception = -1;
Index: b/cpu-all.h
===================================================================
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -825,6 +825,7 @@ target_phys_addr_t cpu_get_phys_page_deb
 #define CPU_LOG_PCALL      (1 << 6)
 #define CPU_LOG_IOPORT     (1 << 7)
 #define CPU_LOG_TB_CPU     (1 << 8)
+#define CPU_LOG_RESET      (1 << 9)
 
 /* define log items */
 typedef struct CPULogItem {




reply via email to

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