aboutsummaryrefslogtreecommitdiff
path: root/target/xtensa
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2020-04-03 20:11:43 +0100
committerAlex Bennée <alex.bennee@linaro.org>2020-04-07 16:19:49 +0100
commit1f089c6705fdb0da1b6def842ecf323b07a4460f (patch)
tree1f063420899505aa2b6d0f1b37e51bb956ae92c2 /target/xtensa
parentb859040dc44b271e9ad29f729cac71d2389b05fd (diff)
downloadqemu-1f089c6705fdb0da1b6def842ecf323b07a4460f.zip
qemu-1f089c6705fdb0da1b6def842ecf323b07a4460f.tar.gz
qemu-1f089c6705fdb0da1b6def842ecf323b07a4460f.tar.bz2
target/xtensa: add FIXME for translation memory leak
Dynamically allocating a new structure within the DisasContext can potentially leak as we can longjmp out of the translation loop (see test_phys_mem). The proper fix would be to use static allocation within the DisasContext but as the Xtensa translator imports it's code from elsewhere I leave that as an exercise for the maintainer. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: Max Filippov <jcmvbkbc@gmail.com> Message-Id: <20200403191150.863-6-alex.bennee@linaro.org>
Diffstat (limited to 'target/xtensa')
-rw-r--r--target/xtensa/translate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 8aa972c..37f65b1 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -1174,6 +1174,11 @@ static void xtensa_tr_init_disas_context(DisasContextBase *dcbase,
dc->callinc = ((tb_flags & XTENSA_TBFLAG_CALLINC_MASK) >>
XTENSA_TBFLAG_CALLINC_SHIFT);
+ /*
+ * FIXME: This will leak when a failed instruction load or similar
+ * event causes us to longjump out of the translation loop and
+ * hence not clean-up in xtensa_tr_tb_stop
+ */
if (dc->config->isa) {
dc->insnbuf = xtensa_insnbuf_alloc(dc->config->isa);
dc->slotbuf = xtensa_insnbuf_alloc(dc->config->isa);