Received: from eggs.gnu.org ([2001:4830:134:3::10]:45135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnlfg-00019V-Vj for qemu-devel@nongnu.org; Tue, 03 Dec 2013 03:49:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnlfY-000757-Nh for qemu-devel@nongnu.org; Tue, 03 Dec 2013 03:49:32 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:61662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnlfY-00074z-Hf for qemu-devel@nongnu.org; Tue, 03 Dec 2013 03:49:24 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MX8004LW36BXW30@mailout3.w1.samsung.com> for qemu-devel@nongnu.org; Tue, 03 Dec 2013 08:49:23 +0000 (GMT) From: Sergey Fedorov Date: Tue, 03 Dec 2013 12:48:42 +0400 Message-id: <1386060535-15908-9-git-send-email-s.fedorov@samsung.com> In-reply-to: <1386060535-15908-1-git-send-email-s.fedorov@samsung.com> References: <1386060535-15908-1-git-send-email-s.fedorov@samsung.com> Subject: [Qemu-devel] [RFC PATCH 08/21] target-arm: adjust arm_current_pl() for TrustZone List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, a.basov@samsung.com, Sergey Fedorov , johannes.winter@iaik.tugraz.at Make arm_current_pl() to return PL3 in secure privileged mode. Signed-off-by: Sergey Fedorov --- target-arm/cpu.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index a00c86f..1b03450 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -622,9 +622,11 @@ static inline int arm_current_pl(CPUARMState *env) { if ((env->uncached_cpsr & 0x1f) == ARM_CPU_MODE_USR) { return 0; + } else if (arm_is_secure(env)) { + return 3; } - /* We don't currently implement the Virtualization or TrustZone - * extensions, so PL2 and PL3 don't exist for us. + /* We don't currently implement the Virtualization extensions, so PL2 don't + * exist for us. */ return 1; } -- 1.7.9.5