From patchwork Fri Aug 22 13:42:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 35819 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1C4AF20540 for ; Fri, 22 Aug 2014 13:43:27 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id v10sf78798705pde.2 for ; Fri, 22 Aug 2014 06:43:26 -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:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=kZ382RPVtkSlKrJPpfpi67sJ9uEk0VErUJjCPiDdP5c=; b=BIw+416WLs0v4uWtevY1mbkYL5smZCAyhc0u50cDT3S8PeqZcUCn96BJmWy1OLXgBW n7sc9BdwT84Sl1PUCuEQvlSIR2Xm119XMLJlXEq7TtfRAKvKxIqN62o6CstlUPZwmZbR Q52MCRnVlfB3uGmCwwFwpgLIB/rJyvRmKOR/sJpTrA9MX7vFsZlqxnF/qtIGhbrzov5f eCqa6bHWkEuXyKVQAJ0hX4TD/4kkxWjY40u1SWDhlUCpT7bmZ04QyI0PFVm7rETesbOV dCpRQcqe89J7HLWcV8ulAW/DMmyB/PyYBmPamUS5e40797cPHsM8O+m0J4twpxKWEmgS 2jeg== X-Gm-Message-State: ALoCoQkApaOsgNzvWQL1KuXwqUZxoksn/+rr4EHVGD4+q0uRhs1VcOzw892xSBBeG1GLRB3QxfEN X-Received: by 10.66.241.104 with SMTP id wh8mr3330657pac.33.1408715006438; Fri, 22 Aug 2014 06:43:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.105.247 with SMTP id c110ls580876qgf.5.gmail; Fri, 22 Aug 2014 06:43:26 -0700 (PDT) X-Received: by 10.220.97.5 with SMTP id j5mr4185722vcn.16.1408715006314; Fri, 22 Aug 2014 06:43:26 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id n4si13583811vda.71.2014.08.22.06.43.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Aug 2014 06:43:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id hy4so12292964vcb.36 for ; Fri, 22 Aug 2014 06:43:26 -0700 (PDT) X-Received: by 10.220.105.142 with SMTP id t14mr2353448vco.14.1408715006206; Fri, 22 Aug 2014 06:43:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp17955vcb; Fri, 22 Aug 2014 06:43:25 -0700 (PDT) X-Received: by 10.195.12.4 with SMTP id em4mr5446478wjd.98.1408715005088; Fri, 22 Aug 2014 06:43:25 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id cl4si37651916wjc.125.2014.08.22.06.43.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 22 Aug 2014 06:43:24 -0700 (PDT) Received-SPF: none (google.com: pm215@archaic.org.uk does not designate permitted sender hosts) client-ip=81.2.115.146; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1XKp6i-0001sT-IX; Fri, 22 Aug 2014 14:42:20 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Jakub Jermar Subject: [PATCH] target-arm: Fix regression that disabled VFP for ARMv5 CPUs Date: Fri, 22 Aug 2014 14:42:20 +0100 Message-Id: <1408714940-7192-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 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.220.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Commit 2c7ffc414 added support for honouring the CPACR coprocessor access control register bits which may disable access to VFP and Neon instructions. However it failed to account for the fact that the CPACR is only present starting from the ARMv6 architecture version, so it accidentally disabled VFP completely for ARMv5 CPUs like the ARM926. Linux would detect this as "no VFP present" and probably fall back to its own emulation, but other guest OSes might crash or misbehave. This fixes bug LP:1359930. Reported-by: Jakub Jermar Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell --- target-arm/cpu.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 8098b8d..659b104 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -1255,7 +1255,14 @@ static inline bool arm_singlestep_active(CPUARMState *env) static inline void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, target_ulong *cs_base, int *flags) { - int fpen = extract32(env->cp15.c1_coproc, 20, 2); + int fpen; + + if (arm_feature(env, ARM_FEATURE_V6)) { + fpen = extract32(env->cp15.c1_coproc, 20, 2); + } else { + /* CPACR doesn't exist before v6, so VFP is always accessible */ + fpen = 3; + } if (is_a64(env)) { *pc = env->pc;