qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
	dgilbert@redhat.com, crosthwaitepeter@gmail.com,
	pbonzini@redhat.com, "Alex Bennée" <alex.bennee@linaro.org>,
	aurelien@aurel32.net, rth@twiddle.net
Subject: [Qemu-devel] [PATCH v6 1/9] tcg: pass down TranslationBlock to tcg_code_gen
Date: Thu, 11 Feb 2016 10:40:57 +0000	[thread overview]
Message-ID: <1455187265-26631-2-git-send-email-alex.bennee@linaro.org> (raw)
In-Reply-To: <1455187265-26631-1-git-send-email-alex.bennee@linaro.org>

My later debugging patches need access to the origin PC which is held in
the TranslationBlock structure. Pass down the whole structure as it also
holds the information about the code start point.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
v1
 - checkpatch fixes
v5
 - much simplified due to changes since last posting
v6
 - remove needless tweaking of gen_code_buf in tb_gen_code
---
 tcg/tcg.c       | 6 +++---
 tcg/tcg.h       | 2 +-
 translate-all.c | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 0317c9e..b76d978 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -2269,7 +2269,7 @@ void tcg_dump_op_count(FILE *f, fprintf_function cpu_fprintf)
 #endif
 
 
-int tcg_gen_code(TCGContext *s, tcg_insn_unit *gen_code_buf)
+int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
 {
     int i, oi, oi_next, num_insns;
 
@@ -2328,8 +2328,8 @@ int tcg_gen_code(TCGContext *s, tcg_insn_unit *gen_code_buf)
 
     tcg_reg_alloc_start(s);
 
-    s->code_buf = gen_code_buf;
-    s->code_ptr = gen_code_buf;
+    s->code_buf = tb->tc_ptr;
+    s->code_ptr = tb->tc_ptr;
 
     tcg_out_tb_init(s);
 
diff --git a/tcg/tcg.h b/tcg/tcg.h
index 83da5fb..10af870 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -626,7 +626,7 @@ void tcg_context_init(TCGContext *s);
 void tcg_prologue_init(TCGContext *s);
 void tcg_func_start(TCGContext *s);
 
-int tcg_gen_code(TCGContext *s, tcg_insn_unit *gen_code_buf);
+int tcg_gen_code(TCGContext *s, TranslationBlock *tb);
 
 void tcg_set_frame(TCGContext *s, TCGReg reg, intptr_t start, intptr_t size);
 
diff --git a/translate-all.c b/translate-all.c
index e9f409b..b3207fe 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -1120,7 +1120,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
        the tcg optimization currently hidden inside tcg_gen_code.  All
        that should be required is to flush the TBs, allocate a new TB,
        re-initialize it per above, and re-do the actual code generation.  */
-    gen_code_size = tcg_gen_code(&tcg_ctx, gen_code_buf);
+    gen_code_size = tcg_gen_code(&tcg_ctx, tb);
     if (unlikely(gen_code_size < 0)) {
         goto buffer_overflow;
     }
-- 
2.7.0

  reply	other threads:[~2016-02-11 10:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-11 10:40 [Qemu-devel] [PATCH v6 0/9] qemu-log, -dfilter and other logging tweaks Alex Bennée
2016-02-11 10:40 ` Alex Bennée [this message]
2016-02-11 10:40 ` [Qemu-devel] [PATCH v6 2/9] qemu-log: correct help text for -d cpu Alex Bennée
2016-02-11 10:40 ` [Qemu-devel] [PATCH v6 3/9] qemu-log: Avoid function call for disabled qemu_log_mask logging Alex Bennée
2016-02-11 10:41 ` [Qemu-devel] [PATCH v6 4/9] qemu-log: Improve the "exec" TB execution logging Alex Bennée
2016-02-11 10:41 ` [Qemu-devel] [PATCH v6 5/9] qemu-log: support simple pid substitution in logfile Alex Bennée
2016-02-11 11:44   ` Alex Bennée
2016-02-11 10:41 ` [Qemu-devel] [PATCH v6 6/9] qemu-log: new option -dfilter to limit output Alex Bennée
2016-02-11 10:41 ` [Qemu-devel] [PATCH v6 7/9] qemu-log: dfilter-ise exec, out_asm, op and opt_op Alex Bennée
2016-02-11 10:41 ` [Qemu-devel] [PATCH v6 8/9] target-arm: dfilter support for in_asm Alex Bennée
2016-02-11 10:41 ` [Qemu-devel] [PATCH v6 9/9] cputlb: modernise the debug support Alex Bennée

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=1455187265-26631-2-git-send-email-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=aurelien@aurel32.net \
    --cc=crosthwaite.peter@gmail.com \
    --cc=crosthwaitepeter@gmail.com \
    --cc=dgilbert@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).