[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/13] target/xtensa: add FIXME for translation memory leak
From: |
Alex Bennée |
Subject: |
[PULL 06/13] target/xtensa: add FIXME for translation memory leak |
Date: |
Tue, 7 Apr 2020 16:51:11 +0100 |
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 <address@hidden>
Acked-by: Max Filippov <address@hidden>
Message-Id: <address@hidden>
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 8aa972cafdf..37f65b1f030 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);
--
2.20.1
- [PULL for 5.0-rc2 00/13] various fixes, Alex Bennée, 2020/04/07
- [PULL 02/13] elf-ops: bail out if we have no function symbols, Alex Bennée, 2020/04/07
- [PULL 03/13] linux-user: protect fcntl64 with an #ifdef, Alex Bennée, 2020/04/07
- [PULL 04/13] tests/tcg: remove extraneous pasting macros, Alex Bennée, 2020/04/07
- [PULL 01/13] .github: Enable repo-lockdown bot to refuse GitHub pull requests, Alex Bennée, 2020/04/07
- [PULL 05/13] linux-user: more debug for init_guest_space, Alex Bennée, 2020/04/07
- [PULL 06/13] target/xtensa: add FIXME for translation memory leak,
Alex Bennée <=
- [PULL 07/13] gdbstub: fix compiler complaining, Alex Bennée, 2020/04/07
- [PULL 10/13] linux-user: clean-up padding on /proc/self/maps, Alex Bennée, 2020/04/07
- [PULL 08/13] softfloat: Fix BAD_SHIFT from normalizeFloatx80Subnormal, Alex Bennée, 2020/04/07
- Re: [PULL 08/13] softfloat: Fix BAD_SHIFT from normalizeFloatx80Subnormal, Aleksandar Markovic, 2020/04/10
- Re: [PULL 08/13] softfloat: Fix BAD_SHIFT from normalizeFloatx80Subnormal, Richard Henderson, 2020/04/10
- Re: [PULL 08/13] softfloat: Fix BAD_SHIFT from normalizeFloatx80Subnormal, Aleksandar Markovic, 2020/04/10
- Re: [PULL 08/13] softfloat: Fix BAD_SHIFT from normalizeFloatx80Subnormal, Peter Maydell, 2020/04/10
- Re: [PULL 08/13] softfloat: Fix BAD_SHIFT from normalizeFloatx80Subnormal, Aleksandar Markovic, 2020/04/10
- Re: [PULL 08/13] softfloat: Fix BAD_SHIFT from normalizeFloatx80Subnormal, Alex Bennée, 2020/04/11
[PULL 09/13] linux-user: factor out reading of /proc/self/maps, Alex Bennée, 2020/04/07