qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] target-xtensa: fix search_pc for the last TB opcode
@ 2012-12-19 20:04 Max Filippov
  2012-12-22 15:41 ` Blue Swirl
  0 siblings, 1 reply; 2+ messages in thread
From: Max Filippov @ 2012-12-19 20:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: Blue Swirl, Max Filippov, qemu-stable

Zero out tcg_ctx.gen_opc_instr_start for instructions representing the
last guest opcode in the TB.

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
Changes v1 -> v2:
- replace while loop with memset

 target-xtensa/translate.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index 5d8762c..2931d00 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -3005,7 +3005,11 @@ static void gen_intermediate_code_internal(
     gen_icount_end(tb, insn_count);
     *tcg_ctx.gen_opc_ptr = INDEX_op_end;
 
-    if (!search_pc) {
+    if (search_pc) {
+        j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf;
+        memset(tcg_ctx.gen_opc_instr_start + lj + 1, 0,
+                (j - lj) * sizeof(tcg_ctx.gen_opc_instr_start[0]));
+    } else {
         tb->size = dc.pc - pc_start;
         tb->icount = insn_count;
     }
-- 
1.7.7.6

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

end of thread, other threads:[~2012-12-22 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-19 20:04 [Qemu-devel] [PATCH v2] target-xtensa: fix search_pc for the last TB opcode Max Filippov
2012-12-22 15:41 ` Blue Swirl

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