qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: patches@linaro.org
Subject: [Qemu-devel] [PATCH v3 3/3] target-arm: Use TCG temporary leak debugging facilities
Date: Sun,  6 Mar 2011 21:39:55 +0000	[thread overview]
Message-ID: <1299447595-13344-4-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1299447595-13344-1-git-send-email-peter.maydell@linaro.org>

Use the new TCG temporary leak debugging facilities to
check that each ARM instruction does not leak temporaries.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/translate.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/target-arm/translate.c b/target-arm/translate.c
index c8cbb9c..f9bb573 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -9150,6 +9150,8 @@ static inline void gen_intermediate_code_internal(CPUState *env,
 
     gen_icount_start();
 
+    tcg_clear_temp_count();
+
     /* A note on handling of the condexec (IT) bits:
      *
      * We want to avoid the overhead of having to write the updated condexec
@@ -9259,6 +9261,11 @@ static inline void gen_intermediate_code_internal(CPUState *env,
             gen_set_label(dc->condlabel);
             dc->condjmp = 0;
         }
+
+        if (tcg_check_temp_count()) {
+            fprintf(stderr, "TCG temporary leak before %08x\n", dc->pc);
+        }
+
         /* Translation stops when a conditional branch is encountered.
          * Otherwise the subsequent code could get translated several times.
          * Also stop translation when a page boundary is reached.  This
-- 
1.7.1

  parent reply	other threads:[~2011-03-06 22:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-06 21:39 [Qemu-devel] [PATCH v2 0/3] tcg: Support debugging leakage of temporaries Peter Maydell
2011-03-06 21:39 ` [Qemu-devel] [PATCH v2 1/3] tcg: Add support for " Peter Maydell
2011-03-06 21:39 ` [Qemu-devel] [PATCH v2 2/3] target-arm: Remove ad-hoc leak checking code Peter Maydell
2011-03-06 21:39 ` Peter Maydell [this message]
2011-03-07  8:42 ` [Qemu-devel] [PATCH v2 0/3] tcg: Support debugging leakage of temporaries 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=1299447595-13344-4-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=patches@linaro.org \
    --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).