From patchwork Fri Jan 31 15:45:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 23956 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9D963202B2 for ; Fri, 31 Jan 2014 15:46:44 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id ii20sf9980416qab.5 for ; Fri, 31 Jan 2014 07:46:43 -0800 (PST) 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:cc: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=YBhfmo+UVPNiHSGiPSZOOopvBztWJ1kYXTN2gqIEYvI=; b=lnaD407ShtXP+rR3kcGy8i0vrWDHjv0F54+3AMM7CLg1EsiErrK5/WqfzdP+E9Wqux PeZeZEeVUfcEKcfrqNCxevJyp/9swIFP5EjjKkrW6vOtukBriTB2WBOhqns12wCPfMgw xFacr6aCv6AZQ3PhR/KHaIvZigO2zqTnFbh0Sw5am9wwhUU1wFIE+vkkVY0/FK5nLp4G YHB/1qHyRfeA6K391XrpsUWrxlInB7jGTGtJ6W04j1YNiA+wNeb2MwudKBs7JwbwrfmZ FDmDWYRQcIgsA07bBnEGzQuXPG4PBXKZwJ2AiCt6k+WvTwdnupTlkpl3hLXCcjqfHO70 42bg== X-Gm-Message-State: ALoCoQly3tVkIC8uWZItoy7kCgOi+QoZ5c1YUSzi9eQykLPZ8ZQj1CyrHbyHTj1qvmc84woFxwfL X-Received: by 10.58.144.41 with SMTP id sj9mr7558387veb.8.1391183203795; Fri, 31 Jan 2014 07:46:43 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.107.199 with SMTP id h65ls924962qgf.76.gmail; Fri, 31 Jan 2014 07:46:43 -0800 (PST) X-Received: by 10.221.26.10 with SMTP id rk10mr17160239vcb.0.1391183203696; Fri, 31 Jan 2014 07:46:43 -0800 (PST) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id nc1si3650317vec.24.2014.01.31.07.46.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Jan 2014 07:46:43 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.45 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.45; Received: by mail-vb0-f45.google.com with SMTP id m10so3069172vbh.32 for ; Fri, 31 Jan 2014 07:46:43 -0800 (PST) X-Received: by 10.52.30.167 with SMTP id t7mr2150729vdh.36.1391183203612; Fri, 31 Jan 2014 07:46:43 -0800 (PST) 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.220.174.196 with SMTP id u4csp105718vcz; Fri, 31 Jan 2014 07:46:43 -0800 (PST) X-Received: by 10.224.127.202 with SMTP id h10mr33161172qas.23.1391183203008; Fri, 31 Jan 2014 07:46:43 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t7si7884380qav.132.2014.01.31.07.46.42 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 31 Jan 2014 07:46:42 -0800 (PST) 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]:56434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9GIk-0005mF-6m for patch@linaro.org; Fri, 31 Jan 2014 10:46:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9GHx-0004wM-82 for qemu-devel@nongnu.org; Fri, 31 Jan 2014 10:45:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9GHs-0001gE-RS for qemu-devel@nongnu.org; Fri, 31 Jan 2014 10:45:53 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:45333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9GHs-0001g2-KS for qemu-devel@nongnu.org; Fri, 31 Jan 2014 10:45:48 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1W9GHn-00080T-PQ; Fri, 31 Jan 2014 15:45:43 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 31 Jan 2014 15:45:15 +0000 Message-Id: <1391183143-30724-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391183143-30724-1-git-send-email-peter.maydell@linaro.org> References: <1391183143-30724-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 Cc: Rob Herring , Peter Crosthwaite , patches@linaro.org, Michael Matz , Alexander Graf , Claudio Fontana , Dirk Mueller , Will Newton , Laurent Desnogues , =?UTF-8?q?Alex=20Benn=C3=A9e?= , kvmarm@lists.cs.columbia.edu, Christoffer Dall , Richard Henderson Subject: [Qemu-devel] [PATCH v2 07/35] target-arm: Add exception level to the AArch64 TB flags 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=neutral (google.com: 209.85.212.45 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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 We already implicitly rely on the exception level being part of the TB flags for coprocessor access, so actually include it. (This makes no difference for linux-user mode, which is always in EL0, but will be needed for correct operation in system emulation.) Signed-off-by: Peter Maydell --- target-arm/cpu.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 70cd5a0..385cfcd 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -1056,7 +1056,9 @@ static inline int cpu_mmu_index (CPUARMState *env) #define ARM_TBFLAG_BSWAP_CODE_SHIFT 16 #define ARM_TBFLAG_BSWAP_CODE_MASK (1 << ARM_TBFLAG_BSWAP_CODE_SHIFT) -/* Bit usage when in AArch64 state: currently no bits defined */ +/* Bit usage when in AArch64 state */ +#define ARM_TBFLAG_AA64_EL_SHIFT 0 +#define ARM_TBFLAG_AA64_EL_MASK (0x3 << ARM_TBFLAG_AA64_EL_SHIFT) /* some convenience accessor macros */ #define ARM_TBFLAG_AARCH64_STATE(F) \ @@ -1075,13 +1077,16 @@ static inline int cpu_mmu_index (CPUARMState *env) (((F) & ARM_TBFLAG_CONDEXEC_MASK) >> ARM_TBFLAG_CONDEXEC_SHIFT) #define ARM_TBFLAG_BSWAP_CODE(F) \ (((F) & ARM_TBFLAG_BSWAP_CODE_MASK) >> ARM_TBFLAG_BSWAP_CODE_SHIFT) +#define ARM_TBFLAG_AA64_EL(F) \ + (((F) & ARM_TBFLAG_AA64_EL_MASK) >> ARM_TBFLAG_AA64_EL_SHIFT) static inline void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, target_ulong *cs_base, int *flags) { if (is_a64(env)) { *pc = env->pc; - *flags = ARM_TBFLAG_AARCH64_STATE_MASK; + *flags = ARM_TBFLAG_AARCH64_STATE_MASK + | arm_current_pl(env) << ARM_TBFLAG_AA64_EL_SHIFT; } else { int privmode; *pc = env->regs[15];