From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTWnK-0001sF-37 for qemu-devel@nongnu.org; Thu, 24 Nov 2011 05:44:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTWnI-0006RW-Pd for qemu-devel@nongnu.org; Thu, 24 Nov 2011 05:44:42 -0500 Received: from mout.web.de ([212.227.15.4]:61130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTWnI-0006RO-Ej for qemu-devel@nongnu.org; Thu, 24 Nov 2011 05:44:40 -0500 Message-ID: <4ECE1FF4.50303@web.de> Date: Thu, 24 Nov 2011 11:44:04 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <4EC96838.9000907@web.de> <4ECD6CA9.9070601@twiddle.net> In-Reply-To: <4ECD6CA9.9070601@twiddle.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] Status of the SH4 / ARM7 emulators List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Peter Maydell , Renato Utsch , qemu-devel@nongnu.org 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