qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Emilio G. Cota" <cota@braap.org>
To: Stafford Horne <shorne@gmail.com>
Cc: qemu-devel@nongnu.org, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 1/2] target/openrisc: convert to DisasContextBase
Date: Sun, 18 Feb 2018 01:11:09 -0500	[thread overview]
Message-ID: <20180218061109.GA25007@flamenco> (raw)
In-Reply-To: <20180218031046.GA2836@lianli.shorne-pla.net>

On Sun, Feb 18, 2018 at 12:10:46 +0900, Stafford Horne wrote:
> On Sat, Feb 17, 2018 at 08:32:36PM -0500, Emilio G. Cota wrote:
> > Signed-off-by: Emilio G. Cota <cota@braap.org>
> This looks ok to me, and thanks for testing.  However, I am not so familiar with
> the DisasContextBase.  Is this something new?

The work on having a generic translation loop started a while ago,
picking up steam in June'17 -- look for "Generic translation framework"
threads on the mailing list.

The goal is to have a single loop (accel/tcg/translator.c) to
translate from target code to TCG IR. Apart from reducing code
duplication, this will eventually ease things like inserting
instrumentation, which will have a single injection point
instead of having to patch all targets' translation loops.

Transitioning to the generic translation loop typically
involves three steps:
1- Use of DisasJumpType to mark the exits from the translation loop
2- Use of DisasContextBase to keep track of some state that applies
   to all targets (e.g. num_insns, program counter)
3- Conversion to TranslatorOps, which is a set of function pointers
   called from translator_loop in accel/tcg/translator.c.

You can see an example of 1-3 for Alpha in commits 3de811c, c5f8065
and 99a92b9, respectively.

Quite a few targets have already been converted (you can see which
ones with "git grep '^\s*translator_loop('"); I'm in the
process of converting the remaining ones as long as I can test
them with a boot image (I've been spamming the list with
conversion patches the last few days).

> It would be good to have a commit message to say what it is any why we are
> making the change?

I considered it, but didn't want to annoy everyone by sending the
same explanation many times (once for each converted target).
The purpose and value of this consolidation work
is well-known among people who follow TCG-related threads on
the mailing list (as I said above this work has been ongoing
for a while), so I think it's reasonable to keep the commit
message empty.

I figured some people would have to be filled in though (like
yourself), and that's why I just wrote the above; now
I can point to this message if this happens again :-)

Hope the background I gave above helps; please let me know
if anything is unclear.

Thanks,

		Emilio

  reply	other threads:[~2018-02-18  6:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-18  1:32 [Qemu-devel] [PATCH 0/2] target/openrisc: translator loop conversion Emilio G. Cota
2018-02-18  1:32 ` [Qemu-devel] [PATCH 1/2] target/openrisc: convert to DisasContextBase Emilio G. Cota
2018-02-18  3:10   ` Stafford Horne
2018-02-18  6:11     ` Emilio G. Cota [this message]
2018-02-21 18:22   ` Richard Henderson
2018-02-18  1:32 ` [Qemu-devel] [PATCH 2/2] target/openrisc: convert to TranslatorOps Emilio G. Cota
2018-02-18  3:13   ` Stafford Horne
2018-02-21 18:24   ` Richard Henderson

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=20180218061109.GA25007@flamenco \
    --to=cota@braap.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=shorne@gmail.com \
    /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).