qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/3] target/m68k: fix TCGv array overflow
@ 2018-03-15 19:19 Laurent Vivier
  2018-03-15 19:19 ` [Qemu-devel] [RFC 1/3] tcg: introduce tcg_temp_try_free() Laurent Vivier
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Laurent Vivier @ 2018-03-15 19:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Laurent Vivier

Since commit 15fa08f845 ("tcg: Dynamically allocate TCGOps")
we have no limit to fill the TCGOps cache and we can fill
the entire TCG variables array and overflow it.

It seems to happen only with m68k, because m68k translator
doesn't free some TCGv at end of instruction translation
because the variable can be either temporary one or an
allocated one,

I try to fix this by introducing a new TCG function
to try to free a TCGv if it is a temporary one and
do nothing otherwise (patches 1 and 2)

The last patch is here to avoid the error and
stop the translation before the buffer overflows
(but I guess we should not need this with correctly
written translation functions...)

Laurent Vivier (3):
  tcg: introduce tcg_temp_try_free()
  target/m68k: use tcg_temp_try_free()
  m68k: Test if we overflow the temp variable array

 target/m68k/translate.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++-
 tcg/tcg-op.h            |  2 ++
 tcg/tcg.c               | 28 +++++++++++++++------
 tcg/tcg.h               |  9 +++++++
 4 files changed, 98 insertions(+), 8 deletions(-)

-- 
2.14.3

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

end of thread, other threads:[~2018-03-16  9:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-15 19:19 [Qemu-devel] [RFC 0/3] target/m68k: fix TCGv array overflow Laurent Vivier
2018-03-15 19:19 ` [Qemu-devel] [RFC 1/3] tcg: introduce tcg_temp_try_free() Laurent Vivier
2018-03-15 19:19 ` [Qemu-devel] [RFC 2/3] target/m68k: use tcg_temp_try_free() Laurent Vivier
2018-03-15 19:19 ` [Qemu-devel] [RFC 3/3] m68k: Test if we overflow the temp variable array Laurent Vivier
2018-03-15 19:34 ` [Qemu-devel] [RFC 0/3] target/m68k: fix TCGv array overflow Richard Henderson
2018-03-16  9:33   ` Laurent Vivier

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