All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alessandro Di Federico <ale+qemu@clearmind.me>
Cc: Liviu Ionescu <ilg@livius.net>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Support for using TCG frontend as a library
Date: Thu, 1 Dec 2016 03:50:01 -0500 (EST)	[thread overview]
Message-ID: <1881805253.931387.1480582201178.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <E1cCEHU-0000uT-UD@clearmind.me>



----- Original Message -----
> From: "Alessandro Di Federico" <ale+qemu@clearmind.me>
> To: "Paolo Bonzini" <pbonzini@redhat.com>, "Liviu Ionescu" <ilg@livius.net>
> Cc: "qemu-devel" <qemu-devel@nongnu.org>
> Sent: Thursday, December 1, 2016 12:01:12 AM
> Subject: Re: [Qemu-devel] Support for using TCG frontend as a library
> 
> On Tue, 29 Nov 2016 17:26:59 +0100
> Paolo Bonzini <pbonzini@redhat.com> wrote:
> 
> > It's pretty clean!  I would rather avoid the duplicate enums, possibly
> > by automatically generating large parts of ptc.h, but that's pretty
> > much it.  I see that you check that the constants match (that cpp
> > stuff is disgusting :)), and that is already a good thing.
> 
> Does QEMU already have some mechanism to generate code? Otherwise I can
> try to factor out the enum in a file that can be included in multiple
> places.

If you count scripts/shaderinclude.pl, scripts/feature_to_c.sh and
the like, yes.  The biggest is probably tracetool.  It's ad hoc.

> > As to dumping the assembly code, I think that's beyond the scope of
> > QEMU---rather, if there is an existing library to do so, QEMU would
> > like to use it because currently we're stuck with an old
> > GPLv2-compatible version of GNU binutils.  For everything else it
> > makes sense to use a "librarified" QEMU frontend and even backend.
> 
> My idea was to offer it externally, if available, more for debugging
> purposes than for actual usage, in a "best-effort" way, let's say.
> Isolating the backend too makes sense, but I'm not sure how much
> interest there is on this, I'll first focus on exposing the frontends,
> which is the killer feature for many of us.

Yes, of course.

> > It would even be better, I think, to make linux-user a client of the
> > library itself, because this will prevent bitrot.
> 
> This is something I didn't think about, it might be interesting indeed.
> But why only linux-user and not full system emulation too?

It would simplify the library.  The front-end and helpers have some differences
between usermode and softmmu, and the latter is much more intertwined with
the rest of the QEMU infrastructure (MMU indices, limits on multi-page
translations, etc.)

> If most how the new helpers will be pure it might make sense to make a
> one-time effort to annotate existing helpers with the list of parts of
> the CPU they might access. I currently have an LLVM pass which analyzes
> the helpers and collect programmatically this information.

It can also be used to guide the conversion to pure helpers, I guess.
For example, helpers such as helper_divb_AL should definitely get and
return globals instead of reading/writing to CPUX86State (in the specific
case of division, of course they would keep the side effects because they
can raise a division by zero exception).

Paolo

  reply	other threads:[~2016-12-01  8:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-27 19:32 [Qemu-devel] Support for using TCG frontend as a library Alessandro Di Federico
2016-11-29 16:26 ` Paolo Bonzini
2016-11-29 16:55   ` Liviu Ionescu
2016-11-30 23:01   ` Alessandro Di Federico
2016-12-01  8:50     ` Paolo Bonzini [this message]
2016-12-01 11:54       ` Liviu Ionescu
2016-12-01 12:38         ` Peter Maydell
2016-12-01 13:33           ` Liviu Ionescu
2016-12-01 14:38             ` Peter Maydell
2016-12-01 18:39               ` Liviu Ionescu
2016-12-01 19:13                 ` Peter Maydell
2016-12-01 19:45                   ` Liviu Ionescu
2016-12-02  9:40                     ` Peter Maydell
2016-12-02 10:12                       ` Liviu Ionescu
2016-12-02 10:24                         ` Peter Maydell
2016-12-02 10:51                           ` Liviu Ionescu

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=1881805253.931387.1480582201178.JavaMail.zimbra@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ale+qemu@clearmind.me \
    --cc=ilg@livius.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.