qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [RFC] [tcg] Idea on refactoring target code generation loop (gen_intermediate_code)
Date: Wed, 9 Mar 2016 10:52:51 -0500	[thread overview]
Message-ID: <56E046D3.2080709@twiddle.net> (raw)
In-Reply-To: <87r3fjpvgx.fsf@fimbulvetr.bsc.es>

On 03/09/2016 09:38 AM, Lluís Vilanova wrote:
> Hi,
>
> NOTE: I won't be throwing patches anytime soon, I just want to know if there's
>        interest in this for the future.
>
> While adding events for tracing guest instructions, I've found that the
> per-target "gen_intermediate_code()" function is very similar but not exactly
> the same for each of the targets. This makes architecture-agnostic features
> harder to maintain across targets, specially when it comes to their relative
> order.
>
> So, would it be worth it if I generalized part of that code into an
> architecture-agnostic function that calls into target-specific hooks wherever it
> needs extending? There are many ways to do it that we can discuss later.

It's worth talking about, since I do believe it would make long-term 
maintenance across the targets easier.

These "target-specific hooks" probably ought not be "hooks" in the
traditional sense of attaching them to CPUState.  I'd be more comfortable with 
a refactoring that used include files -- maybe .h or maybe .inc.c.  If we do 
the normal sort of hook, then we've got to either expose DisasContext in places 
we shouldn't, or dynamically allocate it.  Neither seems particularly appealing.


r~

  reply	other threads:[~2016-03-09 15:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 14:38 [Qemu-devel] [RFC] [tcg] Idea on refactoring target code generation loop (gen_intermediate_code) Lluís Vilanova
2016-03-09 15:52 ` Richard Henderson [this message]
2016-03-09 18:16   ` Lluís Vilanova
2016-03-09 18:54     ` Richard Henderson
2016-03-09 22:29       ` Lluís Vilanova
2016-03-09 23:27         ` Peter Maydell
2016-03-13 13:16           ` Lluís Vilanova
2016-03-13 16:25             ` Peter Maydell
2016-03-14  7:06               ` Markus Armbruster
2016-03-14 11:13                 ` Lluís Vilanova
2016-04-03 13:05                 ` Lluís Vilanova
2016-04-07 14:27                   ` Markus Armbruster
2016-04-07 14:49                   ` Peter Maydell
2016-04-07 15:01                     ` Paolo Bonzini
2016-04-08 13:15                       ` Markus Armbruster
2016-04-08 14:14                         ` Paolo Bonzini
2016-04-11  5:50                           ` Claudio Fontana
2016-04-11 13:11                             ` Lluís Vilanova
2016-03-14 12:23   ` KONRAD Frederic
2016-03-14 14:14     ` Paolo Bonzini
2016-03-14 14:26     ` Lluís Vilanova

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=56E046D3.2080709@twiddle.net \
    --to=rth@twiddle.net \
    --cc=crosthwaite.peter@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).