From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KAnlY-0004Zv-MS for qemu-devel@nongnu.org; Mon, 23 Jun 2008 11:15:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KAnlY-0004ZK-1n for qemu-devel@nongnu.org; Mon, 23 Jun 2008 11:15:36 -0400 Received: from [199.232.76.173] (port=35713 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAnlX-0004ZG-UG for qemu-devel@nongnu.org; Mon, 23 Jun 2008 11:15:35 -0400 Received: from lizzard.sbs.de ([194.138.37.39]:15769) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KAnlW-0005HO-OD for qemu-devel@nongnu.org; Mon, 23 Jun 2008 11:15:35 -0400 Message-ID: <485FBE12.5080100@siemens.com> Date: Mon, 23 Jun 2008 17:15:30 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RESENT][PATCH 1/2] Log reset events Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@suse.de 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 --- 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 {