From: "Lluís Vilanova" <vilanova@ac.upc.edu>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 3/7] trace: Add "vcpu_reset" event
Date: Fri, 09 Dec 2011 21:15:16 +0100 [thread overview]
Message-ID: <20111209201516.11487.29701.stgit@ginnungagap.bsc.es> (raw)
In-Reply-To: <20111209201430.11487.82078.stgit@ginnungagap.bsc.es>
Signals the reset of the state a vCPU (CPUState structure).
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
target-arm/helper.c | 3 +++
target-cris/translate.c | 3 +++
target-i386/helper.c | 3 +++
target-lm32/helper.c | 3 +++
target-m68k/helper.c | 3 +++
target-microblaze/translate.c | 3 +++
target-mips/translate.c | 3 +++
target-ppc/helper.c | 3 +++
target-s390x/helper.c | 3 +++
target-sh4/translate.c | 3 +++
target-sparc/cpu_init.c | 2 ++
target-sparc/helper.c | 2 ++
trace-events | 2 ++
13 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 97af4d0..789fd8b 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -10,6 +10,7 @@
#if !defined(CONFIG_USER_ONLY)
#include "hw/loader.h"
#endif
+#include "trace.h"
static uint32_t cortexa9_cp15_c0_c1[8] =
{ 0x1031, 0x11, 0x000, 0, 0x00100103, 0x20000000, 0x01230000, 0x00002111 };
@@ -325,6 +326,8 @@ void cpu_reset(CPUARMState *env)
set_float_detect_tininess(float_tininess_before_rounding,
&env->vfp.standard_fp_status);
tlb_flush(env, 1);
+
+ trace_vcpu_reset(env);
}
static int vfp_gdb_get_reg(CPUState *env, uint8_t *buf, int reg)
diff --git a/target-cris/translate.c b/target-cris/translate.c
index 70abf8a..a871e7f 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -36,6 +36,7 @@
#include "mmu.h"
#include "crisv32-decode.h"
#include "qemu-common.h"
+#include "trace.h"
#define GEN_HELPER 1
#include "helper.h"
@@ -3601,6 +3602,8 @@ void cpu_reset (CPUCRISState *env)
cris_mmu_init(env);
env->pregs[PR_CCS] = 0;
#endif
+
+ trace_vcpu_reset(env);
}
void restore_state_to_opc(CPUState *env, TranslationBlock *tb, int pc_pos)
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 2586aff..3b0106b 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -29,6 +29,7 @@
#include "sysemu.h"
#include "monitor.h"
#endif
+#include "trace.h"
//#define DEBUG_MMU
@@ -105,6 +106,8 @@ void cpu_reset(CPUX86State *env)
env->dr[7] = DR7_FIXED_1;
cpu_breakpoint_remove_all(env, BP_CPU);
cpu_watchpoint_remove_all(env, BP_CPU);
+
+ trace_vcpu_reset(env);
}
void cpu_x86_close(CPUX86State *env)
diff --git a/target-lm32/helper.c b/target-lm32/helper.c
index fc0b444..10ad3b5 100644
--- a/target-lm32/helper.c
+++ b/target-lm32/helper.c
@@ -24,6 +24,7 @@
#include "config.h"
#include "cpu.h"
#include "host-utils.h"
+#include "trace.h"
int cpu_lm32_handle_mmu_fault(CPUState *env, target_ulong address, int rw,
int mmu_idx)
@@ -251,5 +252,7 @@ void cpu_reset(CPUState *env)
/* reset cpu state */
memset(env, 0, offsetof(CPULM32State, breakpoints));
+
+ trace_vcpu_reset(env);
}
diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index 123e1d9..3a89f29 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -25,6 +25,7 @@
#include "cpu.h"
#include "qemu-common.h"
#include "gdbstub.h"
+#include "trace.h"
#include "helper.h"
@@ -165,6 +166,8 @@ void cpu_reset(CPUM68KState *env)
/* TODO: We should set PC from the interrupt vector. */
env->pc = 0;
tlb_flush(env, 1);
+
+ trace_vcpu_reset(env);
}
CPUM68KState *cpu_m68k_init(const char *cpu_model)
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index 366fd3e..f976311 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -30,6 +30,7 @@
#include "helper.h"
#include "microblaze-decode.h"
#include "qemu-common.h"
+#include "trace.h"
#define GEN_HELPER 1
#include "helper.h"
@@ -1943,6 +1944,8 @@ void cpu_reset (CPUState *env)
env->mmu.c_mmu_tlb_access = 3;
env->mmu.c_mmu_zones = 16;
#endif
+
+ trace_vcpu_reset(env);
}
void restore_state_to_opc(CPUState *env, TranslationBlock *tb, int pc_pos)
diff --git a/target-mips/translate.c b/target-mips/translate.c
index d5b1c76..73c4c5e 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -30,6 +30,7 @@
#include "disas.h"
#include "tcg-op.h"
#include "qemu-common.h"
+#include "trace.h"
#include "helper.h"
#define GEN_HELPER 1
@@ -12846,6 +12847,8 @@ void cpu_reset (CPUMIPSState *env)
}
#endif
env->exception_index = EXCP_NONE;
+
+ trace_vcpu_reset(env);
}
void restore_state_to_opc(CPUState *env, TranslationBlock *tb, int pc_pos)
diff --git a/target-ppc/helper.c b/target-ppc/helper.c
index 137a494..84bf282 100644
--- a/target-ppc/helper.c
+++ b/target-ppc/helper.c
@@ -28,6 +28,7 @@
#include "kvm.h"
#include "kvm_ppc.h"
#include "cpus.h"
+#include "trace.h"
//#define DEBUG_MMU
//#define DEBUG_BATS
@@ -3175,6 +3176,8 @@ void cpu_reset(CPUPPCState *env)
env->error_code = 0;
/* Flush all TLBs */
tlb_flush(env, 1);
+
+ trace_vcpu_reset(env);
}
CPUPPCState *cpu_ppc_init (const char *cpu_model)
diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index 10cc9dd..d0ccc86 100644
--- a/target-s390x/helper.c
+++ b/target-s390x/helper.c
@@ -29,6 +29,7 @@
#ifndef CONFIG_USER_ONLY
#include "sysemu.h"
#endif
+#include "trace.h"
//#define DEBUG_S390
//#define DEBUG_S390_PTE
@@ -135,6 +136,8 @@ void cpu_reset(CPUS390XState *env)
/* FIXME: reset vector? */
tlb_flush(env, 1);
s390_add_running_cpu(env);
+
+ trace_vcpu_reset(env);
}
#ifndef CONFIG_USER_ONLY
diff --git a/target-sh4/translate.c b/target-sh4/translate.c
index bad3577..2487451 100644
--- a/target-sh4/translate.c
+++ b/target-sh4/translate.c
@@ -30,6 +30,7 @@
#include "disas.h"
#include "tcg-op.h"
#include "qemu-common.h"
+#include "trace.h"
#include "helper.h"
#define GEN_HELPER 1
@@ -205,6 +206,8 @@ void cpu_reset(CPUSH4State * env)
set_flush_to_zero(1, &env->fp_status);
#endif
set_default_nan_mode(1, &env->fp_status);
+
+ trace_vcpu_reset(env);
}
typedef struct {
diff --git a/target-sparc/cpu_init.c b/target-sparc/cpu_init.c
index c7269b5..074932e 100644
--- a/target-sparc/cpu_init.c
+++ b/target-sparc/cpu_init.c
@@ -64,6 +64,8 @@ void cpu_reset(CPUSPARCState *env)
env->npc = env->pc + 4;
#endif
env->cache_control = 0;
+
+ trace_vcpu_reset(env);
}
static int cpu_sparc_register(CPUSPARCState *env, const char *cpu_model)
diff --git a/target-sparc/helper.c b/target-sparc/helper.c
index 037a72c..de12c2b 100644
--- a/target-sparc/helper.c
+++ b/target-sparc/helper.c
@@ -21,6 +21,8 @@
#include "host-utils.h"
#include "helper.h"
#include "sysemu.h"
+#include "qemu-common.h"
+#include "trace.h"
void helper_raise_exception(CPUState *env, int tt)
{
diff --git a/trace-events b/trace-events
index 1a2d302..8278959 100644
--- a/trace-events
+++ b/trace-events
@@ -638,3 +638,5 @@ win_helper_retry(uint32_t tl) "tl=%d"
# Create a new vCPU (CPUState structure)
vcpu_init(void *vcpu) "%p"
+# Reset the state of a vCPU
+vcpu_reset(void *vcpu) "%p"
next prev parent reply other threads:[~2011-12-09 20:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-09 20:14 [Qemu-devel] [PATCH 0/7] trace: Add some simple TCG tracing events Lluís Vilanova
2011-12-09 20:14 ` [Qemu-devel] [PATCH 1/7] Make 'qemu_init_vcpu' a function (instead of a macro) Lluís Vilanova
2011-12-09 20:15 ` [Qemu-devel] [PATCH 2/7] trace: Add "vcpu_init" event Lluís Vilanova
2011-12-09 20:15 ` Lluís Vilanova [this message]
2011-12-09 20:15 ` [Qemu-devel] [PATCH 4/7] trace: [all] Add "vbbl" TCG tracing event Lluís Vilanova
2011-12-09 20:15 ` [Qemu-devel] [PATCH 5/7] [all] Trivial 'tcg_gen_debug_insn_start' unification in 'gen_intermediate_code_internal' Lluís Vilanova
2011-12-09 20:16 ` [Qemu-devel] [PATCH 6/7] trace: [all] Add "vfetch" TCG tracing event Lluís Vilanova
2011-12-09 20:16 ` [Qemu-devel] [PATCH 7/7] trace: [all] Add "vmem" " Lluís Vilanova
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=20111209201516.11487.29701.stgit@ginnungagap.bsc.es \
--to=vilanova@ac.upc.edu \
--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).