qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Status of the SH4 / ARM7 emulators


From: Andreas Färber
Subject: Re: [Qemu-devel] Status of the SH4 / ARM7 emulators
Date: Thu, 24 Nov 2011 11:44:04 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111105 Thunderbird/8.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]