Received: from eggs.gnu.org ([2001:4830:134:3::10]:52353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEevl-0001yV-D2 for qemu-devel@nongnu.org; Mon, 13 Jul 2015 10:42:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEevg-0003aI-H4 for qemu-devel@nongnu.org; Mon, 13 Jul 2015 10:42:05 -0400 Received: from mail-pd0-x22c.google.com ([2607:f8b0:400e:c02::22c]:33059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEevg-0003Zs-8I for qemu-devel@nongnu.org; Mon, 13 Jul 2015 10:42:00 -0400 Received: by pdbqm3 with SMTP id qm3so81414796pdb.0 for ; Mon, 13 Jul 2015 07:41:59 -0700 (PDT) Date: Tue, 14 Jul 2015 00:41:54 +1000 From: "Edgar E. Iglesias" Message-ID: <20150713144154.GB4658@toto> References: <1436797465-20782-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436797465-20782-1-git-send-email-peter.maydell@linaro.org> Subject: Re: [Qemu-devel] [PATCH for-2.4] target-arm: Fix broken SCTLR_EL3 reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "Edgar E. Iglesias" , qemu-devel@nongnu.org, davidcdueck@googlemail.com, patches@linaro.org On Mon, Jul 13, 2015 at 03:24:25PM +0100, Peter Maydell wrote: > The SCTLR_EL3 cpreg definition was implicitly resetting the > register state to 0, which is both wrong and clashes with > the reset done via the SCTLR definition (since sctlr[3] > is unioned with sctlr_s). This went unnoticed until recently, > when an unrelated change (commit a903c449b41f105aa) happened to > perturb the order of enumeration through the cpregs hashtable for > reset such that the erroneous reset happened after the correct one > rather than before it. Fix this by marking SCTLR_EL3 as an alias, > so its reset is left up to the AArch32 view. > > Signed-off-by: Peter Maydell Ouch! Thanks! Reviewed-by: Edgar E. Iglesias Cheers, Edgar > --- > This was causing Greg's trustzone testsuite to fail. > > target-arm/helper.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/target-arm/helper.c b/target-arm/helper.c > index b87afe7..01f0d0d 100644 > --- a/target-arm/helper.c > +++ b/target-arm/helper.c > @@ -2752,6 +2752,7 @@ static const ARMCPRegInfo el3_cp_reginfo[] = { > .access = PL3_RW, .writefn = vbar_write, .resetvalue = 0, > .fieldoffset = offsetof(CPUARMState, cp15.mvbar) }, > { .name = "SCTLR_EL3", .state = ARM_CP_STATE_AA64, > + .type = ARM_CP_ALIAS, /* reset handled by AArch32 view */ > .opc0 = 3, .opc1 = 6, .crn = 1, .crm = 0, .opc2 = 0, > .access = PL3_RW, .raw_writefn = raw_write, .writefn = sctlr_write, > .fieldoffset = offsetof(CPUARMState, cp15.sctlr_el[3]) }, > -- > 1.9.1 > >