qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ppc64: fix mtmsr behavior on 64-bit targets
@ 2011-05-31 14:56 Nathan Whitehorn
  2011-05-31 16:48 ` Alexander Graf
  2011-05-31 17:40 ` Richard Henderson
  0 siblings, 2 replies; 12+ messages in thread
From: Nathan Whitehorn @ 2011-05-31 14:56 UTC (permalink / raw)
  To: qemu-devel

The mtmsr instruction is required not to modify the upper 32-bits of the 
machine state register, but checks the current value of MSR[SF] to 
decide whether to do this. This has the effect of zeroing the upper 32 
bits of the MSR whenever mtmsr is executed in 64-bit mode. 
Unconditionally preserve the upper 32-bits in mtmsr for TARGET_PPC64.

---
  target-ppc/translate.c |    5 ++---
  1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 9b3f90c..a60dbe9 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -3886,7 +3886,6 @@ static void gen_mtmsr(DisasContext *ctx)
           */
          gen_update_nip(ctx, ctx->nip);
  #if defined(TARGET_PPC64)
-        if (!ctx->sf_mode) {
              TCGv t0 = tcg_temp_new();
              TCGv t1 = tcg_temp_new();
              tcg_gen_andi_tl(t0, cpu_msr, 0xFFFFFFFF00000000ULL);
@@ -3895,9 +3894,9 @@ static void gen_mtmsr(DisasContext *ctx)
              tcg_temp_free(t1);
              gen_helper_store_msr(t0);
              tcg_temp_free(t0);
-        } else
-#endif
+#else
              gen_helper_store_msr(cpu_gpr[rS(ctx->opcode)]);
+#endif
          /* Must stop the translation as machine state (may have) 
changed */
          /* Note that mtmsr is not always defined as 
context-synchronizing */
          gen_stop_exception(ctx);

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-06-13 13:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-31 14:56 [Qemu-devel] [PATCH] ppc64: fix mtmsr behavior on 64-bit targets Nathan Whitehorn
2011-05-31 16:48 ` Alexander Graf
2011-05-31 17:40 ` Richard Henderson
2011-06-04 19:28   ` Nathan Whitehorn
2011-06-05  9:00     ` Alexander Graf
2011-06-05 13:33       ` Nathan Whitehorn
2011-06-05 13:36         ` Nathan Whitehorn
2011-06-05 13:45         ` Alexander Graf
2011-06-12 15:49           ` [Qemu-devel] [PATCH2] " Nathan Whitehorn
2011-06-13 10:20             ` Alexander Graf
2011-06-13 12:52               ` Nathan Whitehorn
2011-06-13 13:17                 ` Alexander Graf

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).