summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2012-12-20 00:04:09 +0400
committerDoug Goldstein <cardoe@cardoe.com>2013-01-18 21:02:08 -0600
commit8458950e33094f974a3b39b7ab6d45b79a118db7 (patch)
tree715f577987a3686f7c69f047dc83c680d1b4b679
parentpci-assign: Enable MSIX on device to match guest (diff)
downloadqemu-kvm-8458950e33094f974a3b39b7ab6d45b79a118db7.tar.gz
qemu-kvm-8458950e33094f974a3b39b7ab6d45b79a118db7.tar.bz2
qemu-kvm-8458950e33094f974a3b39b7ab6d45b79a118db7.zip
target-xtensa: fix search_pc for the last TB opcode
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> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> (cherry picked from commit 36f25d2537c40c6c47f4abee5d31a24863d1adf7)
-rw-r--r--target-xtensa/translate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index b6643eb81..b418e30c6 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -2678,7 +2678,11 @@ static void gen_intermediate_code_internal(
gen_icount_end(tb, insn_count);
*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;
}