qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: toolchain-devel@blackfin.uclinux.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/4] new Blackfin QEMU port
Date: Mon, 31 Jan 2011 15:00:54 +0100	[thread overview]
Message-ID: <20110131140054.GA24608@edde.se.axis.com> (raw)
In-Reply-To: <1295864581-13494-1-git-send-email-vapier@gentoo.org>

On Mon, Jan 24, 2011 at 05:23:01AM -0500, Mike Frysinger wrote:
> I finally got around to getting this port past the "only crashes" phase.
> Using the GNU sim Blackfin port as a nice working standard, it was just
> a matter of replacing the sim bits with TCG ops.  Now we have a linux-user
> port for people to play with.  No immediate plans to move on to the system
> step, but it is something I want to figure out at some point.
> 
> The port is at the point I think where people can bang on it.  The core
> (bfin-sim.c) needs a bit more cleanup though before it'll be accepted,
> but that should be largely related to the insns that I haven't gotten
> around to implementing.  The rest of the code should be fair game for
> review though if someone feels like it.
> 
> This does require some patches in order for userspace programs to be
> generally useful, but they've all been submitted at this point.
> 
> I don't know how people feel about test sizes.  We developed quite a
> comprehension testsuite for the GNU sim, and I've imported about half
> of it.  Personally, I find it invaluable to catch regressions while
> developing, but its raw size can be a bit intimidating.
> 
> As a simple comparison, we typically get about ~8mips with the GNU sim
> while executing Blackfin code, but I easily see about ~400mips with qemu.
> Obviously your numbers will vary based on workload, but hopefully not
> too much ...
> 
> My git tree with everything necessary can be found here:
> 	git://sources.blackfin.uclinux.org/git/users/vapier/qemu.git


Hi,

First of all, nice work! Good to see that you've managed to get your
port running.

I've had a quick look at your git and have a few (mostly general)
comments:

* There's quite a bit of dead code left around. Please remove as
  much as possible to make things easier to read.

* There's a lot of code that doesn't use braces around if code
  bodies, for example in op_helper.c.

* Some operations seem to translate to large amounts of tcg code,
  maybe you should consider using helpers for those. An example
  is gen_rot_tl.

* Many of the helpers seem to be PURE and CONST but not declared
  so. See tcg/README for more info.

* Maybe you should rename target-bfin/opcode/bfin.h into
  target-bfin/opcodes.h? or similiar..

* gen_hwloop_check() seems to be looking at env->lbreg from the
  translator, is that OK? What happens if env->lbreg changes at
  runtime?

* cpu_get_tb_cpu_state() doesn't define any tb flags?


target-bfin/README:

"There are some things we don't bother handling in the port for speed reasons.
If you want an accurate (but not as fast) simulator, then use the GNU sim as
found in the GNU toolchain (part of gdb)."

I think QEMU should aim to be fast and correct. There is no need to
be cycle accurate but emulation should IMO always aim to produce the
correct results.
If people provide patches to improve correctness, IMO those patches
should be encouraged & accepted as long as they dont introduce unnecessary
slowdowns (e.g, unless there are faster ways to achieve the same level of
correctness). My suggestion is that you just remove those first sentences.


"- transactional parallel instructions
         - on the hardware, if a load/store causes an exception, the other
           insns do not change register states either.  in qemu, they do,
           but since those exceptions will kill the program anyways, who
           cares.  no intermediate store buffers!"

This might be true for user emulation but I assume you'd want to fix this
for system emulation (at some point in time). Maybe you should just note
that it's not supported and leave it at that.

"        - unaligned memory access exceptions
                - qemu itself doesn't support this for targets"

There are targets that emulate trapping on unaligned memory accesses, for
example MicroBlaze and IIRC SPARC.

Cheers

  parent reply	other threads:[~2011-01-31 14:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24 10:23 [Qemu-devel] [PATCH 0/4] new Blackfin QEMU port Mike Frysinger
2011-01-24 10:26 ` [Qemu-devel] [PATCH 3/4] Blackfin: add linux-user support Mike Frysinger
2011-01-24 10:29 ` [Qemu-devel] [PATCH 2/4] Blackfin: initial port Mike Frysinger
2011-01-31 14:00 ` Edgar E. Iglesias [this message]
2011-02-01  4:19   ` [Qemu-devel] [PATCH 0/4] new Blackfin QEMU port Mike Frysinger
2011-02-01  9:38     ` Alexander Graf
2011-02-01 10:31       ` Peter Maydell
2011-02-01 11:46         ` Alexander Graf
2011-02-01 11:53           ` Peter Maydell
2011-02-01 17:20         ` Mike Frysinger
2011-02-01 17:30           ` Peter Maydell
2011-02-01 18:16             ` Mike Frysinger
2011-02-01 18:45               ` Peter Maydell
2011-02-02  0:19                 ` Mike Frysinger

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=20110131140054.GA24608@edde.se.axis.com \
    --to=edgar.iglesias@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=toolchain-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.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).