From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8GML-00026l-QM for qemu-devel@nongnu.org; Thu, 15 Mar 2012 15:29:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8GMJ-0006Kj-NU for qemu-devel@nongnu.org; Thu, 15 Mar 2012 15:29:13 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:64316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8GMJ-0006Iz-Ep for qemu-devel@nongnu.org; Thu, 15 Mar 2012 15:29:11 -0400 Received: by werp12 with SMTP id p12so3677053wer.4 for ; Thu, 15 Mar 2012 12:29:08 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1330893156-26569-1-git-send-email-afaerber@suse.de> <1331398436-20761-1-git-send-email-afaerber@suse.de> <1331398436-20761-9-git-send-email-afaerber@suse.de> <201203151908.45065.paul@codesourcery.com> Date: Thu, 15 Mar 2012 22:29:08 +0300 Message-ID: From: Alexey Starikovskiy Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH RFC v4 08/20] target-arm: Store cp15 c0_c1 and c0_c2 in ARMCPUClass List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, Paul Brook , =?ISO-8859-1?Q?Andreas_F=E4rber?= On Thu, Mar 15, 2012 at 11:20 PM, Peter Maydell wrote: > On 15 March 2012 19:08, Paul Brook wrote: >>> For now set them in the reset function. >> >>> + =A0 =A0/* TODO Move these into arm_cpu_initfn() once no longer zeroed= above.*/ >>> + =A0 =A0memcpy(env->cp15.c0_c1, klass->cp15.c0_c1, 8 * sizeof(uint32_t= )); >>> + =A0 =A0memcpy(env->cp15.c0_c2, klass->cp15.c0_c2, 8 * sizeof(uint32_t= )); + >> >> Why bother copying them into the CPU state? =A0These are readonly, so an= ything >> that needs them should be able to use the value straight from the class >> definitions. > > In my (hugely delayed) cp15 rework attempt these probably go away anyway > in favour of having each CPU register a pile of registers along the lines= of > > =A0 =A0{ .name =3D "ID_PFR0", .cp =3D 15, .crn =3D 0, .crm =3D 1, .opc1 = =3D 0, .opc2 =3D 0, > =A0 =A0 =A0.access =3D PL1_R, .type =3D ARM_CP_CONST, .resetvalue =3D 0x0= 0001231 }, > =A0 =A0{ .name =3D "ID_PFR1", .cp =3D 15, .crn =3D 0, .crm =3D 1, .opc1 = =3D 0, .opc2 =3D 1, > =A0 =A0 =A0.access =3D PL1_R, .type =3D ARM_CP_CONST, .resetvalue =3D 0x0= 0000011 }, > etc. > > I'm not sure there's any need to retain the CPUState (or equivalent) fiel= ds > for them at that point. > > -- PMM > Peter, with the reserved bits in most registers it might make sense to have resetvalue in two masks -- ones and zeros, so that you can prevent changing of those bits. Alex.