All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Mayer" <l_indien@magic.fr>
To: Thiemo Seufer <ths@networkno.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] RFC: cleanups: CPU_MEM_INDEX
Date: Fri, 12 Oct 2007 00:27:49 +0200	[thread overview]
Message-ID: <1192141669.9976.239.camel@rapid> (raw)
In-Reply-To: <20071011174624.GH3379@networkno.de>

On Thu, 2007-10-11 at 18:46 +0100, Thiemo Seufer wrote:
> J. Mayer wrote:
> > On Wed, 2007-10-10 at 07:06 +0200, J. Mayer wrote:
> > > On Wed, 2007-10-10 at 01:12 +0100, Thiemo Seufer wrote:
> > > > J. Mayer wrote:
> > > > > Here's a proposal to add a int cpu_mem_index (CPUState *env) function in
> > > > > targets cpu.h header.
> > > > > The idea of this patch is:
> > > > > - avoid many #ifdef TARGET_xxx in exec-all.h and  softmmu_header.h then
> > > > > make the code more readable
> > > > > - avoid multiple implementation of the same code (3, in that particular
> > > > > case) this to avoid potential conflicts if the definition has to be
> > > > > updated for any reason (ie support for new memory access modes,
> > > > > emulation optimisation...)
> > > > > 
> > > > > Please comment.
> > > > > 
> > > > > -- 
> > > > > J. Mayer <l_indien@magic.fr>
> > > > > Never organized
> > > > 
> > 
> > [...]
> > 
> > Here's an updated version of the patch. My comments about it stay valid,
> > with two additions:
> > 1/ when is user is needed to maintain compatibility with existing code,
> > I now define it as:
> > int is_user = mmu_idx == MMU_USER_IDX;
> > instead of just is_user = mmu_idx.
> > This definition will then remain correct even if the definition of the
> > MMU modes are later changed for a specific target
> > 2/ I now precompute the mmu_idx on PowerPC platform as it can never
> > change inside a single TB. This may save a few instructions for every
> > memory access. I guess the same optimisation can be made for the other
> > targets, but not knowing exactly when it would have to be recomputed,
> > for most targets, I prefer not to do this optimisation myself.
> 
> I like this version. Tested with x86 and mips, on Linux/ppc host.

Thanks for testing.
I guess it's safe... but I'd like to get more reports or comments about
it before applying this !

-- 
J. Mayer <l_indien@magic.fr>
Never organized

  reply	other threads:[~2007-10-11 22:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-09 19:33 [Qemu-devel] RFC: cleanups: CPU_MEM_INDEX J. Mayer
2007-10-10  0:12 ` Thiemo Seufer
2007-10-10  5:06   ` J. Mayer
2007-10-11 12:09     ` J. Mayer
2007-10-11 17:46       ` Thiemo Seufer
2007-10-11 22:27         ` J. Mayer [this message]
2007-10-12  7:01       ` J. Mayer
2007-10-13 21:14         ` J. Mayer
2007-10-13 22:55           ` Thiemo Seufer

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=1192141669.9976.239.camel@rapid \
    --to=l_indien@magic.fr \
    --cc=qemu-devel@nongnu.org \
    --cc=ths@networkno.de \
    /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.