From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFPVP-0007tJ-Vy for qemu-devel@nongnu.org; Wed, 15 Jul 2015 12:26:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFPVO-0002oF-Sc for qemu-devel@nongnu.org; Wed, 15 Jul 2015 12:25:59 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFPVO-0002lZ-D0 for qemu-devel@nongnu.org; Wed, 15 Jul 2015 12:25:58 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZFPVG-00084A-LM for qemu-devel@nongnu.org; Wed, 15 Jul 2015 17:25:50 +0100 From: Peter Maydell Date: Wed, 15 Jul 2015 17:25:49 +0100 Message-Id: <1436977550-30977-2-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1436977550-30977-1-git-send-email-peter.maydell@linaro.org> References: <1436977550-30977-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 1/2] target-arm: Fix broken SCTLR_EL3 reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Reviewed-by: Edgar E. Iglesias --- 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