qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: qemu-ppc@nongnu.org
Cc: Anton Blanchard <anton@au1.ibm.com>,
	qemu-devel@nongnu.org, blauwirbel@gmail.com,
	Anton Blanchard <anton@samba.org>,
	anthony@codemonkey.ws, aurelien@aurel32.net
Subject: [Qemu-devel] [PATCH 6/9] target-ppc: Fix invalid SPR read/write warnings
Date: Mon,  6 May 2013 17:25:14 +0200	[thread overview]
Message-ID: <1367853917-2015-7-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1367853917-2015-1-git-send-email-agraf@suse.de>

From: Anton Blanchard <anton@samba.org>

Invalid and privileged SPR warnings currently print the wrong
address. While fixing that, also make it clear that we are
printing both the decimal and hexadecimal SPR number.

Before:

  Trying to read invalid spr 896 380 at 0000000000000714

After:

  Trying to read invalid spr 896 (0x380) at 0000000000000710

Signed-off-by: Anton Blanchard <anton@au1.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 target-ppc/translate.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 1a84653..0886f4d 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -4005,19 +4005,19 @@ static inline void gen_op_mfspr(DisasContext *ctx)
              * allowing userland application to read the PVR
              */
             if (sprn != SPR_PVR) {
-                qemu_log("Trying to read privileged spr %d %03x at "
-                         TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);
-                printf("Trying to read privileged spr %d %03x at "
-                       TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);
+                qemu_log("Trying to read privileged spr %d (0x%03x) at "
+                         TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);
+                printf("Trying to read privileged spr %d (0x%03x) at "
+                       TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);
             }
             gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
         }
     } else {
         /* Not defined */
-        qemu_log("Trying to read invalid spr %d %03x at "
-                    TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);
-        printf("Trying to read invalid spr %d %03x at " TARGET_FMT_lx "\n",
-               sprn, sprn, ctx->nip);
+        qemu_log("Trying to read invalid spr %d (0x%03x) at "
+                 TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);
+        printf("Trying to read invalid spr %d (0x%03x) at "
+               TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);
         gen_inval_exception(ctx, POWERPC_EXCP_INVAL_SPR);
     }
 }
@@ -4150,18 +4150,18 @@ static void gen_mtspr(DisasContext *ctx)
             (*write_cb)(ctx, sprn, rS(ctx->opcode));
         } else {
             /* Privilege exception */
-            qemu_log("Trying to write privileged spr %d %03x at "
-                     TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);
-            printf("Trying to write privileged spr %d %03x at " TARGET_FMT_lx
-                   "\n", sprn, sprn, ctx->nip);
+            qemu_log("Trying to write privileged spr %d (0x%03x) at "
+                     TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);
+            printf("Trying to write privileged spr %d (0x%03x) at "
+                   TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);
             gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
         }
     } else {
         /* Not defined */
-        qemu_log("Trying to write invalid spr %d %03x at "
-                 TARGET_FMT_lx "\n", sprn, sprn, ctx->nip);
-        printf("Trying to write invalid spr %d %03x at " TARGET_FMT_lx "\n",
-               sprn, sprn, ctx->nip);
+        qemu_log("Trying to write invalid spr %d (0x%03x) at "
+                 TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);
+        printf("Trying to write invalid spr %d (0x%03x) at "
+               TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);
         gen_inval_exception(ctx, POWERPC_EXCP_INVAL_SPR);
     }
 }
-- 
1.6.0.2

  parent reply	other threads:[~2013-05-06 15:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06 15:25 [Qemu-devel] [PULL 1.5 0/9] ppc patch queue 2013-05-06 Alexander Graf
2013-05-06 15:25 ` [Qemu-devel] [PATCH 1/9] pseries: Factor out check for out-of-bounds LIOBN Alexander Graf
2013-05-06 15:25 ` [Qemu-devel] [PATCH 2/9] pseries: Fix debug message for out-of-bounds address in H_PUT_TCE Alexander Graf
2013-05-06 15:25 ` [Qemu-devel] [PATCH 3/9] PPC: e500: initialize GPRs as per epapr Alexander Graf
2013-05-06 15:25 ` [Qemu-devel] [PATCH 4/9] pseries: Update SLOF firmware image Alexander Graf
2013-05-06 15:25 ` [Qemu-devel] [PATCH 5/9] PPC: Add MMU type for 2.06 with AMR but no TB pages Alexander Graf
2013-05-06 15:25 ` Alexander Graf [this message]
2013-05-06 15:25 ` [Qemu-devel] [PATCH 7/9] target-ppc: Add read and write of PPR SPR Alexander Graf
2013-05-06 15:25 ` [Qemu-devel] [PATCH 8/9] PPC: e500: correct params->ram_size with ram_size Alexander Graf
2013-05-06 15:25 ` [Qemu-devel] [PATCH 9/9] spapr_llan: fix device reenabling Alexander Graf
2013-05-06 18:21 ` [Qemu-devel] [PULL 1.5 0/9] ppc patch queue 2013-05-06 Aurelien Jarno

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=1367853917-2015-7-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=anton@au1.ibm.com \
    --cc=anton@samba.org \
    --cc=aurelien@aurel32.net \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).