summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorClement Deschamps <clement.deschamps@greensocs.com>2019-10-22 16:00:16 +0200
committerRichard Henderson <richard.henderson@linaro.org>2019-10-28 10:35:23 +0100
commit1b1940026c95b941d9cf75bd38b37fe3feaa78a7 (patch)
tree802e2c4bdf87cbaee41511203213b88e7b6da4af
parent7f445c8c7aad0d8fca7d99a48cc8118dc82aa0f3 (diff)
downloadfocaccia-qemu-1b1940026c95b941d9cf75bd38b37fe3feaa78a7.tar.gz
focaccia-qemu-1b1940026c95b941d9cf75bd38b37fe3feaa78a7.zip
translate-all: fix uninitialized tb->orig_tb
This fixes a segmentation fault in icount mode when executing
from an IO region.

TB is marked as CF_NOCACHE but tb->orig_tb is not initialized
(equals previous value in code_gen_buffer).

The issue happens in cpu_io_recompile() when it tries to invalidate orig_tb.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Clement Deschamps <clement.deschamps@greensocs.com>
Message-Id: <20191022140016.918371-1-clement.deschamps@greensocs.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--accel/tcg/translate-all.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 66d4bc4341..f9b7ba159d 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -1722,6 +1722,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
     tb->cs_base = cs_base;
     tb->flags = flags;
     tb->cflags = cflags;
+    tb->orig_tb = NULL;
     tb->trace_vcpu_dstate = *cpu->trace_dstate;
     tcg_ctx->tb_cflags = cflags;
  tb_overflow: