* [Qemu-devel] [PATCH 1/2] ppc: tcg: add nap insn support
@ 2014-01-06 0:56 Liu Ping Fan
2014-01-06 0:56 ` [Qemu-devel] [PATCH 2/2] ppc: tcg: implement helper_nap Liu Ping Fan
0 siblings, 1 reply; 2+ messages in thread
From: Liu Ping Fan @ 2014-01-06 0:56 UTC (permalink / raw)
To: qemu-devel
Add the emulation of insn "nap" for hypervisor
Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
target-ppc/excp_helper.c | 4 ++++
target-ppc/helper.h | 1 +
target-ppc/translate.c | 6 ++++++
3 files changed, 11 insertions(+)
diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c
index c959460..a9712bc 100644
--- a/target-ppc/excp_helper.c
+++ b/target-ppc/excp_helper.c
@@ -889,6 +889,10 @@ void helper_hrfid(CPUPPCState *env)
do_rfi(env, env->spr[SPR_HSRR0], env->spr[SPR_HSRR1],
~((target_ulong)0x783F0000), 0);
}
+
+void helper_nap(CPUPPCState *env)
+{
+}
#endif
/*****************************************************************************/
diff --git a/target-ppc/helper.h b/target-ppc/helper.h
index 6d282bb..87873db 100644
--- a/target-ppc/helper.h
+++ b/target-ppc/helper.h
@@ -17,6 +17,7 @@ DEF_HELPER_1(rfmci, void, env)
#if defined(TARGET_PPC64)
DEF_HELPER_1(rfid, void, env)
DEF_HELPER_1(hrfid, void, env)
+DEF_HELPER_1(nap, void, env)
#endif
#endif
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 66c7771..ce63783 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -3798,6 +3798,11 @@ static void gen_hrfid(DisasContext *ctx)
gen_sync_exception(ctx);
#endif
}
+
+static void gen_nap(DisasContext *ctx)
+{
+ gen_helper_nap(cpu_env);
+}
#endif
/* sc */
@@ -8732,6 +8737,7 @@ GEN_HANDLER(rfi, 0x13, 0x12, 0x01, 0x03FF8001, PPC_FLOW),
#if defined(TARGET_PPC64)
GEN_HANDLER(rfid, 0x13, 0x12, 0x00, 0x03FF8001, PPC_64B),
GEN_HANDLER(hrfid, 0x13, 0x12, 0x08, 0x03FF8001, PPC_64H),
+GEN_HANDLER(nap, 0x13, 0x12, 0x0d, 0x03FF8001, PPC_64H),
#endif
GEN_HANDLER(sc, 0x11, 0xFF, 0xFF, 0x03FFF01D, PPC_FLOW),
GEN_HANDLER(tw, 0x1F, 0x04, 0x00, 0x00000001, PPC_FLOW),
--
1.8.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Qemu-devel] [PATCH 2/2] ppc: tcg: implement helper_nap
2014-01-06 0:56 [Qemu-devel] [PATCH 1/2] ppc: tcg: add nap insn support Liu Ping Fan
@ 2014-01-06 0:56 ` Liu Ping Fan
0 siblings, 0 replies; 2+ messages in thread
From: Liu Ping Fan @ 2014-01-06 0:56 UTC (permalink / raw)
To: qemu-devel
When nap, clear no persistent register as ISA spec says.
Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
target-ppc/excp_helper.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c
index a9712bc..5dbb166 100644
--- a/target-ppc/excp_helper.c
+++ b/target-ppc/excp_helper.c
@@ -892,6 +892,20 @@ void helper_hrfid(CPUPPCState *env)
void helper_nap(CPUPPCState *env)
{
+ int i;
+ for (i = 0; i < 32; i++) {
+ env->gpr[i] = 0;
+ }
+ env->lr = 0;
+ env->ctr = 0;
+ for (i = 0; i < 8; i++) {
+ env->crf[i] = 0;
+ }
+ env->msr = 0;
+ for (i = 0; i < 32; i++) {
+ env->fpr[i] = 0;
+ }
+
}
#endif
--
1.8.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-06 0:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-06 0:56 [Qemu-devel] [PATCH 1/2] ppc: tcg: add nap insn support Liu Ping Fan
2014-01-06 0:56 ` [Qemu-devel] [PATCH 2/2] ppc: tcg: implement helper_nap Liu Ping Fan
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).