From patchwork Fri Nov 19 15:36:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 72261 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 597261007D2 for ; Sat, 20 Nov 2010 02:37:36 +1100 (EST) Received: from localhost ([127.0.0.1]:32789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJT1p-0006D2-Pt for incoming@patchwork.ozlabs.org; Fri, 19 Nov 2010 10:37:33 -0500 Received: from [140.186.70.92] (port=37133 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJT19-0006C1-EA for qemu-devel@nongnu.org; Fri, 19 Nov 2010 10:36:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJT18-00073h-Di for qemu-devel@nongnu.org; Fri, 19 Nov 2010 10:36:51 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:47049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJT18-00073T-6D for qemu-devel@nongnu.org; Fri, 19 Nov 2010 10:36:50 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.69) (envelope-from ) id 1PJT15-0003Gk-FG; Fri, 19 Nov 2010 15:36:47 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 19 Nov 2010 15:36:47 +0000 Message-Id: <1290181007-12545-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Lars Munch Subject: [Qemu-devel] [PATCH] ARM: enable XScale/iWMMXT in linux-user mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org In linux-user mode, the XScale/iWMMXT coprocessors must be enabled at reset so that we can run code that uses these instructions. Signed-off-by: Peter Maydell --- target-arm/helper.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 996d40d..94aef39 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -203,7 +203,13 @@ void cpu_reset(CPUARMState *env) cpu_reset_model_id(env, id); #if defined (CONFIG_USER_ONLY) env->uncached_cpsr = ARM_CPU_MODE_USR; + /* For user mode we must enable access to coprocessors */ env->vfp.xregs[ARM_VFP_FPEXC] = 1 << 30; + if (arm_feature(env, ARM_FEATURE_IWMMXT)) { + env->cp15.c15_cpar = 3; + } else if (arm_feature(env, ARM_FEATURE_XSCALE)) { + env->cp15.c15_cpar = 1; + } #else /* SVC mode with interrupts disabled. */ env->uncached_cpsr = ARM_CPU_MODE_SVC | CPSR_A | CPSR_F | CPSR_I;