From patchwork Fri Oct 24 11:37:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 39443 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3977024026 for ; Fri, 24 Oct 2014 11:41:25 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id a1sf553387wgh.9 for ; Fri, 24 Oct 2014 04:41:24 -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=gDwm5CHNVc+kQCiQDKW4MmZvfS/Tn5swDfN07Mw5mc0=; b=VrEffRG4ptps7xepqSbGxB7NHS0ePQyg9xDN9/yi+JAwNXrEPktThpJxMlatloV2Cb lxlLCrTygg8AYij226RwGd3MEuRTf1736+f5Nb01DyqHtRyHG1pmeykgHZ8/OblN+rR8 PnzUBvYxYF1uTb5gcN5uCiJyrXw+bfHbpUakE1H2QxVwQHlO4cyNmzDQuaxWzYo8Ex44 ZMVZxL0RiKTNo2yp5GGsvXDW19dWHcx7AzmiaflP8THSJYIAFvzTALYEvfdoANIdBuDS cB5+LhfPMrwT1MBYYKjON+mBPp8NqukaTZDqjTOy38p+/ZsYKHQPb78vULefXeENP/ww 9oyA== X-Gm-Message-State: ALoCoQmeATRQyEnI5ZqUERqDKM/DViQbpZ8cCo4yl2zc7HmOSeBlYZSnBQzBrLu7GNCQA5lvovZA X-Received: by 10.194.100.98 with SMTP id ex2mr21180wjb.6.1414150884410; Fri, 24 Oct 2014 04:41:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.227 with SMTP id ap3ls435528lac.31.gmail; Fri, 24 Oct 2014 04:41:24 -0700 (PDT) X-Received: by 10.152.21.135 with SMTP id v7mr3895516lae.65.1414150884258; Fri, 24 Oct 2014 04:41:24 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id w4si6563027laj.78.2014.10.24.04.41.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Oct 2014 04:41:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id p9so2448869lbv.33 for ; Fri, 24 Oct 2014 04:41:24 -0700 (PDT) X-Received: by 10.152.116.102 with SMTP id jv6mr3947088lab.40.1414150884178; Fri, 24 Oct 2014 04:41:24 -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.84.229 with SMTP id c5csp411536lbz; Fri, 24 Oct 2014 04:41:23 -0700 (PDT) X-Received: by 10.140.44.8 with SMTP id f8mr4627323qga.105.1414150882960; Fri, 24 Oct 2014 04:41:22 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id w107si7341610qge.81.2014.10.24.04.41.22 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 24 Oct 2014 04:41:22 -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]:46799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhdFC-00031s-40 for patch@linaro.org; Fri, 24 Oct 2014 07:41:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhdBc-0006ZX-Qw for qemu-devel@nongnu.org; Fri, 24 Oct 2014 07:37:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XhdBb-0008R3-5r for qemu-devel@nongnu.org; Fri, 24 Oct 2014 07:37:40 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:54280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhdBb-0008OE-0N for qemu-devel@nongnu.org; Fri, 24 Oct 2014 07:37:39 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1XhdBS-0007wR-C6 for qemu-devel@nongnu.org; Fri, 24 Oct 2014 12:37:30 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 24 Oct 2014 12:37:21 +0100 Message-Id: <1414150649-30428-16-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1414150649-30428-1-git-send-email-peter.maydell@linaro.org> References: <1414150649-30428-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 15/23] target-arm: Correct sense of the DCZID DZP bit 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.217.174 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 DZP bit in the DCZID system register should be set if the control bits which prohibit use of the DC ZVA instruction have been set (it stands for Data Zero Prohibited). However we had the sense of the test inverted; fix this so that the bit reads correctly. To avoid this regressing the behaviour of the user-mode emulator, we must set the DZE bit in the SCTLR for that config so that userspace continues to see DZP as zero (it was getting the correct result by accident previously). Reported-by: Christopher Covington Signed-off-by: Peter Maydell Reviewed-by: Christopher Covington Message-id: 1412959792-20708-1-git-send-email-peter.maydell@linaro.org --- target-arm/cpu.c | 4 ++-- target-arm/helper.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target-arm/cpu.c b/target-arm/cpu.c index e837f64..e0b82a6 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -108,8 +108,8 @@ static void arm_cpu_reset(CPUState *s) env->aarch64 = 1; #if defined(CONFIG_USER_ONLY) env->pstate = PSTATE_MODE_EL0t; - /* Userspace expects access to CTL_EL0 and the cache ops */ - env->cp15.c1_sys |= SCTLR_UCT | SCTLR_UCI; + /* Userspace expects access to DC ZVA, CTL_EL0 and the cache ops */ + env->cp15.c1_sys |= SCTLR_UCT | SCTLR_UCI | SCTLR_DZE; /* and to the FP/Neon instructions */ env->cp15.c1_coproc = deposit64(env->cp15.c1_coproc, 20, 2, 3); #else diff --git a/target-arm/helper.c b/target-arm/helper.c index d837820..53527c2 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -2018,7 +2018,7 @@ static uint64_t aa64_dczid_read(CPUARMState *env, const ARMCPRegInfo *ri) int dzp_bit = 1 << 4; /* DZP indicates whether DC ZVA access is allowed */ - if (aa64_zva_access(env, NULL) != CP_ACCESS_OK) { + if (aa64_zva_access(env, NULL) == CP_ACCESS_OK) { dzp_bit = 0; } return cpu->dcz_blocksize | dzp_bit;