qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <andreas.faerber@web.de>
To: Richard Henderson <rth@twiddle.net>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Renato Utsch <renatoutsch@gmail.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Status of the SH4 / ARM7 emulators
Date: Thu, 24 Nov 2011 11:44:04 +0100	[thread overview]
Message-ID: <4ECE1FF4.50303@web.de> (raw)
In-Reply-To: <4ECD6CA9.9070601@twiddle.net>

Am 23.11.2011 22:59, schrieb Richard Henderson:
> On 11/20/2011 12:51 PM, Andreas Färber wrote:
>> * Part of the problem is that common CPUState fields are not at the
>> start of the struct. I have therefore been playing with a
>> CPU_COMMON_PREFIX at the start of the struct and using a macro for
>> clearing on reset, which preserves part of the common prefix fields.
> 
> Most of the RISC hosts have a limited displacement in their load and
> store instructions.  E.g. 14 bits for Sparc, 12 bits for ARM, 10.
> We want to be able to load and store the target cpu registers very
> efficiently.
> 
> If you move all the common fields to the beginning, that will include
> the (rather large) TLB tables, and overflow those small offsets.
> 
> This change would almost certainly be a Large Mistake.

Then what is your suggestion?

Today, common code is accessing env-> struct members directly for
icount, TLB, etc. If they're at the end of the struct, offsets vary and
we can't cast to a common-subset struct.

Anthony's qom-upstream.4 branch doesn't seem to touch CPUState yet.
Having an empty C++ base class with virtual, non-implemented accessor
methods that are implemented for each arch is the only solution I can
think of other than "proxy" functions with large switches based on a
common (=prefixed) type field.

Andreas

  reply	other threads:[~2011-11-24 10:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-19 21:20 [Qemu-devel] Status of the SH4 / ARM7 emulators Renato Utsch
2011-11-19 21:53 ` Peter Maydell
2011-11-20 20:51   ` Andreas Färber
2011-11-20 21:48     ` Peter Maydell
2011-11-23 21:59     ` Richard Henderson
2011-11-24 10:44       ` Andreas Färber [this message]
2011-11-29  9:09         ` Tristan Gingold
2011-11-29 15:47           ` Richard Henderson
2011-11-20 18:08 ` Andreas Färber
2011-11-20 19:56   ` Peter Maydell

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=4ECE1FF4.50303@web.de \
    --to=andreas.faerber@web.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=renatoutsch@gmail.com \
    --cc=rth@twiddle.net \
    /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).