From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrlCR-00077M-7F for qemu-devel@nongnu.org; Mon, 11 May 2015 06:44:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YrlCO-0002c4-1n for qemu-devel@nongnu.org; Mon, 11 May 2015 06:44:39 -0400 Received: from cantor2.suse.de ([195.135.220.15]:37626 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrlCN-0002bx-Rx for qemu-devel@nongnu.org; Mon, 11 May 2015 06:44:35 -0400 Message-ID: <55508809.7070603@suse.de> Date: Mon, 11 May 2015 12:44:25 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH 00/34] Multi Architecture System Emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Edgar Iglesias , Peter Maydell , QEMU Developers , Peter Crosthwaite , Soren Brinkmann , Richard Henderson Am 11.05.2015 um 10:21 schrieb Peter Crosthwaite: > On Mon, May 11, 2015 at 12:13 AM, Peter Maydell > wrote: >> On 11 May 2015 at 07:29, Peter Crosthwaite wrote: >>> The env as handle by common code now needs to architecture-agnostic. = The >>> MB and ARM envs are refactored to have CPU_COMMON as the first field(= s) >>> allowing QOM-style pointer casts to/from a generic env which contains= only >>> CPU_COMMON. Might need to lock down some struct packing for that but = it >>> works for me so far. >> >> Have you managed to retain the "generated code passes around a pointer >> to an env which starts with the CPU specific fields"? We have the env >> structs the layout we do because it's a performance hit if the registe= rs >> aren't a short distance away from the pointer... >=20 > OK, I knew there had to be a reason. So I guess the simplest > alternative is pad the env out so the arch-specific env sections are > the same length followed by a CPU_COMMON. A bit of union { struct {} } > stuffs might just do the trick although there will be some earthworks > on cpu.h. Please keep in mind that the reason of the current CPUState layout is (hopefully documented?) that we were allowing negative offsets for common CPUState fields fields while retaining positive offsets for CPUArchState fields. So you are free to move stuff from CPU_COMMON to somewhere before env in CPUState. Andreas --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Felix Imend=C3=B6rffer, Jane Smithard, Dilip Upmanyu, Graham Norton; = HRB 21284 (AG N=C3=BCrnberg)