From patchwork Wed Jul 15 16:25:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 51129 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4AED022A28 for ; Wed, 15 Jul 2015 16:26:43 +0000 (UTC) Received: by wipp2 with SMTP id p2sf668993wip.2 for ; Wed, 15 Jul 2015 09:26:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=Fnu7Cq8Aq8N79jrOvK/33hC/nUgXbMJ49PJT1zrU5lY=; b=GOm/aRy5bAWuZ93+ZPqOfqdmk5A0ry8HkSs/MHnjX6+kRLaNP6ct1jDBep6USWoxnh deg13pRlxWrdt3rQjuRsriv+ZUWLNrNJYt7Sm+T6yOh2hCVh42fsy9gKsxhM1Ib1jmPW gFIJf6APITVqzkc1/rTadIu1vAGt5+k4UqO2GUmmKl2aZj1qK6s1J3A9AXjFM3TJ8FJ6 TlPg0BSBwGA/QOAM8ERP9UYfFWkuEbH/Q9GhVIinexMm/jUvqHqZwuEsjdV21WhAvis8 B2ZKHQyteqZ2LYnb7ca6cPUxkyeIdLt+yhb2vx//8GqPbs8C4MMd9udW6TLHfrek5Ytx k5lg== X-Gm-Message-State: ALoCoQkLDVSLZQERLp2iZ6ULZXyxInbHJFVl1Izv4BtGk2LXDYrafXVDn+LPptSRhNJOszSSXkR+ X-Received: by 10.112.9.100 with SMTP id y4mr2511463lba.20.1436977602496; Wed, 15 Jul 2015 09:26:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.197 with SMTP id ao5ls266347lac.53.gmail; Wed, 15 Jul 2015 09:26:42 -0700 (PDT) X-Received: by 10.152.22.168 with SMTP id e8mr5073457laf.40.1436977602225; Wed, 15 Jul 2015 09:26:42 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id k9si4419298lah.119.2015.07.15.09.26.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jul 2015 09:26:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by lahh5 with SMTP id h5so27968494lah.2 for ; Wed, 15 Jul 2015 09:26:42 -0700 (PDT) X-Received: by 10.152.5.228 with SMTP id v4mr5054787lav.36.1436977602133; Wed, 15 Jul 2015 09:26:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3200683lbb; Wed, 15 Jul 2015 09:26:41 -0700 (PDT) X-Received: by 10.180.106.195 with SMTP id gw3mr578812wib.25.1436977601570; Wed, 15 Jul 2015 09:26:41 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r2si8820093wjy.34.2015.07.15.09.26.41 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 15 Jul 2015 09:26:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:36674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFPW4-0008S1-B4 for patch@linaro.org; Wed, 15 Jul 2015 12:26:40 -0400 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 To: qemu-devel@nongnu.org Date: Wed, 15 Jul 2015 17:25:49 +0100 Message-Id: <1436977550-30977-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1436977550-30977-1-git-send-email-peter.maydell@linaro.org> References: <1436977550-30977-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 1/2] target-arm: Fix broken SCTLR_EL3 reset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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]) },