From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org
Subject: [Qemu-devel] [PATCH 2/2] PPC: Fail on leaking temporaries
Date: Sun, 19 Jan 2014 17:32:16 +0100 [thread overview]
Message-ID: <1390149136-1041-3-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1390149136-1041-1-git-send-email-agraf@suse.de>
When QEMU gets compiled with --enable-debug-tcg we can check for temporary
leakage. Implement the necessary target code for this and fail emulation
when we hit a leakage.
This hopefully ensures that we don't get new leaks.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
target-ppc/translate.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 02cd18e..759133c 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -10412,6 +10412,7 @@ static inline void gen_intermediate_code_internal(PowerPCCPU *cpu,
max_insns = CF_COUNT_MASK;
gen_tb_start();
+ tcg_clear_temp_count();
/* Set env in case of segfault during code fetch */
while (ctx.exception == POWERPC_EXCP_NONE
&& tcg_ctx.gen_opc_ptr < gen_opc_end) {
@@ -10511,6 +10512,12 @@ static inline void gen_intermediate_code_internal(PowerPCCPU *cpu,
*/
break;
}
+ if (tcg_check_temp_count()) {
+ fprintf(stderr, "Opcode %02x %02x %02x (%08x) leaked temporaries\n",
+ opc1(ctx.opcode), opc2(ctx.opcode), opc3(ctx.opcode),
+ ctx.opcode);
+ exit(1);
+ }
}
if (tb->cflags & CF_LAST_IO)
gen_io_end();
--
1.8.1.4
next prev parent reply other threads:[~2014-01-19 16:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-19 16:32 [Qemu-devel] [PATCH 0/2] PPC: Check for temporary leakage Alexander Graf
2014-01-19 16:32 ` [Qemu-devel] [PATCH 1/2] PPC: Fix TCG chunks that don't free their temps Alexander Graf
2014-01-19 16:32 ` Alexander Graf [this message]
2014-01-19 16:51 ` [Qemu-devel] [PATCH 2/2] PPC: Fail on leaking temporaries Peter Maydell
2014-01-19 20:15 ` Alexander Graf
2014-01-19 20:52 ` Peter Maydell
2014-01-19 20:55 ` Alexander Graf
2014-01-19 21:04 ` Peter Maydell
2014-01-19 21:17 ` Alexander Graf
-- strict thread matches above, loose matches on Subject: below --
2014-05-15 16:28 [Qemu-devel] [PATCH 0/2] PPC: Avoid temporary leaks Alexander Graf
2014-05-15 16:28 ` [Qemu-devel] [PATCH 2/2] PPC: Fail on leaking temporaries Alexander Graf
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=1390149136-1041-3-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.