qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: qemu-devel@nongnu.org
Cc: kwolf@suse.de
Subject: [Qemu-devel] [RESENT][PATCH 1/2] Log reset events
Date: Mon, 23 Jun 2008 17:15:30 +0200	[thread overview]
Message-ID: <485FBE12.5080100@siemens.com> (raw)

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 <jan.kiszka@siemens.com>
---
 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	other threads:[~2008-06-23 15:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23 15:15 Jan Kiszka [this message]
2008-06-24  9:07 ` [Qemu-devel] Re: [RESENT][PATCH 1/2] Log reset events Kevin Wolf
2008-06-24 10:19   ` [Qemu-devel] [PATCH 1/2] Log reset events - v2 Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=485FBE12.5080100@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=kwolf@suse.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).