qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <rth@twiddle.net>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [Qemu-devel] [PATCH v2 0/2] target/m68k: add a mechanism to automatically free TCGv
Date: Mon, 19 Mar 2018 12:35:42 +0100	[thread overview]
Message-ID: <20180319113544.704-1-laurent@vivier.eu> (raw)

    SRC_EA() and gen_extend() can return either a temporary
    TCGv or a memory allocated one. Mark them when they are
    allocated, and free them automatically at end of the
    instruction translation.

    We want to free locally allocated TCGv to avoid
    overflow in sequence like:

      0xc00ae406:  movel %fp@(-132),%fp@(-268)
      0xc00ae40c:  movel %fp@(-128),%fp@(-264)
      0xc00ae412:  movel %fp@(-20),%fp@(-212)
      0xc00ae418:  movel %fp@(-16),%fp@(-208)
      0xc00ae41e:  movel %fp@(-60),%fp@(-220)
      0xc00ae424:  movel %fp@(-56),%fp@(-216)
      0xc00ae42a:  movel %fp@(-124),%fp@(-252)
      0xc00ae430:  movel %fp@(-120),%fp@(-248)
      0xc00ae436:  movel %fp@(-12),%fp@(-260)
      0xc00ae43c:  movel %fp@(-8),%fp@(-256)
      0xc00ae442:  movel %fp@(-52),%fp@(-276)
      0xc00ae448:  movel %fp@(-48),%fp@(-272)
      ...

    That can fill a lot of TCGv entries in a sequence,
    especially since 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.

v2: split patch in two (separate the patch to add
    parameter to gen_exten())
    mark to release missed gen_load() in gen_lea_indexed()

Laurent Vivier (2):
  target/m68k: add DisasContext parameter to gen_extend()
  target/m68k: add a mechanism to automatically free TCGv

 target/m68k/translate.c | 102 +++++++++++++++++++++++++++++++-----------------
 1 file changed, 66 insertions(+), 36 deletions(-)

-- 
2.14.3

             reply	other threads:[~2018-03-19 11:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-19 11:35 Laurent Vivier [this message]
2018-03-19 11:35 ` [Qemu-devel] [PATCH v2 1/2] target/m68k: add DisasContext parameter to gen_extend() Laurent Vivier
2018-03-20  0:45   ` Richard Henderson
2018-03-20  0:50   ` Philippe Mathieu-Daudé
2018-03-19 11:35 ` [Qemu-devel] [PATCH v2 2/2] target/m68k: add a mechanism to automatically free TCGv Laurent Vivier
2018-03-20  0:45   ` Richard Henderson
2018-03-20  0:50   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180319113544.704-1-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).