qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: Piotras <piotras@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] CONFIG_MMU_MAP powerpc host support
Date: Mon, 20 Dec 2004 23:12:31 +0100	[thread overview]
Message-ID: <aec7e5c304122014124a9f02b5@mail.gmail.com> (raw)
In-Reply-To: <da63183704122013313371ce6@mail.gmail.com>

On Mon, 20 Dec 2004 22:31:34 +0100, Piotras <piotras@gmail.com> wrote:
> Great!
> 
> Do you have an estimate of possible performance gain by introducing
> direct pointer to mmu_map for memory read?

No, I have no idea. The speed gain is probably host cpu specific.

I believe one downside with the current micro operations design is
that the compiler is unable to order the host instructions in a
optimal way because each micro operation is so damn small... And of
course we want them small.  But if we could combine the most popular
guest instructions into one micro operation (which is not so micro
anymore) then the compiler could rearrange things to fully take
advantage of the host cpu.

It all boils down to some table-based generic guest opcode matching
code that does a longest prefix match and supports masking of
bitfields...

I think it would be very interesting to collect opcode statistics for
certain guest operating systems. Or maybe someone already has done
that?

> I have two ideas for future experimentation.
> 
> There is a trick possible without wasting another register for global
> variable: use two copies of CPUState (one for privileged and another
> for user mode), then make mmu_map.add_read first member of the
> struct. This would introduce guest register coping for user/supervisor
> switch, but maybe performance gain would justify this.
>
> Another idea: if we could align add_read/add_write on 64k boundary,
> "addi" could be removed.

Yes, both are good ideas IMHO. Would your future experimentation
improve x86 performance? If this is powerpc-specific then I think we
could use one or two registers (one for read and one for write) and
modify these registers each time the processor changes between user
and kernel mode. I think the big limitation right now for powerpc is
that the good old /* suppress this hack */ never worked out...

And I also think we are reaching a limit here, of course we would gain
some by reducing the number of instructions but soon there are not
many instructions left to remove... So the bottleneck must be
somewhere else.

/ magnus

> On Mon, 20 Dec 2004 18:55:21 +0100, Magnus Damm <magnus.damm@gmail.com> wrote:
> > Hello,
> >
> > This patch adds powerpc host support to the CONFIG_MMU_MAP patch
> > written by Piotrek. My patch should be applied on top of
> > v1-part[1-3].patch.gz. I have only tested the code with a x86 guest on
> > a ppc host running Linux - someone, please test on a host running OSX.
> >
> > Performance gain reported by nbench:
> >
> > Memory index: 50%
> > Integer index: 44%
> > Fp index: 4%
> >
> > Right now each map-memory access consists of 5-6 powerpc instructions.
> > If a direct pointer to mem_map could be kept in a register then we
> > would be down to 3-4 instructions per memoy access...
> >
> > / magnus
>

  reply	other threads:[~2004-12-20 22:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-20 17:55 [Qemu-devel] [PATCH] CONFIG_MMU_MAP powerpc host support Magnus Damm
2004-12-20 21:31 ` [Qemu-devel] " Piotras
2004-12-20 22:12   ` Magnus Damm [this message]
2004-12-20 22:56     ` Daniel Serpell
2004-12-20 23:11   ` Fabrice Bellard
2004-12-25  0:04 ` [Qemu-devel] " Laurent Amon
2004-12-25 13:48   ` Norikatsu Shigemura
2004-12-27 16:06     ` Laurent Amon
2004-12-27 21:41       ` Pierre d'Herbemont
2004-12-27 23:43         ` Laurent Amon
2004-12-28  9:15         ` Daniel Egger
2004-12-28  9:55           ` Pierre d'Herbemont
2004-12-28 10:04             ` Daniel Egger
2004-12-28 11:18               ` Pierre d'Herbemont
2004-12-29 11:43                 ` Piotras
2005-01-02 18:26 ` Daniel Egger
2005-01-02 20:18   ` Laurent Amon
2005-01-03 10:31     ` Daniel Egger
2005-01-03 12:08       ` Laurent Amon
2005-01-03 12:57         ` Daniel Egger

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=aec7e5c304122014124a9f02b5@mail.gmail.com \
    --to=magnus.damm@gmail.com \
    --cc=piotras@gmail.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).